1 Answers
//HA STRUCT MODELLING
module HA(S,C,a,b);
input a,b;
output S,C;
xor (S,a,b);
and (C,a,b);
endmodule
//TB
module ha_tf;
// Inputs
reg a;
reg b;
// Outputs
wire S;
wire C;
// Instantiate the Unit Under Test (UUT)
HA uut (
.S(S),
.C(C),
.a(a),
.b(b)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
a=0;
b=1;
#100;
a=1;
b=0;
#100;
a=1;
b=1;
#100;
end
endmodule