Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+2. How accurate is this existing information?

Answered: 1 week ago