title: JK Flip-flop using D Flip-flop and gate level simulation does not stop
body: <p>I'm trying to implement a JK flip-flop with a D flip-flop and a gate level, but the problem is that when I run the code, the terminal doesn't show me anything.  It's like it has always been calculating but nothing is shown.  I need to press <code>crtl + c</code> to stop the process, and this is when cmd shows something, but it is not the complete result.  I attached my code and images of the cmd.</p>
  <pre><code>module D_flip_flop (input  D,clk,Reset,enable,output reg F);
      always @(*) 
      begin
          if (Reset)
                  F&lt;='b0;
          else if (enable &amp;&amp; clk) 
              F&lt;=D;
      end 
  endmodule
  module JK_flip_flop(input J,K,clk,Reset,enable,output Q);
      wire S1,S2,S3,S4,S5;
      D_flip_flop D1(S4,clk,Reset,enable,Q);
      not N2(S5,Q);
      and A1(S1,J,S5);
      not N1(S3,K);
      and A2(S2,S3,Q);
      or O1(S4,S1,S2);
  
  endmodule
  </code></pre>
  <p>testbench:</p>
  <pre><code>module testbench();
  
  reg clk,reset,enable,J,K;
  wire Q;
  JK_flip_flop J1(J,K,clk,reset,enable,Q);
  initial begin
      $display(&quot;\n&quot;);
      $display(&quot;Flip Flop JK&quot;);
      $display(&quot;J K clk Reset Enable | Q &quot;);
      $display(&quot;----------------|---&quot;);
      $monitor(&quot;%b  %b %b %b %b | %b&quot;, J,K,clk,reset,enable,Q);
      J=0;K=0;reset=1;enable=0;clk=0;
      #1 reset=0;enable=1;
      #10 J=0;K=1;
      #10 J=1;K=0;
      #10 J=0;K=1;
      #10 J=1;K=1;
      #10 J=0;K=0;
      #50 $finish;
  end
  always
          begin
              #5 clk =~clk;
          end
      initial begin
          $dumpfile(&quot;Ej3_tb.vcd&quot;);
          $dumpvars(0, testbench);
  end
  
  endmodule
  </code></pre>
  <p>Terminal before top the process:
  <a href="https://i.stack.imgur.com/mG18s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mG18s.png" alt="enter image description here" /></a></p>
  <p>Terminal after stop Process:
  <a href="https://i.stack.imgur.com/Hda0M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hda0M.png" alt="enter image description here" /></a></p>
  <p>The JK flip-flop i'm trying to implement:</p>
  <p><a href="https://i.stack.imgur.com/6IOr5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6IOr5.jpg" alt="enter image description here" /></a></p>
  <p>I don't know why this happening.</p>