Chapter 5 Synchronous Sequential Circuit
Chapter 5 Synchronous Sequential Circuit
Engineering
ECE203
Digital Logic Design
Chapter 5
Synchronous Sequential Logic
Asynchronous
Inputs Outputs
Combinational
Circuit
Memory
Elements
Synchronous
Inputs Outputs
Combinational
Circuit
Flip-flops
Clock
SR Latch
S R Q0 Q Q’
0 0 0 0 1 Q = Q0
R
0 0
Q
S Q
0 1
Initial Value
SR Latch
S R Q0 Q Q’
0 0 0 0 1 Q = Q0
0 0 1 1 0 Q = Q0
R
0 1
Q
S Q
0 0
SR Latch
S R Q0 Q Q’
0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1 Q=0
R
1 0
Q
S Q
0 1
SR Latch
S R Q0 Q Q’
0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1 Q=0
R
1 1 0 1 1 0 1 Q=0
Q
S Q
0 0
SR Latch
S R Q0 Q Q’
0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R
0 0 0 1 1 0 1
Q=0
Q 1 0 0 1 0 Q=1
S Q
1 1
SR Latch
S R Q0 Q Q’
0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R
0 1 0 1 1 0 1
Q=0
Q 1 0 0 1 0 Q=1
1 0 1 1 0 Q=1
S Q
1 0
SR Latch
S R Q0 Q Q’
0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R
1 0 0 1 1 0 1
Q=0
Q 1 0 0 1 0
Q=1
1 0 1 1 0
1 1 0 0 0 Q = Q’
S Q
1 10
SR Latch
S R Q0 Q Q’
0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R
1 10 0 1 1 0 1
Q=0
Q 1 0 0 1 0
Q=1
1 0 1 1 0
1 1 0 0 0 Q = Q’
1 1 1 0 0 Q = Q’
S Q
1 0
SR Latch
S R Q
R Q Q0 No change
0 0
0 1 0 Reset
1 0 1 Set
S Q 1 1 Q=Q’=0 Invalid
S S R Q
Q Invalid
0 0 Q=Q’=1
0 1 1 Set
1 0 0 Reset
R Q
1 1 Q0 No change
ECE 203 Sequential Logic Ch5-11
Faculty of
Latches Engineering
SR Latch
S R Q
R Q Q0 No change
0 0
0 1 0 Reset
1 0 1 Set
S Q 1 1 Q=Q’=0 Invalid
S S’ R’ Q
Q Invalid
0 0 Q=Q’=1
0 1 1 Set
Q 1 0 0 Reset
R Q0 No change
1 1
ECE 203 Sequential Logic Ch5-12
Faculty of
Controlled Latches Engineering
C S R Q
0 x x Q0 No change
1 0 0 Q0 No change
1 0 1 0 Reset
1 1 0 1 Set
1 1 1 Q=Q’ Invalid
ECE 203 Sequential Logic Ch5-13
Faculty of
Controlled Latches Engineering
S
C
D
Q
C D
R Q
Q
t
C D Q
Output may
0 x Q0 No change change
1 0 0 Reset
1 1 1 Set
S
C
D
Q
C D
R Q
Q
C D Q Output may
0 x Q0 No change change
1 0 0 Reset
1 1 1 Set
Master-Slave D Flip-Flop
D D Q D Q Q
D Latch D Latch
(Master) (Slave)
C C
Master Slave
CLK
CLK
D
Looks like it is negative
edge-triggered QMaster
QSlave
ECE 203 Sequential Logic Ch5-17
Faculty of
Flip-Flops Engineering
Edge-Triggered D Flip-Flop
D Q
Q Positive Edge
CLK
Q
D Q
D Negative Edge
JK Flip-Flop
J
D Q Q
K
CLK Q Q
J Q
D = JQ’ + K’Q
K Q
ECE 203 Sequential Logic Ch5-19
Faculty of
Flip-Flops Engineering
T Flip-Flop
T J Q T D Q
Q
K Q
T Q
D = JQ’ + K’Q
D = TQ’ + T’Q = T Q Q
D Q D Q(t+1)
0 0 Reset
Q 1 1 Set
J K Q(t+1)
J Q 0 0 Q(t) No change
0 1 0 Reset
K Q 1 0 1 Set
1 1 Q’(t) Toggle
T Q T Q(t+1)
0 Q(t) No change
Q
1 Q’(t) Toggle
ECE 203 Sequential Logic Ch5-21
Faculty of
Flip-Flop Characteristic Equations Engineering
D Q D Q(t+1)
0 0 Q(t+1) = D
Q 1 1
J K Q(t+1)
J Q 0 0 Q(t)
0 1 0 Q(t+1) = JQ’ + K’Q
K Q 1 0 1
1 1 Q’(t)
T Q T Q(t+1)
0 Q(t) Q(t+1) = T Q
Q
1 Q’(t)
ECE 203 Sequential Logic Ch5-22
Faculty of
Flip-Flop Characteristic Equations Engineering
Analysis / Derivation
J K Q(t) Q(t+1)
0 0 0 0 No change
J Q 0 0 1 1
0 1 0 Reset
0 1 1
K Q
1 0 0 Set
1 0 1
1 1 0 Toggle
1 1 1
Analysis / Derivation
J K Q(t) Q(t+1)
0 0 0 0 No change
J Q 0 0 1 1
0 1 0 0 Reset
0 1 1 0
K Q
1 0 0 Set
1 0 1
1 1 0 Toggle
1 1 1
Analysis / Derivation
J K Q(t) Q(t+1)
0 0 0 0 No change
J Q 0 0 1 1
0 1 0 0 Reset
0 1 1 0
K Q
1 0 0 1 Set
1 0 1 1
1 1 0 Toggle
1 1 1
Analysis / Derivation
J K Q(t) Q(t+1)
0 0 0 0 No change
J Q 0 0 1 1
0 1 0 0 Reset
0 1 1 0
K Q
1 0 0 1 Set
1 0 1 1
1 1 0 1 Toggle
1 1 1 0
Analysis / Derivation
J K Q(t) Q(t+1)
0 0 0 0
J Q 0 0 1 1 K
0 1 0 0 0 1 0 0
0 1 1 0 J 1 1 0 1
K Q Q
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
Asynchronous Reset
D Q R’ D CLK Q(t+1)
0 x x 0
Q
R
Reset
Asynchronous Reset
D Q R’ D CLK Q(t+1)
0 x x 0
Q 1 0 ↑ 0
R 1 1 ↑ 1
Reset
Preset
Q
CLR
Reset
Preset
Preset
The State
● State = Values of all Flip-Flops
x
A
Example D Q
Q
AB=00
D Q B
CLK Q
State Equations
x
A
A(t+1) = DA D Q
=Ax+Bx
D Q B
B(t+1) = DB
CLK Q
= A’(t) x(t)
y
= A’ x
y(t) = [A(t)+ B(t)] x’(t)
= (A + B) x’
ECE 203 Sequential Logic Ch5-34
Faculty of
Analysis of Clocked Sequential Circuits Engineering
1 0 0 0 0 1
1 0 1 1 0 0
A(t+1) = A x + B x
1 1 0 0 0 1
1 1 1 1 0 0 B(t+1) = A’ x
y(t) = (A + B) x’
t t+1 t
ECE 203 Sequential Logic Ch5-35
Faculty of
Analysis of Clocked Sequential Circuits Engineering
t t+1 t A(t+1) = A x + B x
B(t+1) = A’ x
y(t) = (A + B) x’
ECE 203 Sequential Logic Ch5-36
Faculty of
Analysis of Clocked Sequential Circuits Engineering
CLK Q
01 11
y
1/0
ECE 203 Sequential Logic Ch5-37
Faculty of
Analysis of Clocked Sequential Circuits Engineering
D Flip-Flops
Example: x D Q A
Present Next
y
Input
State State CLK Q
A x y A
0 0 0 0
0 0 1 1 A(t+1) = DA = A x y
0 1 0 1
0 1 1 0
1 0 0 1 01,10
1 0 1 0
00,11 0 1 00,11
1 1 0 0
1 1 1 1 01,10
ECE 203 Sequential Logic Ch5-38
Faculty of
Analysis of Clocked Sequential Circuits Engineering
JK Flip-Flops J Q A
Example: x K Q
0 0 0 0 1 0 0 1 0 CLK
0 0 0 0 0 1
0 0 1 JA = B KA = B x’
0 1 0 1 1 1 1 1 0
JB = x’ KB = A x
0 1 1 1 0 1 0 0 1
1 0 0 1 1 0 0 1 1 A(t+1) = JA Q’A + K’A QA
1 0 1 1 0 0 0 0 0 = A’B + AB’ + Ax
1 1 0 0 0 1 1 1 1 B(t+1) = JB Q’B + K’B QB
1 1 1 1 1 1 0 0 0 = B’x’ + ABx + A’Bx’
ECE 203 Sequential Logic Ch5-39
Faculty of
Analysis of Clocked Sequential Circuits Engineering
JK Flip-Flops J Q A
x K Q
Example:
Present Next Flip-Flop J Q B
I/P
State State Inputs
A B x A B JA KA JB KB K Q
0 0 0 0 1 0 0 1 0 CLK
0 0 1 0 0 0 0 0 1 1 0 1
0 1 0 1 1 1 1 1 0 00 11
0 1 1 1 0 1 0 0 1
0
1 0 0 1 1 0 0 1 1 0 0
1 0 1 1 0 0 0 0 0
1 1 0 0 0 1 1 1 1 01 10
1 0 0 0
1
1 1 1 1 1 1
ECE 203 Sequential Logic Ch5-40
Faculty of
Analysis of Clocked Sequential Circuits Engineering
A
T Flip-Flops
x T Q y
R Q
Example:
Present Next F.F
I/P O/P
State State Inputs T Q
B
A B x A B TA TB y
R Q
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0 CLK Reset
0 1 0 0 1 0 0 0
TA = B x TB = x
0 1 1 1 0 1 1 0
y =AB
1 0 0 1 0 0 0 0
1 0 1 1 1 0 1 0
A(t+1) = TA Q’A + T’A QA
= AB’ + Ax’ + A’Bx
1 1 0 1 1 0 0 1
1 1
B(t+1) = TB Q’B + T’B QB
1 1 1 0 0 1
ECE 203
= x B Sequential Logic Ch5-41
Faculty of
Analysis of Clocked Sequential Circuits Engineering
A
T Flip-Flops
x T Q y
R Q
Example:
Present Next F.F
I/P O/P
State State Inputs T Q
B
A B x A B TA TB y
R Q
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0 CLK Reset
0 1 0 0 1 0 0 0 0/0 0/0
0 1 1 1 0 1 1 0 00 1/0 01
1 0 0 1 0 0 0 0
1 0 1 1 1 0 1 0 1/1 1/0
1 1 0 1 1 0 0 1 11 10
1 1
0/1 0/0
1 1 1 0 0 1 1/0
ECE 203 Sequential Logic Ch5-42
Faculty of
Mealy and Moore Models Engineering
Mealy Moore
Present Next Present Next
I/P O/P I/P O/P
State State State State
A B x A B y A B x A B y
0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0 1 0
0 1 0 0 0 1 0 1 0 0 1 0
0 1 1 1 1 0 0 1 1 1 0 0
1 0 0 0 0 1 1 0 0 1 0 0
1 0 1 1 0 0 1 0 1 1 1 0
1 1 0 0 0 1 1 1 0 1 1 1
1 1 1 1 0 0 1 1 1 0 0 1
State / Output
0 0
1
00/0 01/0
1 1
11/1 10/0
1
0 0
ECE 203 Sequential Logic Ch5-46
Faculty of
State Reduction and Assignment Engineering
State Reduction
Reductions on the
number of flip-flops and
the number of gates.
● A reduction in the
number of states may
result in a reduction in
the number of flip-flops.
● An example state
diagram showing in Fig.
5.25.
State: a a b c d e f f g f g a
Input: 0 1 0 1 0 1 1 0 1 0 0
Output: 0 0 0 0 0 1 1 0 1 0 0
Equivalent states
● Two states are said to be equivalent
♦ For each member of the set of inputs, they give exactly the
same output and send the circuit to the same state or to an
equivalent state.
♦ One of them can be removed.
State: a a b c d e d d e d e a
Input: 0 1 0 1 0 1 1 0 1 0 0
Output: 0 0 0 0 0 1 1 0 1 0 0
ECE 203 Sequential Logic Ch5-51
Faculty of
Engineering
(a, b) imply (c, d) and (c, d) imply (a, b). Both pairs of states are
equivalent; i.e., a and b are equivalent as well as c and d.
On the left side along the vertical are listed all the states
defined in the state table except the last, and across the bottom
horizontally are listed all the states except the last.
The states that are not equivalent are marked with a ‘x’ in the
corresponding square, whereas their equivalence is recorded
with a ‘√’.
Some of the squares have entries of implied states that must be
further investigated to determine whether they are equivalent
or not.
The step-by-step procedure of filling in the squares is as
follows:
1. Place a cross in any square corresponding to a pair of states whose
outputs are not equal for every input.
2. Enter in the remaining squares the pairs of states that are implied by
the pair of states representing the squares. We do that by starting from
the top square in the left column and going down and then proceeding
with the next column to the right.
ECE 203 Sequential Logic Ch5-56
Faculty of
Implication Table Engineering
State Assignment
To minimize the cost of the combinational circuits.
● Three possible binary state assignments. (m states need
n-bits, where 2n > m)
Example:
Detect 3 or more consecutive 1’s
0 1
S0 / 0 S1 / 0
0 State A B
S0 0 0
0 1
0 S1 0 1
S2 1 0
S3 / 1 S2 / 0 S3 1 1
1 1
Example:
Detect 3 or more consecutive 1’s
Present Next
Input Output
State State
A B x A B y 0 1
0 0 0 0 0 0 S0 / 0 S1 / 0
0 0 1 0 1 0 0
0 1 0 0 0 0
0 1 1 1 0 0 0 0 1
1 0 0 0 0 0
1 0 1 1 1 0
S3 / 1 S2 / 0
1 1 0 0 0 1
1 1
1 1 1 1 1 1
ECE 203 Sequential Logic Ch5-63
Faculty of
Design of Clocked Sequential Circuits Engineering
Example:
Detect 3 or more consecutive 1’s
Present Next
Input Output
State State
A B x A B y Synthesis using D Flip-Flops
0 0 0 0 0 0
0 0 1 0 1 0 A(t+1) = DA (A, B, x)
0 1 0 0 0 0 = ∑ (3, 5, 7)
0 1 1 1 0 0
1 0 0 0 0 0 B(t+1) = DB (A, B, x)
1 0 1 1 1 0
= ∑ (1, 5, 7)
1 1 0 0 0 1
1 1 1 1 1 1 y (A, B, x) = ∑ (6, 7)
ECE 203 Sequential Logic Ch5-64
Design of Clocked Sequential Circuits Faculty of
Engineering
with D F.F.
Example:
Detect 3 or more consecutive 1’s
=AB A 0 0 1 1
x
ECE 203 Sequential Logic Ch5-65
Design of Clocked Sequential Circuits Faculty of
Engineering
with D F.F.
Example:
Detect 3 or more consecutive 1’s
DA = A x + B x
D Q A
DB = A x + B’ x x
Q
y =AB y
D Q B
CLK Q
Q(t) Q(t+1) T
0 0 0
0 1 1
1 0 1
1 1 0
ECE 203 Sequential Logic Ch5-67
Design of Clocked Sequential Circuits Faculty of
Engineering
with JK F.F.
Example:
Detect 3 or more consecutive 1’s
K Q
CLK
ECE 203 Sequential Logic Ch5-69
Design of Clocked Sequential Circuits Faculty of
Engineering
with T F.F.
Example:
Detect 3 or more consecutive 1’s
Present Next F.F.
Input
State State Input
A B x A B TA TB Synthesis using T Flip-Flops
0 0 0 0 0 0 0
0 0 1 0 1 0 1 TA (A, B, x) = ∑ (3, 4, 6)
0 1 0 0 0 0 1 TB (A, B, x) = ∑ (1, 2, 3, 5, 6)
0 1 1 1 0 1 1
1 0 0 0 0 1 0
1 0 1 1 1 0 1
1 1 0 0 0 1 1
1 1 1 1 1 0 0
ECE 203 Sequential Logic Ch5-70
Design of Clocked Sequential Circuits Faculty of
Engineering
with T F.F.
Example:
Detect 3 or more consecutive 1’s
Q y
B B
T Q B
0 0 1 0 0 1 1 1
Q
A 1 0 0 1 A 0 1 0 1
x x
CLK