Forum Discussion
Altera_Forum
Honored Contributor
10 years agoyou are missing "flag" from the first code sensitivity list. This mean's you'll have a missmatch between the simulation and the actual code on hardware.
What you need to do is build an edge detector - simply register signal and compare it to the incoming value:
signal sig_r : std_logic;
process(clk)
begin
if rising_edge(clk) then
sig_r <= sig;
if sig_r = '0' and sig = '1' then --check for rising edge of SIGNAL
flag <= '1';
else
--etc
end if;
end if;
end process;