Beruflich Dokumente
Kultur Dokumente
Revision: Feb.11,2013
STUDENT
I am submitting my own work, and I understand penalties will
be assessed if I submit work for credit that is not my own.
Print Name
PointScale
4:Exemplary
3:Complete
2:Incomplete
1:Minoreffort
0:Notsubmitted
9 10
ID Number
5%will be deducted from total score
Sign Name
Date
Score=Pointsawarded(Pts)xWeight(Wt)
GRADER
#
Demonstration
Wt
Testbench / Simulation-Verification
Pts
Score
Grader Signature
Date
Days
TotalInLab
Score
Late
DueDate:Monday,February18,2013
{Monday of Week 5}
Deliverables: Your must turn in (1) these specification sheets, followed by (2) a printout of your schematic, (3)
the state diagram and state table for the Moore implementation, (4) K-maps and derivations for your state and
output equations for the Moore implementation, (5) the state diagram and state table for the Mealy
implementation, (6) K-maps and derivations for your state and output equations for the Mealy implementation,
(7) printouts of the verilog files for the sequence detector module and the verilog testbench module, and (8) the
printouts of both "simulation" waveforms (i.e. the results of the verilog testbench) that show all functions work
correctly.
Revision: Feb.11,2013
DATE:
AUTHOR:
MODULE:
FILENAME:
PROJECT:
VERSION:
// Inputs
reg clk, reset, X, M;
// Outputs
wire
Z;
wire [2:0] Q;
// Local Declarations
reg [44:1] sequence_pattern;
integer
i;
// Instantiate the Unit Under Test
sequence_detector_101101 uut (
.clk(clk), .reset(reset),
.X(X),
.M(M),
.Z(Z)
.Q(Q) );
Youllhavetoeditthispart,dependingonthe
nameofyoursequencedetectormodule,and
theorderandnameofyourinputs,outputs.
// Generate 10 ps Clock
always
#5 clk = ~clk;
// Initialize Inputs
initial begin
$timeformat(-12, 1, " ps", 8);
clk = 0; reset = 0; X = 0; M = 0;
sequence_pattern = 44'b01100010101101011011111001011011011011101010;
@(negedge clk)
reset = 1;
@(negedge clk)
reset = 0;
M = 0;
// Mealy implementation (M=0); to simulate the
//
Moore implementation, set M = 1 and run the simulation again
// this loop will "feed" the sequence detector with the
// test sequence pattern from MSB to LSB
for (i=44; i > 0; i=i-1) begin
// change inputs on negative edge of clock
@(negedge clk)
X = sequence_pattern[i];
// display outputs after the positive clock
@(posedge clk)
#1 $display("Time=%t X=%b Q=%b Z=%b", $time, X, Q, Z);
end
$stop;
end
endmodule
301 Lab Assignment 2 Page 3