JK-Flipflop

JK-Flipflop

JK-Flipflop(Behavioural Model)

library ieee;
use ieee. std_logic_1164.all;
use ieee. std_logic_arith.all;
 entity JK_FlipFlop is
  port( J : in std_logic;
        K : in std_logic;
        CLK : in std_logic;
        Q : out std_logic;
        Q1 : out std_logic);
 end JK_FlipFlop;
architecture JK_FF of JK_FlipFlop is
 begin
  process(CLK)
   variable tmp: std_logic;
    begin
     if(CLK='1') then
     if(J='0' and K='0')then
     tmp:=tmp;
     elsif(J='1' and K='1')then
     tmp:= NOT tmp;
     elsif(J='0' and K='1')then
     tmp:='0';
     else
     tmp:='1';
     end if;
     end if;
     Q<= tmp;
     Q1<= NOT tmp;
  end process;
end architecture JK_FF;