Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- try one of these two patterns.
init : PROCESS
BEGIN
wait for 100 ns;
key_0 <= '1';
WAIT FOR 500 ns;
key_0 <= '0';
wait for 300 ns;
key_1 <= '1';
WAIT FOR 600 ns;
key_1 <= '0';
wait for 200 ns;
key_2 <= '1';
WAIT FOR 850 ns;
key_2 <= '0';
wait for 200 ns;
key_3 <= '1';
END PROCESS init;
or
init : PROCESS(reset_n,clk)
variable shift_reg : std_logic_vector(19 downto 0);
BEGIN
if reset_n = '0' then
shift_reg := x"01000";
elsif rising_edge(clk) then
shift_reg(0) := shift_reg(19) xor shift_reg(16);
shift_reg(19 downto 1) := shift_reg(18 downto 0);
key_0 <= shift_reg(0) or shift_reg(1) or shift_reg(2);
key_1 <= shift_reg(4) or shift_reg(7) or shift_reg(9);
key_2 <= shift_reg(2) or shift_reg(10) or shift_reg(12);
key_3 <= shift_reg(13) or shift_reg(11) or shift_reg(19);
end if;
END PROCESS init;
--- Quote End --- -------------------------------------------------------------------------------------------------------------------------------- Hi Kaz, thank you once again for the code i have been able to have all the states appearing now but the problem is that it does not work effectively on the DE2-115. The LEDG and LEDR are coming on at the same time. I will like it to work as i stated in my initial help question: https://www.alteraforum.com/forum/attachment.php?attachmentid=8266