Professional Documents
Culture Documents
Q 15
Q 15
return std_logic_vector is
variable j: integer;
variable total:std_logic_vector(3 downto 0);
begin
total:= "0000";
for j in 0 to 7 loop
if (inp(j) = '1') then total := total + 1;
end if;
end loop;
return total;
end f_onescount;