Digital Design and Computer Organization Project Final Presentation
Digital Design and Computer Organization Project Final Presentation
~Abstract
~Circuit Diagram
~Moore FSM layout
~iVerilog Code
~Gtkwave Output
PARTICIPANTS
HIMANSHU NANDA – PES2UG21CS915
KUSHAAGRA SHRIVASTAVA – PES2UG21CS917
SATYAM – PES2UG21CS485
1
Abstract
2
Moore machine: Simple Moore machines have one input and one output.
Output depends only upon the present state. Generally, it has more states
than Mealy Machine. Input change can cause change in output change as
soon as logic is done. In Moore machines, more logic is needed to decode
the outputs since it has more circuit delays.
3
Circuit Diagram
If the output depicted in the figure is 1 then the machine is in its final
state.
4
iVerilog Code
module seq_detector(
input x,clk,reset,
output reg z
);
parameter S0 = 0 , S1 = 1 , S2 = 2 , S3 = 3 , S4 = 4;
reg [2:0] PS,NS ;
5
case(PS)
S4: z = 1;
default: z = 0;
endcase
end
endmodule
Testbench
`timescale 1ns / 1ps
module testbench;
// Inputs
reg x;
reg clk;
reg reset;
// Outputs
wire z;
// Instantiate the Unit Under Test (UUT)
seq_detector uut (
.x(x),
.clk(clk),
.reset(reset),
.z(z)
);
initial begin
$dumpfile("dump.vcd");
$dumpvars(1, testbench);
fork
clk = 1'b0;
reset = 1'b1;
#15 reset = 1'b0;
begin
#12 x = 0;#10 x = 0 ; #10 x = 1 ; #10 x = 0 ;
#12 x = 1;#10 x = 1 ; #10 x = 0 ; #10 x = 1 ;
#12 x = 1;#10 x = 0 ; #10 x = 0 ; #10 x = 1 ;
#12 x = 0;#10 x = 1 ; #10 x = 1 ; #10 x = 0 ;
#10 $finish;
end
join
end
endmodule
6
Gtkwave~ Outputs