Forum Discussion
Altera_Forum
Honored Contributor
16 years agoVHDL Counter
I am new to VHDL, and I am trying to create a counter that will count up from 0 to X when a signal called enable will be true. I get errors like Latches are generated for incomplete case or if ...
Altera_Forum
Honored Contributor
16 years agoalso - if you want the counter to reset after an enable burst:
if enable = '1' then
r_reg <= r_reg + 1; --Increment - this rolls over back to 0
else
r_reg <= to_unsigned(0, N); --reset when enable is low
end if;