D
David Binnie
Guest
I have no idea why this doesn't work,
The output counts up regardless of the value of datain(i),
any help out there ?
architecture algorithm of ones_counter is
signal temp: std_logic_vector (0 to 3);
begin
process(datain)
begin
temp <= "0000";
for i in 0 to (width-1) loop
if datain(i) = '1' then
temp <= temp + '1';
else null;
end if;
end loop;
end process;
count <= temp;
end algorithm;
The output counts up regardless of the value of datain(i),
any help out there ?
architecture algorithm of ones_counter is
signal temp: std_logic_vector (0 to 3);
begin
process(datain)
begin
temp <= "0000";
for i in 0 to (width-1) loop
if datain(i) = '1' then
temp <= temp + '1';
else null;
end if;
end loop;
end process;
count <= temp;
end algorithm;