Altera_Forum
Honored Contributor
17 years agoImplementing an accumulator and data recovery system
Hi,
I'm struggling to implement an accumulator or an equivalent system using VHDL. I require it as part of my receiver design at add 26 bits and tell me whether the result was positive of negative. my processes use signed 2's complement representation. here is the code that i have made thus far. ----------------------------------------------- --23/10/08 Accumulator design --this block is supposed to add all the bits coming into the input --and then send the output to the decision device --quartus does not recognise the "+" operator:confused:????? library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_signed.all; use ieee.numeric_bit.all; entity accum is port(clk : in std_logic; data_in : in std_logic_vector (25 downto 0); ready : in std_logic; trigger : out std_logic; data_out : out std_logic_vector (4 downto 0)--5 bit ouput ); end accum; architecture dt1 of accum is begin process(clk) variable temp : std_logic_vector (25 downto 0); begin if rising_edge(clk) then if ready='1' then temp:= data_in; data_out <= (temp(0) + temp(1) + temp(2) + temp(3) + temp(4) + temp(5) + temp(6) + temp(7) + temp(8) + temp(9) + temp(10) + temp(11) + temp(12) + temp(13) + temp(14) + temp(15) + temp(16) + temp(17) + temp(18) + temp(19) + temp(20) + temp(21) + temp(22) + temp(23)+ temp(24) + temp(25)); --adding all the parallel data trigger<='1'; else trigger <='0'; end if; end if; end process; end dt1; ---------------------------------------- Below is a decription of the recovery scheme i'm trying to implement ------------------------------------- data at the receiver arrives as 14 signed bits then its multiplied by 2-bit walsh code resulting in 16-bits, this result is multiplied by 10-bit wavelet, the result is then sent at a summer and decision device --received data (14-bits)--->(x)walsh code(2-bits)------>(x)wavelet(10-bits)------->Accumulator(sum of elements)------->Decision device----->recovered data(binary)