Forum Discussion
Altera_Forum
Honored Contributor
14 years agoaside from resource issue, I think you need a bit more thought on the issue of counting. you need to count 0 ~7 and then freeze on zero until next switch edge.
One way is this: if switch = '1' ... count <= 1; elsif flag = '1' then count <= count + 1; end if; flag <= '1' when count > 0 else '0';