W
walala
Guest
Dear all,
The following is a fragment of my 6 bit counter, from 0 to 63 then wrap
back, going on and on, ...
if count = B"111111" then
count <= B"000000";
else
count <= count + '1';
end if;
where count is defiend as STD_LOGIC_VECTOR(5 downto 0)
Since resource is very precious, can I eliminate the "if" statement and rely
on the automatic overflow property when "count" increment from 63 to 64?
That's to say, if I just put,
count <= count + '1';
and the count will automatic overflow to 0 from 63, because it is a 6 bit
counter...
The above is done in a clocked synchronous manner, ... it seems ok with
MODELSIM simulation, but is there any hidden problem when implemented in
hardware ?
Thanks for pointing out any issue for me!
-Walala
The following is a fragment of my 6 bit counter, from 0 to 63 then wrap
back, going on and on, ...
if count = B"111111" then
count <= B"000000";
else
count <= count + '1';
end if;
where count is defiend as STD_LOGIC_VECTOR(5 downto 0)
Since resource is very precious, can I eliminate the "if" statement and rely
on the automatic overflow property when "count" increment from 63 to 64?
That's to say, if I just put,
count <= count + '1';
and the count will automatic overflow to 0 from 63, because it is a 6 bit
counter...
The above is done in a clocked synchronous manner, ... it seems ok with
MODELSIM simulation, but is there any hidden problem when implemented in
hardware ?
Thanks for pointing out any issue for me!
-Walala