Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

module TB _ SM ( ) ; / / Testbench is given reg X , clk , rst; reg [ 1 : 0 ] Q;

module TB_SM(); // Testbench is given
reg X,clk,rst;
reg [1:0] Q;
SM UUT(X,clk,rst,Q);
always
begin
#10 clk = ~clk;
end
initial
begin
X =0;
rst =1;
clk =0;
#20
rst =0;
#20
if(Q ==0)
begin $display("test 1 passed");end
else
begin $display("test 1 failed");end
X =1;
#20
if(Q ==3)
begin $display("test 2 passed");end
else
begin $display("test 2 failed");end
X =0;
#20
if(Q ==01)
begin $display("test 3 passed");end
else
begin $display("test 3 failed");end
X =1;
#20
if(Q ==3)
begin $display("test 4 passed");end
else
begin $display("test 4 failed");end
X =1;
#20
if(Q ==3)
begin $display("test 5 passed");end
else
begin $display("test 5 failed");end
X =1;
#20
if(Q ==3)
begin $display("test 6 passed");end
else
begin $display("test 6 failed");end
X =0;
#20
if(Q ==1)
begin $display("test 7 passed");end
else
begin $display("test 7 failed");end
X =0;
#20
if(Q ==0)
begin $display("test 8 passed");end
else
begin $display("test 8 failed");end
X =0;
#20
$stop;
end
initial begin $dumpfile("dump.vcd");
$dumpvars; end
endmodule module SM(input reg X, clk, rst, output reg [1:0] Q);
reg [1:0] PS, NS;
// Implement code using the given testbench all tests should pass
endmodule
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

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Organizing Your Speech Points

Answered: 1 week ago