LCDF3_Chap_06_P2
LCDF3_Chap_06_P2
Chapter 6 – Sequential
Circuits
Part 2 – Sequential Circuit Design
Part 2
• Sequential Circuit Design
Specification
Formulation
State Assignment
Flip-Flop Input and Output Equation Determination
Optimization
Verification
Chapter 6 - Part 2 2
The Design Procedure
Specification
Formulation - Obtain a state diagram or state table
State Assignment - Assign binary codes to the states
Flip-Flop Input Equation Determination - Select flip-flop
types and derive flip-flop equations from next state entries in the
table
Output Equation Determination - Derive output equations
from output entries in the table
Optimization - Optimize the equations
Technology Mapping - Find circuit from equations and map
to flip-flops and gate technology
Verification - Verify correctness of final design
Chapter 6 - Part 2 3
Specification
Chapter 6 - Part 2 4
Formulation: Finding a State Diagram
Chapter 6 - Part 2 5
Formulation: Finding a State Diagram
In specifying a circuit, we use states to remember
meaningful properties of past input sequences that are
essential to predicting future output values.
A sequence recognizer is a sequential circuit that
produces a distinct output value whenever a prescribed
pattern of input symbols occur in sequence, i.e,
recognizes an input sequence occurence.
We will develop a procedure specific to sequence
recognizers to convert a problem statement into a state
diagram.
Next, the state diagram, will be converted to a state
table from which the circuit will be designed.
Chapter 6 - Part 2 6
Sequence Recognizer Procedure
To develop a sequence recognizer state diagram:
• Begin in an initial state in which NONE of the initial portion of
the sequence has occurred (typically “reset” state).
• Add a state that recognizes that the first symbol has occurred.
• Add states that recognize each successive symbol occurring.
• The final state represents the input sequence (possibly less the
final input value) occurence.
• Add state transition arcs which specify what happens when a
symbol not in the proper sequence has occurred.
• Add other arcs on non-sequence inputs which transition to
states that represent the input subsequence that has occurred.
The last step is required because the circuit must recognize the
input sequence regardless of where it occurs within the overall
sequence applied since “reset.”.
Chapter 6 - Part 2 7
State Assignment
Each of the m states must be assigned a
unique code
Minimum number of bits required is n
such that
n ≥ log2 m
where x is the smallest integer ≥ x
There are useful state assignments that use
more than the minimum number of bits
There are 2n - m unused states
Chapter 6 - Part 2 8
Sequence Recognizer Example
Chapter 6 - Part 2 9
Example: Recognize 1101
Define states for the sequence to be recognized:
• assuming it starts with first symbol,
• continues through each symbol in the sequence to be recognized,
and
• uses output 1 to mean the full sequence has occurred,
• with output 0 otherwise.
Starting in the initial state (Arbitrarily named "A"):
• Add a state that recognizes
the first "1." 1/0
A B
• State "A" is the initial state, and state "B" is the state which
represents the fact that the "first" one in the input subsequence
has occurred. The output symbol "0" means that the full
recognized sequence has not yet occurred.
Chapter 6 - Part 2
Example: Recognize 1101 (continued)
After one more 1, we have:
• C is the state obtained
1/0
when the input sequence
has two "1"s. A 1/0 B C
Finally, after 110 and a 1, we have:
1/0 0/0
A 1/0 B C D
1/1
• Transition arcs are used to denote the output function (Mealy Model)
• Output 1 on the arc from D means the sequence has been recognized
• To what state should the arc from state D go? Remember: 1101101 ?
• Note that D is the last state but the output 1 occurs for the input
applied in D. This is the case when a Mealy model is assumed.
Chapter 6 - Part 2
Example: Recognize 1101 (continued)
A 1/0 B
1/0 0/0 1/1
C D
Clearly the final 1 in the recognized sequence
1101 is a sub-sequence of 1101. It follows a 0
which is not a sub-sequence of 1101. Thus it
should represent the same state reached from the
initial state after a first 1 is observed. We obtain:
1/1
Chapter 6 - Part 2
Example: Recognize 1101 (continued)
1/1
The state have the following abstract meanings:
• A: No proper sub-sequence of the sequence has
occurred.
• B: The sub-sequence 1 has occurred.
• C: The sub-sequence 11 has occurred.
• D: The sub-sequence 110 has occurred.
• The 1/1 on the arc from D to B means that the last 1
has occurred and thus, the sequence is recognized.
Chapter 6 - Part 2
Example: Recognize 1101 (continued)
Answer: 1/1
"0" arc from A
"0" arc from B
"1" arc from C
"0" arc from D.
Chapter 6 - Part 2
Example: Recognize 1101 (continued)
0/0 1/1
0/0
Note that the 1 arc from state C to state C
implies that State C means two or more 1's have
occurred.
Chapter 6 - Part 2
Formulation: Find State Table
From the State Diagram, we can fill in the State Table.
There are 4 states, one 0/0 1/0
input, and one output.
1/0 1/0 0/0
We will choose the form A B C D
with four rows, one for
each current state. 0/0 1/1
Chapter 6 - Part 2
Formulation: Find State Table
0/0 1/1
0/0
Present Next State Output
State x=0 x=1 x=0 x=1
A A B 0 0
B A C 0 0
C D C 0 0
D A B 0 1
What would the state diagram and state table
look like for the Moore model?
Chapter 6 - Part 2
Example: Moore Model for Sequence 1101
Chapter 6 - Part 2
Example: Moore Model (continued)
We mark outputs on 0 1
states for Moore model 1 1 0
A/0 B/0 C/0 D/0
Arcs now show only
state transitions 0 1
1
Add a new state E to
produce the output 1 0 E/1
Note that the new state,
0
E produces the same behavior
in the future as state B. But it gives a different output
at the present time. Thus these states do represent a
different abstraction of the input history.
Chapter 6 - Part 2
Example: Moore Model (continued)
0
Present Next State Output
State x=0 x=1 y
A A B 0
B A C 0
C D C 0
D A E 0
E A C 1
Chapter 6 - Part 2
State Assignment – Example 1
Chapter 6 - Part 2
State Assignment – Example 2
Chapter 6 - Part 2
State Assignment – Example 2 (continued)
Assignment 1: A = 0 0, B = 0 1, C = 1 0, D = 1 1
The resulting coded state table:
00 00 01 0 0
01 00 10 0 0
10 11 10 0 0
11 00 01 0 1
Chapter 6 - Part 2
State Assignment – Example 2 (continued)
Assignment 2: A = 0 0, B = 0 1, C = 1 1, D = 1 0
The resulting coded state table:
Present Next State Output
State x = 0 x = 1 x = 0 x = 1
00 00 01 0 0
01 00 11 0 0
11 10 11 0 0
10 00 01 0 1
Chapter 6 - Part 2
Find Flip-Flop Input and Output
Equations: Example 2 - Assignment 1
Assume D flip-flops
Interchange the bottom two rows of the state
table, to obtain K-maps for D1, D2, and Z:
D1 D2 Z
X X X
0 0 0 1 0 0
0 1 0 0 0 0
Y2 Y2 Y2
0 0 0 1 0 0
Y1 Y1 Y1
1 1 1 0 0 1
Chapter 6 - Part 2
Optimization: Example 2: Assignment 1
D1 D2 Z
X X X
0 0 0 1 0 0
0 1 0 1 0 0
Y2 Y2 Y2
1 1 0 1 0 0
Y1 Y1 Y1
0 0 0 1 0 1
Chapter 6 - Part 2
Optimization: Example 2: Assignment 2
• NAND gates
C
with up to 4 R
inputs and Z
inverters
Y2
X D
Clock C
R
Reset
Chapter 6 - Part 2
Mapped Circuit - Final Result
Y1
D
C
R
Y2
X D
Clock C
R
Reset
Chapter 6 - Part 2
Sequential Design: Example 3
Chapter 6 - Part 2
Example 3 (continued)
01
C/10 B/01
Chapter 6 - Part 2
Example 3 (continued)
Complete the state table
X1X0 00 01 11 10 Z1Z0
Y1Y0
Chapter 6 - Part 2
Example 3 (continued)
Find optimized flip-flop input equations for D flip-flops
D1 X1 D0 X1
X X
X X
Y0 Y0
X X X X X X X X
Y1 Y1
X X
X0 X0
D1 =
D0 =
Chapter 6 - Part 2
Circuit - Final Result with AND, OR, NOT
X1 Y1
D Z1
X0
C
R
Y0
D Z0
C
R
Reset
Clock
Chapter 6 - Part 2
Other Flip-Flop Types
J-K and T flip-flops
• Behavior
• Implementation
Basic descriptors for understanding and
using different flip-flop types
• Characteristic tables
• Characteristic equations
• Excitation tables
For actual use, see Reading Supplement - Design
and Analysis Using J-K and T Flip-Flops
Chapter 6 - Part 2
J-K Flip-flop
Behavior
• Same as S-R flip-flop with J analogous to S and K
analogous to R
• Except that J = K = 1 is allowed, and
• For J = K = 1, the flip-flop changes to the opposite
state
• As a master-slave, has same “1s catching” behavior
as S-R flip-flop
• If the master changes to the wrong state, that state
will be passed to the slave
E.g., if master falsely set by J = 1, K = 1 cannot reset it
during the current clock cycle
Chapter 6 - Part 2
J-K Flip-flop (continued)
Implementation Symbol
• To avoid 1s catching
behavior, one solution
used is to use an J
edge-triggered D as
the core of the flip-flop C
K
J D
K
C
Chapter 6 - Part 2
T Flip-flop
Behavior
• Has a single input T
For T = 0, no change to state
For T = 1, changes to opposite state
Same as a J-K flip-flop with J = K = T
As a master-slave, has same “1s catching”
behavior as J-K flip-flop
Cannot be initialized to a known state using the
T input
• Reset (asynchronous or synchronous) essential
Chapter 6 - Part 2
T Flip-flop (continued)
Implementation Symbol
• To avoid 1s catching
behavior, one solution
used is to use an T
edge-triggered D as
the core of the flip-flop
C
D
T
Chapter 6 - Part 2
Basic Flip-Flop Descriptors
Used in analysis
• Characteristic table - defines the next state of
the flip-flop in terms of flip-flop inputs and
current state
• Characteristic equation - defines the next state
of the flip-flop as a Boolean function of the
flip-flop inputs and the current state
Used in design
• Excitation table - defines the flip-flop input
variable values as function of the current state
and next state
Chapter 6 - Part 2
D Flip-Flop Descriptors
Characteristic Table
D Q(t+1) Operation
0 0 Reset
1 1 Set
Characteristic Equation
Q(t+1) = D
Excitation Table
Q(t+1) D Operation
0 0 Reset
1 1 Set
Chapter 6 - Part 2
T Flip-Flop Descriptors
Characteristic Table
T Q(t+1) Operation
0 Q(t) No change
1 Q(t) Complement
Characteristic Equation
Q(t+1) = T Q
Excitation Table
Q(t 1) T Operation
+
Q(t) 0 No change
Q(t) 1 Complement
Chapter 6 - Part 2
S-R Flip-Flop Descriptors
Characteristic Table
S R Q(t+1) Operation
0 0 Q(t) No change
0 1 0 Reset
1 0 1 Set
1 1 ? Undefined
Characteristic Equation
Q(t+1) = S + R Q, S.R = 0
Excitation Table
Q(t) Q(t+1) S R Operation
0 0 0 X No change
0 1 1 0 Set
1 0 0 1 Reset
1 1 X 0 No change
Chapter 6 - Part 2
J-K Flip-Flop Descriptors
Characteristic Table
J K Q(t+1) Operation
0 0 Q(t) No change
0 1 0 Reset
1 0 1 Set
1 1 Q(t) Complement
Characteristic Equation
Q(t+1) = J Q + K Q
Excitation Table
Q(t) Q(t+1) J K Operation
0 0 0 X No change
0 1 1 X Set
1 0 X 1 Reset
1 1 X 0 No Change
Chapter 6 - Part 2
Flip-flop Behavior Example
Use the characteristic tables to find the output waveforms
for the flip-flops shown:
Clock
D,T
D QD
C
T QT
Chapter 6 - Part 2
Flip-Flop Behavior Example
(continued)
Use the characteristic tables to find the output waveforms
for the flip-flops shown:
Clock
S,J
R,K
S QSR ?
C
R
J QJK
C
K
Chapter 6 - Part 2
Terms of Use
© 2004 by Pearson Education,Inc. All rights reserved.
The following terms of use apply in addition to the standard Pearson
Education Legal Notice.
Permission is given to incorporate these materials into classroom
presentations and handouts only to instructors adopting Logic and
Computer Design Fundamentals as the course text.
Permission is granted to the instructors adopting the book to post these
materials on a protected website or protected ftp site in original or
modified form. All other website or ftp postings, including those
offering the materials for a fee, are prohibited.
You may not remove or in any way alter this Terms of Use notice or
any trademark, copyright, or other proprietary notice, including the
copyright watermark on each slide.
Return to Title Page
Chapter 6 - Part 2