V
Vasudevan Subramaniam
Guest
hi,
here is a structural code for JKflipflop. when I simulate this it is
not running after 20 ns. and in command window I received a message
like this:
# Iteration limit reached. Possible zero delay oscillation. See the
manual.
can anyone explain me what went wrong with this?
--***************Norgate*******************
library ieee;
use ieee.std_logic_1164.all;
entity nor1 is
port(a,b:in std_logic;
cut std_logic);
end nor1;
architecture ar_nor1 of nor1 is
begin
process(a,b)
begin
c<=not(a AND b);
end process;
end;
--**************And Gate***************
library ieee;
use ieee.std_logic_1164.all;
entity and1 is
port(a,b,clk:in std_logic;
cut std_logic);
end and1;
architecture ar_and1 of and1 is
begin
process(a,b,clk)
begin
c<=a and b and clk;
end process;
end;
--***************JK FF GATE LEVEL MODEL*******************
--2 input nor & 3 input and is copied as component
library ieee;
use ieee.std_logic_1164.all;
entity jkff is
port(j,k,clk:in std_logic;
q,qaut std_logic);
end jkff;
architecture ar_jkff of jkff is
component nor1
port(a,b:in std_logic;
cut std_logic);
end component;
component and1
port(a,b,clk:in std_logic;
cut std_logic);
end component;
signal q1,qa1:std_logic;
signal t11,t12:std_logic;
begin
and11:and1 port map(K,q1,clk,t11);
and12:and1 port map(J,qa1,clk,t12);
nor11:nor1 port map(t11,qa1,q1);
nor12:nor1 port map(t12,q1,qa1);
q<=q1;
qa<=qa1;
end;
-------test bench
library ieee;
use ieee.std_logic_1164.all;
entity tb_jkff is
end tb_jkff;
architecture ar_jkff of tb_jkff is
component jkff
port(j,k,clk:in std_logic;
q,qaut std_logic);
end component;
signal j1,k1,clk1,q1,qa1:std_logic;
begin
u1:jkff port map(j1,k1,clk1,q1,qa1);
process
begin
j1<='0';wait for 50 ns;
j1<='1';wait for 60 ns;
end process;
process
begin
k1<='1';wait for 40 ns;
k1<='0';wait for 50 ns;
end process;
process
begin
clk1<='1';wait for 10 ns;
clk1<='0';wait for 10 ns;
end process;
end;
here is a structural code for JKflipflop. when I simulate this it is
not running after 20 ns. and in command window I received a message
like this:
# Iteration limit reached. Possible zero delay oscillation. See the
manual.
can anyone explain me what went wrong with this?
--***************Norgate*******************
library ieee;
use ieee.std_logic_1164.all;
entity nor1 is
port(a,b:in std_logic;
cut std_logic);
end nor1;
architecture ar_nor1 of nor1 is
begin
process(a,b)
begin
c<=not(a AND b);
end process;
end;
--**************And Gate***************
library ieee;
use ieee.std_logic_1164.all;
entity and1 is
port(a,b,clk:in std_logic;
cut std_logic);
end and1;
architecture ar_and1 of and1 is
begin
process(a,b,clk)
begin
c<=a and b and clk;
end process;
end;
--***************JK FF GATE LEVEL MODEL*******************
--2 input nor & 3 input and is copied as component
library ieee;
use ieee.std_logic_1164.all;
entity jkff is
port(j,k,clk:in std_logic;
q,qaut std_logic);
end jkff;
architecture ar_jkff of jkff is
component nor1
port(a,b:in std_logic;
cut std_logic);
end component;
component and1
port(a,b,clk:in std_logic;
cut std_logic);
end component;
signal q1,qa1:std_logic;
signal t11,t12:std_logic;
begin
and11:and1 port map(K,q1,clk,t11);
and12:and1 port map(J,qa1,clk,t12);
nor11:nor1 port map(t11,qa1,q1);
nor12:nor1 port map(t12,q1,qa1);
q<=q1;
qa<=qa1;
end;
-------test bench
library ieee;
use ieee.std_logic_1164.all;
entity tb_jkff is
end tb_jkff;
architecture ar_jkff of tb_jkff is
component jkff
port(j,k,clk:in std_logic;
q,qaut std_logic);
end component;
signal j1,k1,clk1,q1,qa1:std_logic;
begin
u1:jkff port map(j1,k1,clk1,q1,qa1);
process
begin
j1<='0';wait for 50 ns;
j1<='1';wait for 60 ns;
end process;
process
begin
k1<='1';wait for 40 ns;
k1<='0';wait for 50 ns;
end process;
process
begin
clk1<='1';wait for 10 ns;
clk1<='0';wait for 10 ns;
end process;
end;