You are on page 1of 7

state_name/

output list
xxx
(a) state box
condition
(true
branch)
(false
branch)
1 0
conditional
output list
(b) decision box
(c) conditional
output box
optional
state code
Figure 5-1 Components of an SM Chart
S0 /
St
Load
S1 /
M
Sh
K
S2 / Sh
Ad
S3 / Done
K
1
1
1
0
0
0
0
1
Figure 5-9 SM Chart for Binary Multiplier
Adder
Display Display
1-to-6
Counter
1-to-6
Counter
Point
Register
Comparator
Test
Logic
Control
Win
Lose
Rb
Reset
Roll
D
7
D
711
D
2312
Eq
Sp
Sum
DiceGame Module
Figure 5-11 Block Diagram for Dice Game
Roll dice
Sum =
7 or 11
Sum =
2,3,or 12
Store sum in
point register
Roll Dice
Sum =
Point
Sum = 7
Lose
Reset
Reset
Win
N
Y
N Y
N Y
N
Y
N Y
Y
N
Figure 5-12 Flowchart for Dice Game
Figure 5-13 SM Chart for Dice Game
Sp
Rb
D
711
0
D
2312
S1 / Roll
1
1
0
1
0
S0 /
Rb
0
S4 /
Eq
0
1
D
7
0
0
Rb
S5 /
Rb
1
1
1
0
Roll
S3 / Lose
S2 / Win
1
0
Reset
S3 / Lose
Reset
1
0 1
S2 / Win
PLA
Q
CK
D
Q
CK
D
Q
CK
D
Clock
Rb
Reset
D
711
D
7
D
2312
Eq
Win
Lose
Roll
Sp
C
B
A
A
+
B
+
C
+
Figure 5-21 PLA Realization of Dice Game Controller
Table 5-2 PLA Table for Dice Game
ABC Rb Reset D
7
D
711
D
2312
Eq
A
+
B
+
C
+ Win Lose Roll Sp
1 000 0 0 0 0 0 0 0 0
2 000 1 0 0 1 0 0 0 0
3 001 1 0 0 1 0 0 1 0
4 001 0 0 0 1 0 0 0 0 0 1
5 001 0 0 1 0 1 1 0 0 0 0
6 001 0 1 0 1 0 0 0 0 0
7 010 0 0 1 0 1 0 0 0
8 010 1 0 0 0 1 0 0 0
9 011 1 0 0 0 0 1 0 0
10 011 0 0 1 1 0 1 0 0
11 100 0 1 0 0 0 0 0 0
12 100 1 1 0 1 0 0 0 0
13 101 0 0 0 1 0 0 0 0 0 0
14 101 0 1 0 0 1 1 0 0 0 0
15 101 0 1 0 1 0 0 0 0 0
16 101 1 1 0 1 0 0 1 0
17 110
18 111