I have a VHDL code in which i am using a std_logic_vector i.e
code:= std_logic_vector(255 downto 0);
I want to add all the bits and store into a vector of 8 downto 0.
Example:
if code = "010101......................0101", suppose we have 90 1's in code then ans should be 90 and should be stored in one more logic vector which is 8 downto 0.
I have a VHDL code in which i am using a std_logic_vector i.e
code:= std_logic_vector(255 downto 0);
I want to add all the bits and store into a vector of 8 downto 0.
Example:
if code = "010101......................0101", suppose we have 90 1's in code then ans should be 90 and should be stored in one more logic vector which is 8 downto 0.
But if you want a synthesisable design, a for loop will not work. In that case you have to do one addition per clock cycle. and you get the result after 256 clock cycles.
But if you want a synthesisable design, a for loop will not work. In that case you have to do one addition per clock cycle. and you get the result after 256 clock cycles.