Answered step by step
Verified Expert Solution
Question
1 Approved Answer
module TB _ SM ( ) ; / / Testbench is given reg X , clk , rst; reg [ 1 : 0 ] Q;
module TBSM; Testbench is given
reg Xclkrst;
reg : Q;
SM UUTXclkrstQ;
always
begin
# clk ~clk;
end
initial
begin
X ;
rst ;
clk ;
#
rst ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
ifQ
begin $displaytest passed";end
else
begin $displaytest failed";end
X ;
#
$stop;
end
initial begin $dumpfiledumpvcd;
$dumpvars; end
endmodule module SMinput reg X clk rst output reg : Q;
reg : PS NS;
Implement code using the given testbench all tests should pass
endmodule
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started