Explanation of Key Sections in the Code

To ensure that the reader can understand and modify the TestBench if needed, let's go through the main parts of the code:

D_FLIP_FLOP FF1 (.D(b0), .sync_reset(Reset), .Q(Q1));

D_FLIP_FLOP FF2 (.D(Q1), .sync_reset(Reset), .Q(Q2));

D_FLIP_FLOP FF3 (.D(Q2), .sync_reset(Reset), .Q(led0));

always #5 b0 = ~b0;  // Toggle b0 every 5 time units (creates clock signal)

initial begin

  Reset = 1;

  b0 = 0;

  #10 Reset = 0; // Release reset

end


initial begin

  $dumpfile("testbench.vcd");

  $dumpvars(0, testbench);

  #1000 $finish; // Run the simulation for sufficient time

end

 


Revision #1
Created 18 February 2025 19:29:30 by Caroline
Updated 18 February 2025 19:31:50 by Caroline