Beruflich Dokumente
Kultur Dokumente
Chapter 5 Sequential
Circuits
Part 3 State Machine Design
Charles Kime
2008 Pearson Education, Inc.
(Hyperlinks are active in View Show mode)
Overview
Part 1 - Storage Elements and Analysis
Part 2 - Sequential Circuit Design
Part 3 State Machine Design
Issues with traditional state diagrams and table
representations
The state machine diagram model
Constraint checking
State machine diagram application and design
Chapter 5 - Part 3
Chapter 5 - Part 3
Chapter 5 - Part 3
Chapter 5 - Part 3
Chapter 5 - Part 3
Reset
10/0 , 11/0
01/1 , 11/0
00/1 , 10/0
00/0 , 01/0
00/0 , 01/1
00/1 , 11/1
01/1 , 10/1
10/0 , 11/1
X / Z
Reset
X
Y / Z
XY +XY
Y
X
CEN214 Mohammed Arafah
XY +XY
Chapter 5 - Part 3
Chapter 5 - Part 3
Inputs: X, Y
Output: Z
Default: Z=0
X / Z
Reset
X
Y / Z
Y
XY +XY
XY +XY
X
Transition Condition
Output Condition .
Output Action
Chapter 5 - Part 3
Chapter 5 - Part 3
10
Chapter 5 - Part 3
11
Chapter 5 - Part 3
12
Chapter 5 - Part 3
13
Chapter 5 - Part 3
14
So
TC
S1
Chapter 5 - Part 3
15
START + STOP
TCI .
Reset
Init
TCD ...
TOCD .
START . STOP
L1. STOP
Fill_1
V1
PST
STOP
L1. STOP
L2.NI.STOP
L2. STOP
Fill_2
STOP
V2
L2.NI.STOP
L3. STOP
Fill_3
STOP
PST
L3.STOP
TM
TZ. STOP
V3
Mix
MX
TZ. STOP
L0 + STOP
Empty
VE
L0. STOP
Chapter 5 - Part 3
16
LK . CL / CD
PA . PP . MO
TCD ...
TOCD .
Closed
Reset
LK . (PA + PP + MO)
OL
Open
OD
OL
OL / OD
Opened
PA + PP +MO
PA.PP.MO
CL.PA.PP.MO.DR
PA+PP+MO+DR
Close
CD
CL.PA.PP.MO.DR
CEN214 Mohammed Arafah
Chapter 5 - Part 3
17
S1/SD
TOCD .
F1
Dn
TCD ...
Down
F1
DCF2
TO
Hd_A
Hd_B
TO
Hd_C
DO/OD
DC(F1 + F2)/CD
DCF1
F2
Up
U
F2
S2/SD
Chapter 5 - Part 3
18
Chapter 5 - Part 3
19
S0
AB
S1
AB
S0
A+B
A+B
Y, Z
A/Y, B/Z
S2
Moore Output Actions
TCD ...
TOCD .
S2
TCI .
S0
S1
AB
S1
(A + B)
S2
Ex. 3: TCD Outputs
CEN214 Mohammed Arafah
S0
Y
AB
S1
(A + B)
C/Y
S2
Ex. 4: TOCD Outputs
Chapter 5 - Part 3
20
Constraint Checking
TC Constraints
Constraint 1: In state Si, for all possible TC pairs (Tij, Tik) on arcs to
distinct next states from Si,
Tij Tik = 0
Constraint 2: In state Si, for all possible TCs, Tij
S Tij = 1
OC Constraints
Chapter 5 - Part 3
21
Constraint Checking
Example 1:
Inputs: A , B
Outputs: Y , Z
Defaults: Y = 0, Z = 0
Transition Constraints:
(A+B) / Z
RESET
S0
S1
B/Y
(A+B) / Y
B/Y
AB
A
AB
A
S3
Z
AB
2
2
2
2
3
2
Output Constraints:
S2
Chapter 5 - Part 3
22
Constraint Checking
Example 1:
Output Constraints:
Inputs: A , B
Outputs: Y , Z
Defaults: Y = 0, Z = 0
(A+B) / Z
RESET
S0
B/Y
(A+B) / Y
AB
AB
A
S3
Z
AB
Constraint 1:
S0: For B Y = 1
By default, for B, Y = 0
B.B =0
S1
S1: For AB Y=1
By default, for A+B, Y = 0
AB . (A+B) = 0
B/Y
For A+B Z=1
A
By default, for AB, Z = 0
(A + B) . AB = 0
S2: For A+B Y=1
By default, for AB, Y = 0
(A + B) . AB = 0
S2
For AB Z=1
By default, for A+B, Z = 0
(AB) . (A+B) = 0
S3: None
Chapter 5 - Part 3
CEN214 Mohammed Arafah
23
Constraint Checking
Example 1:
Output Constraints:
Inputs: A , B
Outputs: Y , Z
Defaults: Y = 0, Z = 0
(A+B) / Z
RESET
S0
B/Y
(A+B) / Y
AB
AB
A
S3
Z
AB
Constraint 2:
S0: For B Y = 1
By default, for B, Y = 0
B+B =1
S1
S1: For AB Y=1
By default, for A+B, Y = 0
AB + (A+B) = 1
B/Y
For A+B Z=1
A
By default, for AB, Z = 0
(A + B) + AB = 1
S2: For A+B Y=1
By default, for AB, Y = 0
(A + B) + AB = 1
S2
For AB Z=1
By default, for A+B, Z = 0
(AB) + (A+B) = 1
S3: None
Chapter 5 - Part 3
CEN214 Mohammed Arafah
24
Constraint Checking
Example 2:
Inputs: A , B
Outputs: Y , Z
Defaults: Y = 0, Z = 0
Transition Constraints:
Y, Z
S0
A/Y, B/Z
AB
A+B
S1
BC/Z
A
A+C
BC/Y
2
2
2
2
2
2
2
2
AC
Output Constraints:
(B + C)/Z
S3
S0: AB(A + B) = 0;
AB + (A + B) = 1
S1: AC(A + C) = 0;
AC + (A + C) = 1
S2: BC (B + C) = 0;
BC + (B + C) = 1
S3: A A = 0;
A+A=1
BC/Y
S2
Chapter 5 - Part 3
25
S0
S0
X
Y
X
XY
Output Constraints
S1
S2
S1
S2
Chapter 5 - Part 3
26
State
Code
Transition
Condition
Next
State
Next
State Code
Output Actions
(and OCs)
State
Name 1
State
Code 1
Unused
Unconditional
Next State 1
Next State
Code 1
Moore or TCI
Output (and OC)
Transition
Cond. 11
Next State 11
Next State
Code 11
TCD or TOCD
Output 11 (and
OC)
Chapter 5 - Part 3
27
AB
A + B BC/Y
S1
A
A+C
BC/Y
State
State
Code
S0
00
Transition
Condition
Next
State
Next
State Code
Output
Actions (OCs)
Y,Z
A/Y, B/Z
AB
S1
01
AC
A+ B
S2
10
S1
(B + C)/Z
01
S2
S3
BC/Y
S2
TCD ...
S3
AC
S2
10
A+ C
S3
11
BC
S3
11
Y*
B+C
S0
00
Z*
S0
00
BC / Y*
S1
01
BC / Y*
10
TCI .
TOCD .
A/Y , B/Z
11
Chapter 5 - Part 3
28
Chapter 5 - Part 3
29
Example 1
Conversion of Traditional
State Diagram to State
Machine Diagram
Chapter 5 - Part 3
30
Example 1: Conversion
Traditional State Diagram:
Inputs: X, Y
Output: Z
Reset
10/0 , 11/0
01/1 , 11/0
00/1 , 10/0
00/0 , 01/0
00/0 , 01/1
00/1 , 11/1
01/1 , 10/1
10/0 , 11/1
X / Z
Reset
X
Y / Z
XY +XY
Y
X
CEN214 Mohammed Arafah
XY +XY
Chapter 5 - Part 3
31
Example 1: Conversion
State Machine Table (SMT)
State
State Code
Transition Condition
Next State
Q1 Q2
A
00
Q1 Q2
X
00
01
01
Output Actions
(OCs)
X/Z
Y
00
10
10
Y/Z
X
11
00
11
Z
XY+XY
11
XY+XY
10
Chapter 5 - Part 3
32
Example 1: Conversion
Equations
Flip-Flop Inputs:
Q1(t+1) = Q1 Q2 Y + Q1 Q2 X + Q1 Q2
Q1(t+1) = Q2 Y + Q1 X + Q1 Q2
Q2(t+1) = Q1 Q2 X + Q1 Q2 X + Q1 Q2 (X Y + X Y)
Q2(t+1) = Q1 Q2 X + Q1 Q2 X + Q1 X Y + Q1 Q2 X Y
Outputs:
Z = Q1 Q2 X + Q 1 Q2 Y + Q 1 Q2
Z = Q 2 X + Q 1 Y + Q1 Q 2
CEN214 Mohammed Arafah
Chapter 5 - Part 3
33
Example 1: Conversion
Q1
D
C R
RESET
Q2
D
CLK
X
Y
CEN214 Mohammed Arafah
Chapter 5 - Part 3
34
Example 2
Chapter 5 - Part 3
35
NI
Three ingredients
Two ingredients
Start
No Action
Stop
No Action
L0
Tank empty
L1
L2
L3
TZ
Timer at value 0
Chapter 5 - Part 3
36
MX
Mixer on
Mixer off
PST
No Action
TM
Timer on
Timer off
V1
V2
V3
VE
Chapter 5 - Part 3
37
Reset
Init
START . STOP
L1. STOP
Fill_1
V1
STOP
L1. STOP
L2. STOP
Fill_2
L3. STOP
Fill_3
V3
PST
L3.STOP
TM
TZ. STOP
L2.NI.STOP
V2
L2.NI.STOP
STOP
STOP
PST
Mix
MX
TZ. STOP
L0 + STOP
VE
Empty
L0. STOP
Chapter 5 - Part 3
38
Fill_1
Fill_2
Fill_3
Mix
Empty
State Code
100000
Transition Condition
Next State
START + STOP
Init
100000
START . STOP
Fill_1
010000
010000
V1
STOP
Init
100000
L1 . STOP
Fill_1
010000
L1 . STOP
Fill_2
001000
001000
V2
STOP
Init
100000
L2 . STOP
Fill_2
001000
L2. NI . STOP
Mix
000010
L2 . NI . STOP
Fill_3
000100
000100
PST*
V3
STOP
Init
100000
L3 . STOP
Fill_3
000100
L3 . STOP
Mix
000010
000010
PST*
MX
STOP
Init
100000
TZ . STOP
Mix
000010
TZ . STOP
Empty
000001
000001
TM*
VE
L0 . STOP
Empty
000001
L0 + STOP
Init
100000
Chapter 5 - Part 3
39
Flip-Flop Inputs:
Init(t+1) = Init . (START + STOP ) + STOP . (Fill_1 + Fill_2 +
Chapter 5 - Part 3
40
Outputs:
V1 = Fill_1
V2 = Fill_2
V3 = Fill_3
PST = X + Y
MX = Mix
TM = Z
VE = Empty
Chapter 5 - Part 3
CEN214 Mohammed Arafah
41
State
Constraint Checking
Init
Fill_1
Init
START . STOP
L1. STOP
Fill_1
[STOP ] . [ L1 . STOP] = 0
L2. STOP
Fill_2
STOP
V1
PST
L1. STOP
L2.NI.STOP
STOP
Fill_2
Reset
V2
L2.NI.STOP
L3. STOP
Fill_3
STOP
V3
PST
L3.STOP
TM
TZ. STOP
Mix
MX
TZ. STOP
L0 + STOP
VE
Empty
L0. STOP
42
State
Fill_3
Constraint Checking
L1. STOP
[STOP ] . [ L3 . STOP] = 0
Fill_1
Fill_2
STOP
L3. STOP
Fill_3
V3
PST
L3.STOP
TM
V2
L2.NI.STOP
STOP
V1
PST
L1. STOP
L2.NI.STOP
STOP
L2. STOP
Empty
Init
START . STOP
Mix
Reset
TZ. STOP
Mix
MX
TZ. STOP
L0 + STOP
VE
Empty
L0. STOP
Chapter 5 - Part 3
CEN214 Mohammed Arafah
43
State
Constraint Checking
Init
Fil_1
Fil_2
Reset
Init
START . STOP
L1. STOP
Fill_1
PST
L1. STOP
L2.NI.STOP
STOP
L2. STOP
Fill_2
STOP
Fil_3
Fill_3
STOP
V3
PST
L3.STOP
TM
Empty
V2
L2.NI.STOP
Mix
V1
TZ. STOP
Mix
MX
TZ. STOP
L0 + STOP
VE
Empty
L0. STOP
Chapter 5 - Part 3
CEN214 Mohammed Arafah
44
Example 3
Chapter 5 - Part 3
45
Name
LK
DR
PA
Approach Sensor
Person/object approach
No person/object approach
PP
Presence Sensor
Person/object in door
No person/object in door
MO
Manual Open by
Pushbutton
Manual Open
No Manual Open
CL
OL
Unlocked
Chapter 5 - Part 3
46
Chapter 5 - Part 3
47
Name
BT
Bolt
Bolt closed
Bolt open
CD
Close Door
Close door
No action
OD
Open Door
Open door
No action
Chapter 5 - Part 3
48
LK,
LK.PA . PP . MO
Defaults:
BT=0,
CD=0,
OD=0
CL / CD
Closed
Reset
LK . (PA + PP + MO)
OL
Open
OD
OL / OD
OL
PA + PP +MO
Opened
PA.PP.MO
CL.PA.PP.MO.DR
Close
PA+PP+MO+DR
CD
CL.PA.PP.MO.DR
CEN214 Mohammed Arafah
Chapter 5 - Part 3
49
State Code
Transition Condition
Next State
Y1 Y2
Closed
Open
Opened
Close
00
Next State
Code
LK
Closed
00
BT*
LK . PA . PP . MO
Closed
00
CL / CD *
LK . (PA + PP + MO)
Open
01
01
11
Output Actions
(OCs)
OD
OL
Open
01
OL
Opened
11
PA + PP + MO
Opened
11
PA . PP . MO
Close
10
10
OL / OD *
CD
CL . PA . PP . MO . DR
Close
10
CL . PA . PP . MO . DR
Closed
00
PA + PP + MO + DR
Open
01
Chapter 5 - Part 3
50
Flip-Flop Inputs:
Y1(t+1)= Y1 . Y2 . OL + Y1 . Y2 + Y1 . Y2 . CL . X . DR
Y2(t+1)= Y1 . Y2 . LK . X + Y1 . Y2 + Y1 . Y2 . X + Y1 . Y2 (X + DR)
Outputs:
BT = Y1 . Y2 . LK
CD = Y1 . Y2 + Y1 . Y2 . LK . CL . X = (Y1 + LK . CL . X) . Y2
OD = Y1 . Y2 + Y1 . Y2 . OL . X = (Y1 + OL . X) . Y2
CEN214 Mohammed Arafah
Simplification Theorem:
x + x y = x + y
Chapter 5 - Part 3
51
Example 4
Elevator Control
Elevator control for two-floor elevator
Warning: Does not include safety features or all user buttons!
Chapter 5 - Part 3
52
No action
Go to floor command
No action
F1(F2)
Elevator at floor
S1(S2)
Elevator approaching
floor
Elevator not
approaching floor
DO
Doors open
TO
DC
Doors closed
Doors closed
C1(C2)
Name
Call button (outside elevator) to
floor 1(2)
Chapter 5 - Part 3
53
Name
Up
Elevator to go up
Commands elevator to go up
No action
Down
Elevator to go down
No action
TS
Timer start
No action
SD
Slow down
OD
Open doors
Open doors
No action
CD
Close doors
Close doors
No action
Chapter 5 - Part 3
54
Chapter 5 - Part 3
55
Chapter 5 - Part 3
56
F1
Dn
Down
Hd_A
Hd_B
TO
Hd_C
DC(F1 + F2)/CD
DO/OD
DCF1
Up
DO(F1(C2 + G2) + F2(C1 + G1))/TS
CEN214 Mohammed Arafah
F2
S2/SD
F2
Chapter 5 - Part 3
57
Hd_B
Hd_C
Dn
State Code
Transition Condition
Next State
00001
00010
00100
Output Actions
(OCs)
DO/OD
Hd_A
00001
Hd_B
00010
TO
Hd_B
00010
TO
Hd_C
00100
DC(F1 + F2)
Hd_C
00100
DCF2
Dn
01000
DCF1
Up
10000
01000
TS*
CD*
Down, S1/SD
F1
Dn
01000
F1
Hd_A
00001
10000
Up, S2/SD
F2
Up
10000
F2
Hd_A
00001
Chapter 5 - Part 3
58
Outputs:
X = DO((F1(C2 + G2)
+ F2 (C1 + G1))
Y = DC(F1 + F2)
DHd_A = Hd_AX + DnF2 + UF1
DHd_B = Hd_AX + Hd_BTO
DHd_C = Hd_BTO + Hd_CY
DDn = Hd_C DCF2 + DnF1
DU = Hd_CDCF1 +UF2
Down = Dn
Up = U
SD = DnS1 + US2
TS = Hd_AX
OD = Hd_ADO
CD = Hd_CY
Chapter 5 - Part 3
59
Terms of Use
All (or portions) of this material 2008 by Pearson
Education, Inc.
Permission is given to incorporate this material or
adaptations thereof into classroom presentations and
handouts to instructors in courses adopting the latest
edition of Logic and Computer Design Fundamentals as
the course textbook.
These materials or adaptations thereof are not to be
sold or otherwise offered for consideration.
This Terms of Use slide or page is to be included within
the original materials or any adaptations thereof.
Chapter 5 - Part 3
60