Lecture 9_Synchronous Sequential Circuits_Part2
Lecture 9_Synchronous Sequential Circuits_Part2
Prabha Sundaravadivel
Assistant Professor
Department of Electrical Engineering
The University of Texas at Tyler
3900 University Blvd. RBN 1008,
Tyler, TX. 75799
Email: [email protected]
Module 9
EENG VLSI 4332, 5335
Week 13
w = 0 z = 0 A B w = 1 z = 1
w = 0 z = 0
w D Q
y
Clock Q
Resetn
(a) Circuit
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t 10
1
Clock
0
1
w
0
1
y
0
1
z
0
A Reset
w = 1 R 2out = 1, R 3in = 1
w = 0 R 1out = 1, R 2in = 1
w = 1
w = 0 R3 = 1, R1 = 1, Done = 1
w = 1 out in
// Define output
assign z = (y = = C);
endmodule Figure 6.29. Verilog code for the FSM in Figure 6.3.
Figure 6.36. Verilog code for the Mealy machine of Figure 6.23.
a
Shift register
s
Adder
FSM Shift register
Shift register
b
Sum = A + B
B
Clock
00 0 01 0
01 1 G H 10 0
10 1 11 1
00 1
G: carry-in = 0
H: carry-in = 1
Clock Q
Reset
11 01
00 G 0 s = 0 H0 s = 0
10
00
01 00 11 01
10 11 10
01 G 1 s = 1 H1 s = 1 11
10 00
Figure 6.44. State diagram for the Moore-type serial adder FSM.
Week 13 Synchronous Sequential Circuits II Slide19
Present Nextstate Output
state ab =00 01 10 11 s
G0 G0 G1 G1 H0 0
G1 G0 G1 G1 H0 1
H0 G1 H0 H0 H1 0
H1 G1 H0 H0 H1 1
Figure 6.45. State table for the Moore-type serial adder FSM.
Y2 y2
D Q
Clock Q
Reset
endmodule
Figure 6.48. Code for a left-to-right shift register with an enable input.
// Adder FSM
// Output and next state combinational circuit
always @(QA, QB, y)
case (y)
G: begin
s = QA[0] ^ QB[0];
if (QA[0] & QB[0]) Y = H;
else Y = G;
end
H: begin
s = QA[0] ~^ QB[0];
if (~QA[0] &
~QB[0]) Y = G;
else Y = H;
end
default: Y = G;
endcase
// Sequential block
always @(posedge Clock)
if (Reset) y <= G;
else y <= Y;
endmodule
Week 13 Synchronous Sequential Circuits II Slide24
1 0 0 0
a7 a0 D3 D2 D1 D0
L
E Counter
L
0 w Q3 Q2 Q1 Q0
1 E
Adder
b7 b0 FSM
Run
L 0 0
0 w
1 E
L
w
E
Clock
Reset
Sum 7 Sum 0
A B C 1
B D F 1
C F E 0
D B G 1
E F C 0
F E D 0
G F G 0
A B C 1
B A F 1
C F C 0
F C A 0
sense N
sense D
N
sense N D Q D Q
Clock Q Q
Reset
DN
DN S1 0 DN
DN DN
D N
D
S4 1 S2 0 S3 0 S7 1
N
D N
DN
S5 1 S6 0 DN DN
N D
S8 1 S9 1
S1 S1 S3 S2 – 0
S2 S2 S4 S5 – 0
S3 S3 S6 S7 – 0
S4 S1 – – – 1
S5 S3 – – – 1
S6 S6 S8 S9 – 0
S7 S1 – – – 1
S8 S1 – – – 1
S9 S3 – – – 1
S1 S1 S3 S2 – 0
S2 S2 S4 S5 – 0
S3 S3 S2 S4 – 0
S4 S1 – – – 1
S5 S3 – – – 1
S1 0
N
DN
S3 0
D
DN N DN
D
DN S2 0 S5 1
N
D
S4 1
S1
N 0 D 1
DN 0
N 1 S3 D 0
N 0 D 1
S2
DN 0
Figure 6.58. Mealy-type FSM for Example 6.7.
Week 13 Synchronous Sequential Circuits II Slide34
Present Next state Output z
state w= 0 w= 1 w= 0 w= 1
A B C 0 0
B D – 0 –
C F E 0 1
D B G 0 0
E F C 0 1
F E D 0 1
G F – 0 –
Happy Learning!