Textbook: Digital Design, 6 - Edition: M. Morris Mano and Michael D. Ciletti
Textbook: Digital Design, 6 - Edition: M. Morris Mano and Michael D. Ciletti
P-1/79 2019/5/9
教 師 : 蘇 慶 龍
Instructor : Ching-Lung Su
E-mail: [email protected]
Chapter 5
P-2/79 2019/5/9
Chapter 5
Synchronous Sequential Logic
Outline of Chapter 5
P-3/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.1 Introduction
P-4/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.1 Introduction to Sequential Circuits
P-5/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.2 Sequential Circuits
P-7/79 2019/5/9
Inputs Outputs
Combinational
Circuits Next Memory
State Elements
Present
State
Feedback Path
5.2 Sequential Circuits
P-8/79 2019/5/9
Inputs Outputs
Combinational
Circuits
Flip-Flops
Periodic
Clock Pulse
Clock Storing 1 bit information
Generator
5.3 Storage Elements: Latches
P-10/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.3 Storage Elements: Latches
P-11/79 2019/5/9
◼ Flip-Flop
A Flip-flop circuit can maintain a binary state
indefinitely until directed by an input signal to
switch states.
5.3 Storage Elements: Latches
P-12/79 2019/5/9
R 0 1 R 0 1
(reset) Q (reset) Q
S 1 Q S 0 Q
(set) 0 (set) 0
R 1 0 R 0 0
(reset) Q (reset) Q
S 0 Q S 0 Q
(set) 1 (set) 1
5.3 Storage Elements: Latches
P-13/79 2019/5/9
S 1 0 S 1 0
(set) Q (set) Q
R 0 Q R 1 Q
(reset) 1 (reset) 1
S 0 1 S 1 1
(set) Q (set) Q
R 1 Q R 1 Q
(reset) 0 (reset) 0
5.3 Storage Elements: Latches
P-14/79 2019/5/9
No Change No Change
S 1 S 0 1
Q Q
C 0 C 1
Q Q
R 1 R 1
0
Set Reset
S 1 0 1 Q S 0 1
0 Q
C 1 C 1
Q Q
R 1 0 R 0 1
0 1
5.3 Storage Elements: Latches
P-15/79 2019/5/9
No Change Set
D 1 D 1 0 1 Q
Q
C 0 C 1
1 Q 0 Q
0 1
5.3 Storage Elements: Latches
P-16/79 2019/5/9
S S
R R
D Latch
C
5.4 Storage Elements: Flip-Flops
P-17/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.4 Storage Elements: Flip-Flops
P-18/79 2019/5/9
Inputs Outputs
Combinational Unpredictable Results
Circuits
Flip-Flops
Loops
Clock
Generator
5.4 Storage Elements: Flip-Flops
P-20/79 2019/5/9
◼ Edge-Triggered D Flip-Flop
D X D X D Q
D Latch D Latch
(Master) (Slave)
C C
Clock
◼ Positive-Edge-Triggered D Flip-Flop
Keeping Data
1 S
Positive Edge Q
0
Trigger Clock 0
0 R Q
1
D
Clock = 0 Clock = 0
1 0
Clock = 1 Clock = 1 1
Set Reset
1 S 0 S
0 Q 1 Q
1 1
Clock 1 Clock 1
1 0 R 1 Q 1 R 0 Q
1 1
1
D 0 1 D 1 0
5.4 Storage Elements: Flip-Flops
P-22/79 2019/5/9
Clock
Input data D
Setup Time
Hold Time
5.4 Storage Elements: Flip-Flops
P-23/79 2019/5/9
D D
C C
Positive-Edge Negative-Edge
Triggered D FF Triggered D FF
5.4 Storage Elements: Flip-Flops
P-24/79 2019/5/9
D Q(t+1)
0 0 Reset
1 1 Set
Characteristic Table
5.4 Storage Elements: Flip-Flops
P-25/79 2019/5/9
◼ JK Flip-Flop
J
D Q J
K
C
Clock C Q K
J K D(t+1)
0 0 Q(t) No change
D = JQ + K Q 0 1 0 Reset
1 0 1 Set
1 1 Q (t) Complement
Characteristic Table
5.4 Storage Elements: Flip-Flops
P-26/79 2019/5/9
◼ T (toggle) Flip-Flop
T D T J
C K
T FF from D FF T FF from JK FF
T Q(t+1)
D = T + Q = TQ + T Q 0 Q(t) No Change
1 Q (t) Complement
Characteristic Table
Graphic Symbol
5.4 Storage Elements: Flip-Flops
P-27/79 2019/5/9
◼ Characteristic Equations:
The logical properties of a flip-flop as described
in the characteristic table can be expressed also
algebraically with a characteristic equation.
D FF: Q(t+1) = D
JK FF: Q(t+1) = JQ + K Q
T FF: Q(t+1) = T + Q = TQ + T Q
5.4 Storage Elements: Flip-Flops
P-28/79 2019/5/9
S Q 1 S 1 0 Q
0
Clock Clock
R Q R 1 Q
0
D D 1
0
Direct Reset
Reset (Clear) 0
Graphic Symbol
Function Table
Data D Q
R C D Q Q
0 X X 0 1
Clock C Q 1 0 0 1
R 1 1 1 0
Reset
5.5 Analysis of Clocked Sequential Circuits
P-29/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.5 Analysis of Clocked Sequential Circuits
P-30/79 2019/5/9
x
D A A(t+1) = A(t)x(t) + B(t)x(t)
B(t+1) = A (t)x(t)
C A
A(t+1) = Ax + Bx
B(t+1) = A x
D B
y(t) = [A(t)+B(t)]x (t)
Clock C B
y = (A+B)x
y
5.5 Analysis of Clocked Sequential Circuits
P-32/79 2019/5/9
x
D A Present Next
State Input State Output
A B x A B y
C A
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 0 1
23 Items 0 1 1 1 1 0
D B
1 0 0 0 0 1
1 0 1 1 0 0
Clock C B 1 1 0 0 0 1
1 1 1 1 0 0
y
5.5 Analysis of Clocked Sequential Circuits
P-34/79 2019/5/9
00 00 01 0 0
01 00 11 1 0
D B 10 00 10 1 0
11 00 10 1 0
Clock C B
y
5.5 Analysis of Clocked Sequential Circuits
P-35/79 2019/5/9
0/0 1/0
00 0/1 10
Input/Output
0/1
1/0 0/1 1/0
State
01 11
1/0
◼ State Diagram
Present State Next State Output
x=0 x=1 x=0 x=1
AB AB AB y y
00 00 01 0 0
01 00 11 1 0
10 00 10 1 0
11 00 10 1 0
5.5 Analysis of Clocked Sequential Circuits
P-36/79 2019/5/9
x
D A
C A
DA = Ax + Bx
DB = A x
D B y = (A+B)x
Clock C B
y
5.5 Analysis of Clocked Sequential Circuits
P-38/79 2019/5/9
0 00 0
A(t+1) = A + x + y 0 01 1
0 10 1
State Diagram 0 11 0
01,10 1 00 1
1 01 0
1 10 0
00,11 0 1 00,11 1 11 1
01,10
5.5 Analysis of Clocked Sequential Circuits
P-39/79 2019/5/9
J A JA = B
C KA = Bx
x
K JB = x
KB = A x + Ax = A + x
J B
C
K
Clock
5.5 Analysis of Clocked Sequential Circuits
P-41/79 2019/5/9
0 0 0 0 1 0 0 1 0
0 0 1 0 0 0 0 0 1
0 1 0 1 1 1 1 1 0
0 1 1 1 0 1 0 0 1
1 0 0 1 1 2 0 0 1 1
1 0 1 1 0 0 0 0 0
1 1 0 0 0 1 1 1 1
1 1 1 1 1 1 0 0 0
1
5.5 Analysis of Clocked Sequential Circuits
P-42/79 2019/5/9
A(t+1) = BA + (Bx) A = A B + AB + Ax JB = x
B(t+1) = x B + (A + x ) B = B x + ABx + A Bx KB = A x + Ax = A + x
1 1
00 0 11
Sequential Circuit with JK Flip-Flop
J A State Diagram 0 0 0
C
x
K
J B 01 10
C 1
K
Clock
1
5.5 Analysis of Clocked Sequential Circuits
P-44/79 2019/5/9
C R
TA = Bx
TB = x
B y = AB
T
Clock Reset
5.5 Analysis of Clocked Sequential Circuits
P-45/79 2019/5/9
0 0
5.5 Analysis of Clocked Sequential Circuits
P-46/79 2019/5/9
Mealy Machine
Clock
Moore Machine
Inputs Next State Output Outputs
Combinational Logic State Register Combinational Logic (Mealy-type)
Clock
5.5 Analysis of Clocked Sequential Circuits
P-48/79 2019/5/9
x
D A
C A
D B
Clock C B
y
5.5 Analysis of Clocked Sequential Circuits
P-49/79 2019/5/9
J A
C
x
K
J B
C
K
◼ Example of Clock
C R
TA = Bx
TB = x
B y = AB
T
Clock Reset
5.6 HDL for Sequential Circuits
P-50/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.6 HDL for Sequential Circuits
P-51/79 2019/5/9
◼ Referred to TA
5.7 State Reduction and Assignment
P-52/79 2019/5/9
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.7 State Reduction and Assignment
P-53/79 2019/5/9
0/0 0/0
b c
1/0 1/0
g d 0/0 e
1/1
1/1
1/1
0/0 f
1/1
5.7 State Reduction and Assignment
P-55/79 2019/5/9
a a b 0 0
b c d 0 0
c a d 0 0
d e f 0 1
e a f 0 1 Equivalent State
f g f 0 1
g a f 0 1 Removed State
5.7 State Reduction and Assignment
P-56/79 2019/5/9
a a b 0 0
b c d 0 0 g replaced by e
c a d 0 0
d e f 0 1
e a f 0 1
f g f 0 1
5.7 State Reduction and Assignment
P-57/79 2019/5/9
a a b 0 0
b c d 0 0
c a d 0 0
d e f 0 1 Equivalent State
e a f 0 1
f e f 0 1 Removed State
5.7 State Reduction and Assignment
P-58/79 2019/5/9
a a b 0 0
b c d 0 0
c a d 0 0
d e f 0 1 f replaced by d
e a f 0 1
5.7 State Reduction and Assignment
P-59/79 2019/5/9
a a b 0 0
b c d 0 0
c a d 0 0
d e d 0 1
e a d 0 1
5.7 State Reduction and Assignment
P-60/79 2019/5/9
a
0/0 1/0 0/0
0/0
e b c
1/1
5.7 State Reduction and Assignment
P-61/79 2019/5/9
◼ State Assignment
State Assignment 1 Assignment 2 Assignment 3
Binary Gray Code One-hot
5.1 Introduction
5.2 Sequential Circuits
5.3 Storage Elements: Latches
5.4 Storage Elements: Flip-Flops
5.5 Analysis of Clocked Sequential Circuits
5.6 HDL for Sequential Circuits
5.7 State Reduction and Assignment
5.8 Design Procedure
5.8 Design Procedure
P-63/79 2019/5/9
1
S0/0 S1/0
0 0 1
S3/1 S2/0
1
1
5.8 Design Procedure
P-65/79 2019/5/9
S0 00 (AB)
S1 01 (AB)
S2 10 (AB)
S3 11 (AB)
5.8 Design Procedure
P-67/79 2019/5/9
m0 00 0 00 0
m1 00 1 01 0
m2 01 0 00 0
m3 01 1 10 0
m4 10 0 00 0
m5 10 1 11 0
m6 11 0 00 1
m7 11 1 11 1
5.8 Design Procedure
P-68/79 2019/5/9
DA = Ax + Bx
DB = Ax + B x
y = AB
5.8 Design Procedure
P-69/79 2019/5/9
◼ Logic Simplification
DA DB
Bx B=1 Bx B=1
A 00 01 11 10 A 00 01 11 10
0 1 0 1
A=1 1 1 1 A=1 1 1 1
x=1 x=1
DA = Ax + Bx DB = Ax + B x
y
Bx B=1
A 00 01 11 10
0
A=1 1 1 1
x=1
y = AB
5.8 Design Procedure
P-70/79 2019/5/9
Ax
D A
Bx
x
C
D B
Bx
Clock C B
y
5.8 Design Procedure
P-71/79 2019/5/9
◼ Excitation Tables
A table lists the required inputs for a given change of
state. Q(t) Q(t+1)
JK Flip-Flop
J K Q(t+1) Q(t) Q(t+1) J K
0 0 Q(t) No change 0 0 0 x
0 x
0 1 0 Reset 0 1 1 x
1 0 1 Set 1 0 x 1
1 1 Q (t) Complement 1 1 x 0
T Flip-Flop
Characteristic Table Excitation Table
T Q(t+1) Q(t) Q(t+1) T
0 Q(t) No Change 0 0 0
1 Q (t) Complement 0 1 1
1 0 1
1 1 0
5.8 Design Procedure
P-73/79 2019/5/9
00 0 00 0 x 0 x
00 1 01 0 x 1 x
01 0 10 1 x x 1
01 1 01 0 x x 0
10 0 10 x 0 0 x
10 1 11 x 0 1 x
11 0 11 x 0 x 0
11 1 00 x 1 x 1
5.8 Design Procedure
P-74/79 2019/5/9
A=1 1 x x x x A=1 1 1
x=1 x=1
JB = x KB = (A + x)
Bx B=1 Bx B=1
A 00 01 11 10 A 00 01 11 10
0 1 x x 0 x x 1
A=1 1 1 x x A=1 1 x x 1
x=1 x=1
5.8 Design Procedure
P-75/79 2019/5/9
C
Bx K A
x J B
K B
(A + x)
Clock
5.8 Design Procedure
P-76/79 2019/5/9
A2=1 1 1 A2=1 1 1 1
A0 A0
TA0 = 1
A0A1 A1
A2 00 01 11 10
0 1 1 1 1
A2=1 1 1 1 1 1
A0
5.8 Design Procedure
P-79/79 2019/5/9
C T C T C T
Clock