Forum Discussion
Altera_Forum
Honored Contributor
15 years agofirst, remember the counter use is not going to solve your issue much since the associated logic is huge.
However, in your case do this:
--pseudocode
-- divide clk process
process
begin
wait until clk = '1';
divideclk <= not divide clk;
end process;
then use that divideclk as enable:
process
...clk edge ...etc
if divideclk = '1' then
fail_edge <= '0'; --default
case count is
when 0 =>
if stream = "00101110" then
count <= 21;
end if;
when 1 =>
if stream = ....
count <= 102;
fail-edge <= '1'; --non default
end if;
...etc