DDCO Submission
DDCO Submission
Project No : 13
1 Siddhanth D J PES1UG23CS575 J 13
2 Skanda k s PES1UG23CS580 J 13
4 Vikas k s PES1UG24CS838 J 13
I. Verilog Code (All the Verilog code with the testbench code)
------------------------------------------------------------------------------------------------
I. Verilog Code (All the Verilog code with the testbench code)
main.v
module dfr (input wire clk, reset, in, output wire out);
wire reset_, df_in;
invert invert_0 (reset, reset_);
and2 and2_0 (in, reset_, df_in);
df df_0 (clk, df_in, out);
endmodule
module dfrl (input wire clk, reset, load, in, output wire out);
wire _in;
mux2 mux2_0(out, in, load, _in);
dfr dfr_1(clk, reset, _in, out);
endmodule
module and3 (input wire i0, i1, i2, output wire o);
wire t;
and2 and2_0 (i0, i1, t);
and2 and2_1 (i2, t, o);
endmodule
#main_tb.v
`timescale 1 ns / 100 ps
module tb;
reg clk, reset;
wire [0:3]out;
integer i;
initial begin $dumpfile("main_tb.vcd"); $dumpvars(0,tb); end
initial begin reset = 1'b1; #10 reset = 1'b0; end
initial clk = 1'b0; always #5 clk =~ clk;
even_sequence_generator eqg0(clk, reset,out);
initial begin
#110 $finish;
end
endmodule
Architecture Components
State Storage
Circuit Operation
• State Transitions
• Occurs on rising edge of clock
• Reset initializes to state 0
• Cycles through states sequentially
S1 S2
S2 S3
S3 S4
S4 S0
State Encodings:
State S0 S1 S2
S0 0 0 0
S1 0 0 1
S2 0 1 0
S3 0 1 1
S4 1 0 0
State Transition Table(with Encodings):
0 0 0 0 0 1
0 0 1 0 1 0
0 1 0 0 1 1
0 1 1 1 0 0
1 0 0 0 0 0
S0’ =S0
S1S2 S1’
=S0
(S1⊕S2)S2’
= S0 S2
Circuit Diagram
State Transition Diagram :
s0 | 0
________
0000
s4 | 8 s1 | 2
________ ________
1000 0010
s3 | 6 s2 | 4
________ _________
0100
0110