Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
469 B
0
Indexable
Never
module boolean_function(input wire A, input wire B, output wire Y);
  assign Y = (A & B) | (~A & ~B);
endmodule

module testbench;
  reg A, B;
  wire Y;

  boolean_function uut(.A(A), .B(B), .Y(Y));

  initial begin
    $monitor("A=%b, B=%b, Y=%b", A, B, Y);
    
    A = 0;
    B = 0;
    #10;
    
    A = 0;
    B = 1;
    #10;
    
    A = 1;
    B = 0;
    #10;
    
    A = 1;
    B = 1;
    #10;
    
    $finish;
  end
endmodule
Leave a Comment