Advertisement
Guest User

Untitled

a guest
Oct 15th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. `timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // Company:
  4. // Engineer:
  5. //
  6. // Create Date: 14.10.2017 17:17:47
  7. // Design Name:
  8. // Module Name: adder_testbench
  9. // Project Name:
  10. // Target Devices:
  11. // Tool Versions:
  12. // Description:
  13. //
  14. // Dependencies:
  15. //
  16. // Revision:
  17. // Revision 0.01 - File Created
  18. // Additional Comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21.  
  22.  
  23. module full_adder_testbench();
  24.         // declare internal variables
  25.        logic x, y, z, S, C;
  26.        
  27.        // instantiate the adder module object
  28.        full_adder test(x, y, z, S, C);
  29.        
  30.        initial begin
  31.            #100; // wait
  32.            
  33.            x=0;
  34.            y=0;
  35.            z=0;
  36.            #100;
  37.            
  38.            x=0;
  39.            y=0;
  40.            z=1;
  41.            #100;
  42.            
  43.            x=0;
  44.            y=1;
  45.            z=0;
  46.            #100;
  47.            
  48.            x=0;
  49.            y=1;
  50.            z=1;
  51.            #100;
  52.            
  53.            x=1;
  54.            y=0;
  55.            z=0;
  56.            #100;
  57.            
  58.            x=1;
  59.            y=0;
  60.            z=1;
  61.            #100;
  62.            
  63.            x=1;
  64.            y=1;
  65.            z=0;
  66.            #100;
  67.            
  68.            x=1;
  69.            y=1;
  70.            z=1;
  71.            #100;
  72.  
  73.            end
  74.       initial
  75.            $monitor($time,"x=%d, y=%d, z=%d, S=%d, C=%d", x, y, z, S, C);
  76.     endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement