Forum Discussion
Altera_Forum
Honored Contributor
12 years agoLIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL; ENTITY lab4_jke IS PORT( S,R,J,K,CLK : IN STD_LOGIC; Q : OUT STD_LOGIC; NQ : OUT STD_LOGIC); END lab4_jke; ARCHITECTURE behavior OF lab4_jke IS BEGIN process(clk) begin if (CLK'EVENT AND CLK='1') then if (J='0' AND K='0') then Q <= Q; elsif (J='1' AND K='0') then Q <= '1'; elsif (J='0' AND K='1') then Q <= '0'; elsif (J='1' AND K='1') then Q <= NOT(Q); END if; END if; end process; END behavior;