nemecon

Jk

Jun 21st, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.48 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity JK is
  5. port(J,K,clk:in std_logic;
  6.         Q,Q2:buffer std_logic);
  7. end JK;
  8.  
  9. architecture JackKilby of JK is
  10. begin
  11. process(clk,J,K)
  12.         begin  
  13.             if (clk'event and clk='1') then
  14.                 if J='1' and K='0' then Q<= '1';Q2 <= '1';
  15.                 elsif K='1' and J='0' then Q<= '0';Q2 <='0';
  16.                 elsif K='1' and J='1' then Q <= not Q;Q2 <= not Q2;
  17.                 elsif K='0' and J='0' then Q <= Q; Q2<=Q2;
  18.                 end if;
  19.             end if;
  20. end process;
  21. end JackKilby;
Advertisement
Add Comment
Please, Sign In to add comment