Xilinx ISE 9.2 and ISE 10.1 I wanted to design a simple correlator which correlates a 15 bit sequence with another sequence of 15 bytes (8 bit signed values = Sample below). I needed to zero the summation result after 15 samples, so I did. But compiler didn't. There is no warning but even the simulator does not seem to notice ACC <= x"000000"; line. I do not see a reset input for the inferred updown accumulator in the RTL schematic either. But I see an unconnected D(L:R) input on accumulator. I see that, from the simulator outputs, Corr<=ACC; line is synthesized and working ok, though. What am I missing. Thanks for help to the beginner. Additional question (bonus? :-( ) : Waveform editor does not accept -100 for a 8-bit signed decimal signal but displays -28 instead. When I enter binary 10011100 which corresponds to -100 and display the values in decimal it interestingly displays -100. Does it mean -28 equals to -100 somehow? architecture Rec of Rec is constant PN : BIT_VECTOR (14 downto 0) := "000100110101111"; signal ACC : SIGNED (23 downto 0) := x"000000"; signal cntr : integer range 0 to 14 := 0; begin process(clk) begin if(clk'event and clk='1') then if(cntr=0) then Corr <= ACC; ACC <= x"000000"; -- Problematic line is this one end if; if(PN(cntr)='1') then ACC <= ACC + Sample; else ACC <= ACC - Sample; end if; if(cntr=14) then cntr <= 0; else cntr <= cntr +1; end if; end if; end process; end Rec;
Still a Beginner: Accumulator has no reset
Started by ●June 28, 2008
Reply by ●June 28, 20082008-06-28
Hi, In the if-else immediately following your reset of ACC, you assign to ACC again, overriding any previous assignment. Depending on the intended behavior of your circuit you could switch to using variables or reorganize your if's in a way that ACC is assigned only once. Regards, -- Hauke D On Jun 28, 6:57=A0pm, meralonu...@gmail.com wrote:> Xilinx ISE 9.2 and ISE 10.1 > I wanted to design a simple correlator which correlates a 15 bit > sequence with another sequence of 15 bytes (8 bit signed values =3D > Sample below). I needed to zero the summation result after 15 samples, > so I did. But compiler didn't. There is no warning but even the > simulator does not seem to notice ACC <=3D x"000000"; line. I do not see > a reset input for the inferred updown accumulator in the RTL schematic > either. But I see an unconnected D(L:R) input on accumulator. > I see that, from the simulator outputs, Corr<=3DACC; line is synthesized > and working ok, though. > What am I missing. Thanks for help to the beginner. > Additional question (bonus? :-( ) : Waveform editor does not accept > -100 for a 8-bit signed decimal signal but displays -28 instead. When > I enter binary 10011100 which corresponds to -100 and display the > values in decimal it interestingly displays -100. Does it mean -28 > equals to -100 somehow? > > architecture Rec of Rec is > =A0 constant PN : BIT_VECTOR (14 downto 0) :=3D "000100110101111"; > =A0 signal ACC =A0: SIGNED (23 downto 0) :=3D x"000000"; > =A0 signal cntr : integer range 0 to 14 :=3D 0; > begin > =A0 process(clk) begin > =A0 =A0 if(clk'event and clk=3D'1') then > =A0 =A0 =A0 if(cntr=3D0) then > =A0 =A0 =A0 =A0 Corr <=3D ACC; > =A0 =A0 =A0 =A0 ACC <=3D x"000000"; =A0-- Problematic line is this one > =A0 =A0 =A0 end if; > =A0 =A0 =A0 if(PN(cntr)=3D'1') then > =A0 =A0 =A0 =A0 ACC <=3D ACC + Sample; > =A0 =A0 =A0 else > =A0 =A0 =A0 =A0 ACC <=3D ACC - Sample; > =A0 =A0 =A0 end if; > =A0 =A0 =A0 if(cntr=3D14) then > =A0 =A0 =A0 =A0 cntr <=3D 0; > =A0 =A0 =A0 else > =A0 =A0 =A0 =A0 cntr <=3D cntr +1; > =A0 =A0 =A0 end if; > =A0 =A0 end if; > =A0 end process; > end Rec;
Reply by ●June 28, 20082008-06-28
<meralonurlu@gmail.com> wrote in message news:74798b96-6f57-4afd-8b29-2374fd04eb6c@t54g2000hsg.googlegroups.com...> Xilinx ISE 9.2 and ISE 10.1 > I wanted to design a simple correlator which correlates a 15 bit > sequence with another sequence of 15 bytes (8 bit signed values = > Sample below). I needed to zero the summation result after 15 samples, > so I did. But compiler didn't. There is no warning but even the > simulator does not seem to notice ACC <= x"000000"; line. I do not see > a reset input for the inferred updown accumulator in the RTL schematic > either. But I see an unconnected D(L:R) input on accumulator. > I see that, from the simulator outputs, Corr<=ACC; line is synthesized > and working ok, though. > What am I missing. Thanks for help to the beginner. > Additional question (bonus? :-( ) : Waveform editor does not accept > -100 for a 8-bit signed decimal signal but displays -28 instead. When > I enter binary 10011100 which corresponds to -100 and display the > values in decimal it interestingly displays -100. Does it mean -28 > equals to -100 somehow? > > architecture Rec of Rec is > constant PN : BIT_VECTOR (14 downto 0) := "000100110101111"; > signal ACC : SIGNED (23 downto 0) := x"000000"; > signal cntr : integer range 0 to 14 := 0; > begin > process(clk) begin > if(clk'event and clk='1') then > if(cntr=0) then > Corr <= ACC; > ACC <= x"000000"; -- Problematic line is this one > end if; > if(PN(cntr)='1') then > ACC <= ACC + Sample; > else > ACC <= ACC - Sample; > end if; > if(cntr=14) then > cntr <= 0; > else > cntr <= cntr +1; > end if; > end if; > end process; > end Rec;The clearing of the ACC will most likely be cancelled by the RN(cntr) = '1' IF-block. This block should have been made dependend on the first condition: if(cntr=0) then Corr <= ACC; ACC <= x"000000"; elsif(PN(cntr)='1') then ACC <= ACC + Sample; else ACC <= ACC - Sample; end if; Regards, Alvin.
Reply by ●June 28, 20082008-06-28