How can I sum an array of vectors in a for loop? If e.g. I would have a type
type tab is array(my_size downto 0) of STD_LOGIC_VECTOR(3 DOWNTO 0);
signal s : tab;
and I want to do a sum that would be equivalent to this:
dout <= s(0) + s(1) + s(2) + s(3) ....
but how can I do that in a for loop? Of course I could use a variable:
for N in my_size-1 downto 0 loop
temp_var := temp_var + s(N);
end loop;
but how is it possible without using a variable?
type tab is array(my_size downto 0) of STD_LOGIC_VECTOR(3 DOWNTO 0);
signal s : tab;
and I want to do a sum that would be equivalent to this:
dout <= s(0) + s(1) + s(2) + s(3) ....
but how can I do that in a for loop? Of course I could use a variable:
for N in my_size-1 downto 0 loop
temp_var := temp_var + s(N);
end loop;
but how is it possible without using a variable?