Advertisement
Guest User

Untitled

a guest
Oct 15th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. `timescale 1ns / 1ps
  2.  
  3. module full_adder_testbench();
  4.         // declare internal variables
  5.        logic x, y, z, S, C;
  6.        
  7.        // instantiate the adder module object
  8.        full_adder test(x, y, z, S, C);
  9.        
  10.        initial begin
  11.            #100; // wait      
  12.            x=0; y=0; z=0;
  13.            #100;
  14.            x=0; y=0; z=1;
  15.            #100;
  16.            x=0; y=1; z=0;
  17.            #100;
  18.            x=0; y=1; z=1;
  19.            #100;
  20.            x=1; y=0; z=0;
  21.            #100;
  22.            x=1; y=0; z=1;
  23.            #100;
  24.            x=1; y=1; z=0;
  25.            #100;
  26.            x=1; y=1; z=1;
  27.            #100;
  28.       end
  29.  
  30.       initial
  31.            $monitor($time,"x=%d, y=%d, z=%d, S=%d, C=%d", x, y, z, S, C);
  32.     endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement