Question: Write a Self - Diagnosis ( Built - in self - test ) test - bench that is able to exhaustively tests the 4 -

Write a Self-Diagnosis (Built-in self-test) test-bench that is able to exhaustively tests the 4-bit comparator. testbench.sv
1// Code your testbench here
// or browse Examples
module comp_4_str_tb();
endmodule
design.sv
// Code your SV/Verilog Design
module comp_4_str
( lt, eq, gt, A, B);
input [3:0]A,B;
output lt, gt, eq;
wire
eq0, eq1, lto, lt 1, gt0, gt1,w1,w
0 ;
9 comp_2_str
M1(1t1, gt 1, eq1, A [3:2], B [3:2]
;
10 comp_2_str
M0(1t0, gto, eq0, A [1:0], B [1:0]
;
and a1(w1, eq1, gt0);
or ol (gt,gt1,w1);
and a0(w0, eq1, lto);
or 00(1t,1t1,w0;
and ax (eq, eq1, eq0);
endmodule
module
comp_2_str(1t, gt, eq, A, B) ;
input [1:0]A,B;
output lt, gt, eq;
wire w1, w2,w3,w4, w5, w6;
not N1(w6,A[1]);
not N2(w7,A[0]);
and A1(w1, w6, B[1]);
and A2(w2,w7,w6,B[0]);
and A3(w3, w7, B[1], B[0]);
xnor x1(w4,B[1],A[1]);
xnor x2(w5,B[0],A[0]);
and A4(eq,w4,w5);
or 01(lt,w1,w2,w3);
nor N3(gt, lt, eq);
endmoduleExhaustively compares the actual output of the module with the expected output for every test case andmessages the pass and failure of any test case.
 Write a Self-Diagnosis (Built-in self-test) test-bench that is able to exhaustively

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!