Mano CH 04 Sequential Part 1 2 3 r1 Large
Mano CH 04 Sequential Part 1 2 3 r1 Large
Sequential Circuits
Introduction
1
Introduction
◼ Block diagram
◼ Outputs are function of inputs and present
state of the storage elements
◼ Feedback system
◼ Storage elements are either latches or flip-flops
◼ Usually flip-flops
◼ Abbreviation: “FF”
2
Types of Sequential Circuits
◼ Asynchronous
◼ Behavior defined from knowledge of inputs at
any instant of time and the order in
continuous time in which inputs change
◼ Lack of clock timing allows these circuits to
change states at any time based on input
changes and current state changes
◼ If clock just regarded as another input, all
circuits are asynchronous
◼ Block diagram
Next State
Present State
3
Gate Propagation Delay
4
Circuit Delay Models
◼ Consider a 2-input multiplexer
◼ Function:
◼ Y = A for S = 1
◼ Y = B for S = 0
Glitch 10
10
5
Latches
11
11
12
12
6
NOR S-R Latch Timing
Simulation
◼ Input signal levels are changed to cover
all the possibilities
◼ Input waveform generators take the place of
manual switches
◼ Q_b is “Q bar” – often written as /Q
13
13
14
14
7
/S - /R Latch With Control Input
15
15
D-Latch
16
16
8
Flip-Flops (FFs)
17
Negative-Edge-Triggered D FF
18
18
9
Positive-Edge-Triggered D FF
19
19
20
20
10
Standard FF Graphics Symbols
21
21
22
11
Interpreting FF Graphics Symbols
23
23
Direct Inputs
24
24
12
Direct Inputs
25
25
26
26
13
Sequential Circuit Analysis
27
27
Input Equations
28
14
State Table
29
29
State Table
30
15
State Table
A(t + 1) = DA = AX + BX
B (t + 1) = DB = AX
Y = ( A + B ) X = AX + BX 31
31
State Table
32
32
16
State Table
33
State Table
DA = X Y A FF input equation
Output equation
Z=A
(no input involved) 34
34
17
State Diagram
35
35
State Diagram
◼ State diagram for first example circuit (Mealy circuit)
At present state Input/output values as X/Y during present state.
00 with input Output shown next to input since this circuit’s output
X=0, stay at state depends directly on input – a Mealy output
00 on next clock
At present state 00 with
input X=1, move to state 01
With input X=0 at
on next clock
present state 00
output is Y=0
With input X=1 at present
state 00, output is Y=0
Denoted “0/0”
Denoted “1/0”
36
36
18
State Diagram
◼ State diagram for first example circuit (Mealy circuit)
37
37
State Diagram
◼ State diagram for second example circuit (Moore circuit)
State and output value shown as “state/output” inside circle
since output depends only on present state – a Moore output
Input combinations as XY
At present state 0
with input XY=00
or XY=11, stay at
state 0 on next
clock
At present state 0 with input XY=01 or
Output is 0 while XY=10, move to state 1 on next clock
at this state
Output is 0 while at this state
Denoted “0/0”
inside circle Denoted “0/0” inside circle
38
38
19
State Diagram Recap
39
39
◼ Mealy model
◼ Output depends on inputs and present state
◼ Output values shown on state transition
arrows following a “/”
◼ Moore model
◼ Outputs depend only on that present state
◼ Output values shown in the circles for the
states following a “/”
◼ Pure Moore model will not have output value
shown on a transition arrow
40
40
20
State Diagram Recap
x=1 x=1
x=0
1/0 2/1
x=1
41
41
42
21
Sequential Circuit Simulation
43
43
44
44
22
Sequential Circuit Design
Procedure
1. Specification for circuit
2. Formulation with state table or state
diagram
3. State assignment
◼ Create a state table if only have a state
diagram
◼ Assign binary codes to states in the table
45
45
46
46
23
Sequential Circuit Design
Procedure
7. Technology mapping
◼ Start with a logic diagram for the equations
that works
◼ Modify to fit the available gates and FFs
8. Verify design
47
47
48
24
Finding State Diagrams and
Tables
◼ Look for opportunities to reduce the
number of states
◼ Establish an initial state for the system at
power on using a global reset signal
49
49
50
50
25
Ex.: Find State Diagram for
Sequence Recognizer
◼ Which model? Moore? Mealy?
◼ Output Z will go high when last correct bit arrives
at input, so output depends on states and input
◼ System needs to be reset initially
51
51
52
52
26
Ex.: Find State Diagram for
Sequence Recognizer
◼ State B: If a 1 occurs at input, it is first
“correct” sequence bit and must be
remembered so create next state B that
occurs when input is 1
◼ Output remains at 0
◼ State C: If another 1 arrives while at stat B,
then move to state C because this is the next
correct bit
◼ Output Z is still 0
53
53
54
54
27
Ex.: Find State Diagram for
Sequence Recognizer
◼ So far, only the exact correct outcome has
been handled, what if a wrong bit arrives?
Where do we go after a correct sequence?
◼ This is the tricky part as an incorrect bit in one
position of the sequence does not mean you have
to start all over again
55
55
56
56
28
Ex.: Find State Diagram for
Sequence Recognizer
◼ State C represents the first 2 bits “11” correct
◼ If a 0 comes in at C, we move to D as already
determined because we just received “110”
◼ If a 1 comes in at C, it’s 3 1’s in a row “111”, which isn’t
correct, but the last 2 are still part of a correct sequence,
◼ So remain at C if a 1 comes in
57
57
58
58
29
Ex.: Find State Table for
Sequence Recognizer
◼ The state table for the diagram is
59
59
60
60
30
State Assignment for Sequence
Recognizer
◼ Two methods
1. Use a binary “counting” sequence
◼ There are 4 states, so binary numbers 00, 01, 10, and 11
are appropriate
◼ Choosing Gray code sequence 00, 01, 11, 10 instead
makes it easier to use with K-maps
2. Have only one flip-flop output active for each
state
◼ Each state represented by a single 1
◼ This would mean 4 flip-flops needed
◼ Also known as “one-hot” code
◼ Acts like a “token passing” where the token is the 1 and
it moves from state to state
61
61
Original
Scheme
A
B
C
D
62
62
31
State Assignment for Sequence
Recognizer – One Hot
◼ State table based on one-hot using 4 FFs
Original
Scheme
A
B
C
D
63
63
64
64
32
Ex. Sequence Recognizer Gray
Code Design
◼ Revised state table showing next state as DA and DB
65
A(t + 1) = DA = m ( 3, 6, 7 )
B (t + 1) = DB = m (1,3,5, 7 )
66
33
Ex. Sequence Recognizer Gray
Code Design
◼ Reduce A(t+1) and B(t+1) equations using
K-maps X X
AB 0 1 AB 0 1
0 1 0 1
00 00 1
2 3 2 3
01 1 01 1
6 7 6 7
11 1 1 11 1
4 5 4 5
10 10 1
DA = AB + BX DB = X
67
67
68
68
34
Ex. Sequence Recognizer Gray
Code Design
◼ Map technology to NANDs and inverters
69
69
Flip-Flop Timing
◼ Setup time – ts
◼ Minimum time that S, R, or D inputs must be
fixed level before the clock transition causing
FF to change state
◼ Hold time: th
◼ Minimum time that S, R, or D inputs must
remain at fixed level after clock transition
causing FF to change state
◼ Clock pulse width: tw
70
70
35
Flip-Flop Timing
◼ Propagation delays
◼ Interval between triggering clock edge and
stabilization of output to a new value
◼ High-to-low prop delay: tPHL
◼ Low-to-high prop delay: tPLH
◼ Prop delay (general): tp−
◼ Where min or max follows the “−”
71
71
72
72
36
Sequential Circuit Timing
73
73
74
74
37
Sequential Circuit Timing
◼ Require
(
t p max t pd , FF + tCOMB + ts )
75
75
76
38
Ex.: Sequential Circuit Timing
77
77
Asynchronous Interactions
◼ Synchronous/asynchronous interaction
◼ Sequential systems often have asynchronous
inputs
78
78
39
Synchronization
79
Synchronization
80
80
40
Synchronization
Synchronizing FF
81
81
41