Advertisement
STANAANDREY

ac lab4 pb1&2

Oct 18th, 2023 (edited)
1,501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module fac(input x, y, ci,
  2.            output co, z);
  3.     assign {co,z}=x+y+ci;
  4. endmodule
  5.  
  6. module fac_tb;
  7.     reg x, y, ci;
  8.     wire z, co;
  9.     fac cut(.x(x), .y(y), .ci(ci), .co(co), .z(z));
  10.     integer k;
  11.     initial begin
  12.         $display("Time\tx\ty\tci\t\tco\tz");
  13.         $monitor("%0t\t%b\t%b\t%b\t\t%b\t%b", $time, x, y, ci, co, z);
  14.         for (k = 0; k < 8; k = k + 1) begin
  15.             {x,y,ci} = k;
  16.             #10;
  17.         end
  18.     end
  19. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement