daily pastebin goal
81%
SHARE
TWEET

Untitled

a guest Nov 24th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module adder_tb;
  2.  
  3. reg x,y,c_in;
  4. wire s,c_out;
  5.  
  6. full_adder uut(x,y,c_in,s,c_out);
  7.  
  8. initial begin
  9.     // $dumpvars;
  10.  
  11.     x=0; y=0; c_in=0;
  12.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  13.  
  14.     x=0; y=0; c_in=1;
  15.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  16.  
  17.     x=0; y=1; c_in=0;
  18.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  19.  
  20.     x=0; y=1; c_in=1;
  21.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  22.  
  23.     x=1; y=0; c_in=0;
  24.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  25.  
  26.     x=1; y=0; c_in=1;
  27.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  28.  
  29.     x=1; y=1; c_in=0;
  30.     #1 // $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  31.  
  32.     x=1; y=1; c_in=1;
  33.     // #1 $display("x=%b, y=%b, c_in=%b, s=%b, c_out=%b",x,y,c_in,s,c_out);
  34.    
  35.  
  36. end
  37. endmodule
RAW Paste Data
Top