--- Quote Start ---
Hi, use "generic" in entity definition.
to post codes in this forum, use the [ code ] [ /code ].
entity accumulator is
generic (N : integer range 1 to 32 := 4)
port (
clk,reset, data_en : in std_logic;
data_in : in signed(N-1 downto 0);
data_out : out signed(N-1 downto 0) );
end entity accumulator;
architecture rtl of accumulator is
signal sum:signed(N-1 downto 0);
signal sum:signed(N-1 downto 0);
begin
new_sum <= sum + resize(data_in, sum'length); -- maybe do not use this statement.
-- new_sum <= resize(sum + data_in, new_sum'length);
end architecture rtl;
May it help you
--- Quote End ---
new_sum <= sum + resize(data_in, sum'length);
you said maybe do not use this statement.then,can i know what statement do i have to use to replace this one?