Chapter 4-SequentialCircuits
Chapter 4-SequentialCircuits
Sequential Circuits
M. Morris Mano, Charles R. Kime. (2015). Logic and computer design fundamentals (5th ed.). Pearson.
1
Contents
2
1. Sequential Circuit Definitions
3
1. Sequential Circuit Definitions
• Asynchronous
• Storage elements can change their
state at any instant of time as soon
as the input(s) changes. (latches)
• Synchronous
• Storage elements observe inputs
and can change state only in
relation to a timing signal (clock
pulses from a clock) (flip-flops)
6
Comparison of Sequential Circuits
• Asynchronous
• Potentially faster
• Harder to analyze
• Synchronous
• Easier to analyze
• Choose the clock so that changes are only allowed to occur before
next clock pulse
7
2. Latches
• SR Latches
8
2. Latches
• SR Latches
9
2.Latches
10
2. Latches
• D Latches
• To eliminate the
undesirable undefined
state in the SR latch is
to ensure that inputs S
and R are never equal
to 1 at the same time.
11
3. Flip-Flops
12
3. Flip-Flops
13
Edge-Triggered Flip-Flop
Q=D Q = D when
when the the positive
negative edge occurs.
edge 14
occurs.
Standard Graphics Symbols
15
Standard Graphics Symbols
16
Direct Inputs
17
4. Sequential Circuit Analysis
DA : Flip-flop input of FF A
DB: Flip-flop input of FF B
18
4. Sequential Circuit Analysis
• State Table
• The functional relationships among the inputs,
outputs, and flip-flop states of a sequential
circuit can be enumerated in a state table.
20
Equivalent State Definition
• Two states are equivalent if the output produced for each input
symbol is identical and the next states for each input symbol are
the same or equivalent.
• These equivalent states can be merged into a single state.
21
5. Sequential Circuit Design
• Design Procedure
1. Specification: Write a specification for the circuit, if not already available.
2. Formulation: Obtain either a state diagram or a state table from the statement of
the problem.
3. State Assignment: If only a state diagram is available from step 2, obtain the state
table. Assign binary codes to the states in the table.
4. Flip-Flop Input Equation Determination: Select the flip-flop type or types. Derive
the flip-flop input equations from the next-state entries in the encoded state table.
5. Output Equation Determination: Derive output equations from the output entries
in the state table.
6. Optimization: Optimize the flip-flop input equations and output equations.
7. Technology mapping: Draw a logic diagram of the circuit using flip-flops, ANDs,
ORs, and inverters. Transform the logic diagram to a new diagram using the available
flip-flop and gate technology.
8. Verification: Verify the correctness of the final design. 23
Finding State Diagrams and State Tables
• When the power in a digital system is first turned on, the state of
the flip-flops is unknown.
• The circuits must have a known initial state (reset state).
• Reset places the circuit in its initial state.
25
Finding State Diagrams and State Tables
Initial state A
States are used to “remember” the previous three inputs in the sequence.
26
Example 4.3: Finding a State Diagram for a
Sequence Recognizer (1101)
Present X Next Z
State State
0/0 1/0 A 0 A 0
1/0 1/0 A 1 B 0
A B C 0/0 D
1 11 110
B 0 A 0
B 1 C 0
0/0 1/1 C 0 D 0
0/0 C 1 C 0
D 0 A 0
D 1 B 1
27
State Assignment
• The code words are assigned in counting order. For example, for states A, B, C, and D, the
codes 00, 01, 10, and 11 are assigned to A, B, C, and D, respectively.
• An alternative that is attractive, particularly if K-maps are being used for optimization, is to
assign the codes in Gray code order, with codes 00, 01, 11, and 10 assigned to A, B, C, and D,
respectively.
• There are a number of specialized state assignment methods, some of which are based on
efficient structures for implementing at least a portion of the transitions. The most popular of
these methods is the one flip-flop per state or one-hot assignment. This assignment uses a
distinct flip-flop for each of the m states, so it generates codes that are m bits long. The
sequential circuit is in a state when the flip-flop corresponding to that state contains a 1. By
definition, all flip-flops corresponding to the other states must contain 0. Thus, each valid state
code contains m bits, with one bit equal to 1 and all other m − 1 bits equal to 0.
29
Example 4.3: Finding a State Diagram for a
Sequence Recognizer (1101)
• For the Gray-coded design, two flip-flops are needed to represent the four states.
• Flip-flop A and B
Present State X Next State Z
AB AB
00 0 00 0
00 1 01 0
01 0 00 0
01 1 11 0
11 0 10 0
11 1 11 0
10 0 00 0
10 1 01 1 32
Designing with D Flip-Flops
• For the Gray-coded design, two flip-flops are needed to represent the four states.
• Flip-flop A and B
33
Designing with D Flip-Flops
• For the Gray-coded design, two flip-flops are needed to represent the four states.
• Flip-flop A and B
34
Designing with D Flip-Flops
• For the one-hot code design, four flip-flops are needed to represent the four states.
• Flip-flop A, B, C and D
Present X Next Z
State State
1000 0 1000 0
1000 1 0100 0
0100 0 1000 0
0100 1 0010 0
0010 0 0001 0
0010 1 0010 0
0001 0 1000 0
35
0001 1 0100 1
Designing with D Flip-Flops
36