Forum Discussion
Altera_Forum
Honored Contributor
12 years agoto add up 32 bits input in an integrator that outputs 34 bits here we go:
signal sum : std_logic_vector(33 downto 0) := (others => '0');
process(reset_n,clk)
if reset_n = '0' then
sum <= (others => '0');
elsif rising_edge(clk) then
sum <= std_logic_vector(signed(sum) + resize(signed(din),34));
end if;
end process;
dout <= sum;