library IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
entity jkff is
port(j:in STD_LOGIC;
k:in STD_LOGIC;
clk:in STD_LOGIC;
q:inout STD_LOGIC
);
end jkff;
architecture jkff_arch of jkff is
begin
process (clk,j,k)
begin
if(clk='1' and clk'event)then
if(j='0' and k='0')
then q<=q;
elsif(j='0' and k='1')then
q<='0';
elsif(j='1' and k='0')then
q<='1';
elsif(j='1' and k='1')then
q<=not q;
end if;
end if;
end process;
end jkff_arch;
USE IEEE.STD_LOGIC_1164.ALL;
entity jkff is
port(j:in STD_LOGIC;
k:in STD_LOGIC;
clk:in STD_LOGIC;
q:inout STD_LOGIC
);
end jkff;
architecture jkff_arch of jkff is
begin
process (clk,j,k)
begin
if(clk='1' and clk'event)then
if(j='0' and k='0')
then q<=q;
elsif(j='0' and k='1')then
q<='0';
elsif(j='1' and k='0')then
q<='1';
elsif(j='1' and k='1')then
q<=not q;
end if;
end if;
end process;
end jkff_arch;
No comments:
Post a Comment