I know the part 1 and part 2 answer are module Q2 ABCDF inpu


I know the part 1 and part 2 answer are
module Q2 (A,B,C,D,F);
input A,B,C,D;
output F,
wire w1, w2, w3, w4, w5;
and(F,w3,w5);
nor (w3,w1,w2);
not (w1,A);
and (w5,B,C,w4);
not (w4, D);
endmodule

module continuous (A,B,C,D,F);
input A,B,C,D;
output F;
assign F=(~A~|D)&(~D&B&C);
endmodule

But i do not have any idea for testbench, could someone help me and explain it? thanks

Given the following circuit: (1) Using Verilog gate-level primitives, develop a structural model; (2) Using continuous assignments, develop a behavioral model; (3) Write a test bench for either model. 2.

Solution

ANSWER:

//Design instantiation:

module testbench;

wire A,B,C,D,F;

continuous DESIGN ( .A(A), .B(B), .C(C), .D(D), .F(F));

bit [3:0] i;

initial begin

for (i=0; i<16;i++) begin

{A,B,C,D} = i;

#1;

$display (\"Inputs are : A-%b, B-b, C-%b, D-b. Output F is %b\", A,B,C,D,F);

end

end

endmodule

//Here we have 4 inputs and since we can have 16 possible combinations of inputs, I have taken a 4 bit counter and looped it from 0 through 15 so that all the possibilities of inputs get covered. I have then printed the outputs and the corresponding set of inputs

PS: If you have any other questions, please let me know so that I canclarify your doubts.

 I know the part 1 and part 2 answer are module Q2 (A,B,C,D,F); input A,B,C,D; output F, wire w1, w2, w3, w4, w5; and(F,w3,w5); nor (w3,w1,w2); not (w1,A); and

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site