Forum Discussion
Altera_Forum
Honored Contributor
15 years agoDE2 push buttons question
I have a simple counter in VHDL for DE2-115 (should work with any DE2). KEY0 starts counting, KEY1 stops, KEY2 resets. The output is displayed on 7-seg LEDs HEX0 - HEX3 in hexa digits (to be simple m...
Altera_Forum
Honored Contributor
15 years agoP1: process (key(0))
begin if (rising_edge(key(0)) then run <= not run; reset <= '0'; end if; end process; P2: process (key(1)) begin if (rising_edge(key(1)) then if (run = '0') then hex6 <= hex6 - 1; else hex6 <= hex6 + 1; end if; end if; end process;