2 use IEEE.std_logic_1164.all;
3 use IEEE.numeric_std.all;
6 port (vin: in STD_LOGIC_VECTOR (7 downto 0);
7 vout: out STD_LOGIC_VECTOR (3 downto 0);
11 architecture behav of forloop2 is
14 variable count: unsigned (vout'range);
18 count := (others => '0');
19 for I in vin'range loop
20 count := count + unsigned'(0 => vin (i));
22 vout <= std_logic_vector (count);