Chap. 15: Reduction of State Tables/ State Assignment
Chap. 15: Reduction of State Tables/ State Assignment
15:
1
Statement of Problen
⇓
State Graph
⇓
⇓
Choice of F/F' s
State Table
⇓
⇓
Derivation of
Reduction of States
F/F Input Equation and
⇓
Z Output Equation
State Assignment
⇓
⇓
Circuit Realization and
Timing Chart 2
15-1
15-1 Elimination
Elimination of
of Redundant
Redundant States
States
3
A
0 1
B C
0 1 0 1
D E F G
0 1 0 1 0 1 0 1
H I J K L M N P
0 1 0 1/1 0 1/1 0 1
0 1 0 1 0 1 0 1
4
Input P.S. N.S. Present Output
Sequence x = 0 x =1 x = 0 x = 1
A
Reset A B C 0 0 0 1
0 B D E 0 0 B C
0 1 0 1
1 C F G 0 0 D E F G
00 D H I 0 0 H 0 1 0 1 0 1 0 1
I J K L MN P
01 E J K 0 0
0 1 0 1/1 0 1/1 0 1
10 F L M 0 0 0 1 0 1 0 1 0 1
11 G N P 0 0
000 H A A 0 0
001 I A A 0 0
010 J A A 0 1
011 K A A 0 0
100 L A A 0 1
101 M A A 0 0
110 N A A 0 0
111 P A A 0 0
5
Input P.S. N.S. Present Output
Sequence x = 0 x =1 x = 0 x = 1
Reset A B C 0 0
0 B D E 0 0
1 C E F DG 0 0 Equivalent state :
00 D H H I 0 0
☉ The same N.S.
01 E J HK 0 0
☉ The same Z
10 E F J L HM 0 0
11 DG HN HP 0 0
000 H A A 0 0
001 H I A A 0 0
010 J A A 0 1
011 HK A A 0 0
100 J L A A 0 1
101 HM A A 0 0
110 HN A A 0 0
111 HP A A 0 0
6
P.S. N.S. P.O.
x = 0 x = 1 x = 0 x = 1
A B C 0 0
B D E 0 0
C E D 0 0
D H H 0 0
E J H 0 0
H A A 0 0
J A A 0 1
0/0 A 0/0
0/0 1/0 1/1
B 1/0 1/0 C
0/0 0/0
D E
1/0
0/0 0/0
H J 7
15-2
15-2 Equivalent
Equivalent States
States
Equivalent States “ ≡ ”
2 machines : N 1 , N 2
⎧ A state p in N 1
⎨
⎩ A state q in N 2
r
↓
N1 p Z1 If Z1 = Z2 and r ≡ s
X s
↓
then p ≡ q
N2 q Z2
λ(p, x) =λ(q, x) : output
δ(p, x) =δ(q, x) : next state
8
15-3
15-3 Determination
Determination of
of State
State Equivalence
Equivalence
by
by using
using an
an Implication
Implication Table
Table
10
P.S. N.S.
x = 0 x = 1 Z
2. Check implied pair iteratively
a da
╳ c 0
b f h 0
c e
╳ c d
╳ a 1
d–f
b c–h d a e 0
c ╳ ╳ e c a 1
d a–d a–f ╳ f f b 1
c–e c–h
e ╳ ╳ a–d ╳ g b h 0
c–e
b–d a–b h c g 1
f ╳ ╳ e–f ╳ c–f
b–d a–b
g c–h b–f ╳ c–h ╳ ╳
h ╳ ╳ d–g ╳ a–g b–g ╳
c–e c–f
a b c d e f g
11
d–f P.S. N.S.
b c–h x=0 x =1 Z
c ╳ ╳ a a c 0
d a–d a–f ╳
c–e c–h b f h 0
e ╳ ╳ a–d ╳
c–e c c a 1
b–d a–b
f ╳ ╳ e–f ╳ c–f
b–d a–b f f b 1
g c–h b–f ╳ c–h ╳ ╳
h ╳ ╳ d–g ╳ a–g b–g
g b h 0
c–e c–f ╳
a b c d e f g h c g 1
a≣d
c≣e
12
15-4
15-4 Equivalent
Equivalent Sequential
Sequential Circuits
Circuits
Definition : N1 ≡ N2 iff P in N 1 ≡ q in N 2
S in N 2 ≡ t in N 1
N1 N2
Ex: x = 0 x =1 x = 0 x =1 x = 0 x =1 x = 0 x =1
A B A 0 0 S0 S3 S1 0 1
B C D 0 1 S1 S3 S0 0 0
C A C 0 1 S2 S0 S2 0 0
D C B 0 0 S3 S2 S3 0 1
1/0
Method 1. By observing S0
A A ≡ S2 0/0 1/0
0/0 0/0 1/0
1/1 B ≡ S0 0/0
1/1
0/0 S2 S1
C B C ≡ S3
1/1 0/0 0/0
0/0 1/0 D ≡ S1
S3
D 1/1 13
N1 N2
x = 0 x =1 x = 0 x =1 x = 0 x =1 x = 0 x =1
A B A 0 0 S0 S3 S1 0 1
B C D 0 1 S1 S3 S0 0 0
C A C 0 1 S2 S0 S2 0 0
D C B 0 0 S3 S2 S3 0 1
Method 2. By implication table
1. Construct implication table by listing all state pair. X out pairs with different output
C–S3 A–S3
S0
D–S1 C–S1
S1 B–S3 C–S3
A–S0 B–S0
S2 B–S0 C–S0
A–S2 B–S2
C–S2 A–S2
S3
D–S3 C–S3
A B C D
14
C–S3 A–S3
S0
D–S1 C–S1
S1 B–S3 C–S3
A–S0 B–S0
S2 B–S0 C–S0
A–S2 B–S2
C–S2 A–S2 C–S3 A–S3
S3 S0
D–S3 C–S3 D–S1 C–S1
A B C D
S1 B–S3 C–S3
A–S0 B–S0
S2 B–S0 C–S0
A–S2 B–S2
C–S2 A–S2
S3
D–S3 C–S3
A B C D
⇒ A ≡ S2 B ≡ S0 C ≡ S3 D ≡ S1
15
15-5
15-5 Incompletely
Incompletely Specified
Specified State
State Tables
Tables
Ex:
t0 t1 t2 t 0 t1 t 2
X= 1 0 0 Z= – – 0
1 1 0 – – 1
If don’t cares are present, the state table is incompletely specified
16
State Graph for Network B:
S0
1/– 0/–
0/0 0/1
S1
0/– 1/–
S2 S3
1/–
P.S. N.S. Z
x =0 x =1 x =0 x =1
S0 – S1 – –
S1 S2 S3 – –
S2 S0 – 0 –
S3 S0 – 1 –
17
P.S. N.S. Z
x = 0 x =1 x = 0 x =1
S0 –(S0) S 1 –(0) –
S1 S 2S0 – –(1) –
S2 S0 –(S1) 0 –
S3 S0 – 1 –
N.S. Z
P.S. x=0 x =1 x=0 x =1
S0 S0 S1 0 –
S1 S0 – 1 –
Reduction of states !!
18
15-6
15-6 Derivation
Derivation of
of F/F
F/F Input
Input Equations
Equations
State Graph
⇒ State Table
⇒ State Assignment
⇒ State Transition Table
Choice of F/F!
⇒ K - map
⇒ F/F Input Equations
19
N.S. Z
Ex : P.S. x = 0 x = 1 x = 0 x = 1
S0 S1 S2 0 0
S1 S3 S2 0 0
S2 S1 S4 0 0
S3 S5 S2 0 0
S4 S1 S6 0 0
S5 S5 S2 1 0
S6 S1 S6 0 1
7 states ⇒ 3 F/F' s A B C
A+B+C+ Z
A B C x = 0 x =1 x = 0 x =1
0 0 0 110 001 0 0
1 1 0 111 001 0 0
0 0 1 110 011 0 0
1 1 1 101 001 0 0
0 1 1 110 010 0 0
1 0 1 101 001 1 0
0 1 0 110 010 0 1
21
Q +
(1) Choose D-F/F D
0 0
1 1
DA DB DC DA DB DC
X= X= X= X= X= X=
ABC 0 1 0 1 0 1 ABC 0 1 0 1 0 1
000 1 0 1 0 0 1 000 1 0 1 0 0 1
110 1 0 1 0 1 1 001 1 0 1 1 0 1
001 1 0 1 1 0 1 010 1 0 1 1 0 0
111 1 0 0 0 1 1 ⇒ 011 1 0 1 1 0 0
011 1 0 1 1 0 0 100 × × × × × ×
101 1 0 0 0 1 1 101 1 0 0 0 1 1
010 1 0 1 1 0 0 110 1 0 1 0 1 1
111 1 0 0 0 1 1
22
DA DB DC
ABC 0 X= 1 0 X= 1 0 X= 1
000 1 0 1 0 0 1
001 1 0 1 1 0 1
010 1 0 1 1 0 0
011 1 0 1 1 0 0
100 × × × × × ×
101 1 0 0 0 1 1
110 1 0 1 0 1 1
111 1 0 0 0 1 1
XA XA XA
BC 00 01 11 10 BC 00 01 11 10 BC 00 01 11 10
00 1 × × 0 00 1 × × 0 00 0 × × 1
01 1 1 0 0 01 1 0 0 1 01 0 1 1 1
11 1 1 0 0 11 1 0 0 1 11 0 1 1 0
10 1 1 0 0 10 1 1 0 1 10 0 1 1 0
A+ = DA = X' B + = DB C + = DC
= X'C' + A'C + A'B = A + XB'
Derivation of D F/F input equations
23
Q+
(2) Choose J-K F/F
Q J K
0 0 0 ×
0 1 1 ×
1 0 × 1
1 1 × 0
25
Next State Map D- F/F Input Map
Q 0 1 AB 0 1
AB 1
00 0 1 00 0
0 01 1 0
01 1
11 11 0 0
0 0
10 10 1 x
1 x
D = Q’A’B’+QB’+AB’
Q+
26
Derivation of Flip-Flop Input Equations from Next State Maps
27
Next State Map T – F/F Input Map
Q 0 1
AB AB 0 1
00 0 1 0
00 0
01 1 0 1
01 1
11 0 0 11 0 1
10 1 x 10 1 x
Q+ T = A’B+AB’+QB
28
Derivation of Flip-Flop Input Equations from Next State Maps
29
Next State Map R-S F/F Input Maps
Q 0 1 0 1 0 1
AB AB AB
00 0 1 00 x 00 0
0 x
01 1 0 01 1 0 01 0 1
11 0 0 11 0 0 11 x 1
10 1 x 10 1 x 10 0 x
Q+ S = AB’+Q’A’B R = QB
30
Derivation of Flip-Flop Input Equations from Next State Maps
Q 0 1 0 1 0 1
AB AB AB
1 00 x 00 0
00 0 0 x
0 01 1 x 01 x 1
01 1
11 0 0 11 0 x 11 x 1
10 10 1 x 10 x x
1 x
Q+ J = A’B+AB’ K=B
32
A+ B+ C+
Next - State Maps ABC 0
X=
1
X=
0 1 0
X=
1
000 1 0 1 0 0 1
001 1 0 1 1 0 1
010 1 0 1 1 0 0
011 1 0 1 1 0 0
100 × × × × × ×
101 1 0 0 0 1 1
110 1 0 1 0 1 1
111 1 0 0 0 1 1
XA XA XA
BC 00 01 11 10 BC 00 01 11 10 BC 00 01 11 10
00 1 × × 0 00 1 × × 0 00 0 × × 1
01 1 1 0 0 01 1 0 0 1 01 0 1 1 1
11 1 1 0 0 11 1 0 0 1 11 0 1 1 0
10 1 1 0 0 10 1 1 0 1 10 0 1 1 0
33
Derivation of J-K Input Equations from Next State Maps
JA
XA K'A XA XA
BC 00 01 11 10 BC 00 01 11 10 BC 00 01 11 10
00 1 × × 0 00 1 × × 0 00 0 × × 1
JB
01 1 1 0 0 01 1 0 0 1 01 0 1 1 1
JC K'C
11 1 1 0 0 11 1 0 0 1 11 0 1 1 0
K'B
10 1 1 0 0 10 1 1 0 1 10 0 1 1 0
A+ B+ C+
JA = X' J B = X'A' + A'C JC = A + XB'
KA = X K B = AC + XA KC = X'A' + A'B
X1 Z1
Mealy M
X2 Z2
CLK
N.S. Z
x1x2= x1x2=
P.S. 00 01 11 10 00 01 11 10
S0 S0 S0 S1 S1 00 00 01 01
S1 S1 S3 S2 S1 00 10 10 00
S2 S3 S3 S2 S2 11 11 00 00
S3 S0 S3 S2 S0 00 00 00 00
4 states ⇒ 2 F/F' s A , B
State Assignment : S 0 = 00 , S 1 = 01 , S 2 = 11 , S 3 = 10
36
State
State transition
transition Table
Table
N.S. Z
P.S. x1x2= x1x2=
AB 00 01 11 10 00 01 11 10
00 00 00 01 01 00 00 01 01
01 01 10 11 01 00 10 10 00
11 10 10 11 11 11 11 00 00
10 00 10 11 00 00 00 00 00
37
D-F/F XA XA
BC 00 01 11 10 BC 00 01 11 10
00 0 0 0 0 00 0 0 1 1
01 0 1 1 0 01 1 0 1 1
11 1 1 1 1 11 0 0 1 1
10 0 1 1 0 10 0 0 1 0
D A = A + = X 2 B + AB + X 2 A D B = B+ = X1A + X 2 ' A' B
+ X1 B + X1X 2
XA XA
BC 00 01 11 10 BC 00 01 11 10
00 0 0 0 0 00 0 0 1 1
01 0 1 1 0 01 0 0 0 0
11 1 1 0 0 11 1 1 0 0
10 0 0 0 0 10 0 0 0 0
Z1 = X 2 A' B + X1 ' AB Z 2 = X1A' B'+ X1 ' AB
38
S-R F/F XA XA
BC 00 01 11 10 BC 00 01 11 10
00 0 0 0 0 00 × × × ×
A=0
01 0 1 1 0 01 × 0 0 ×
Q Q+ S R 11 × × × × 11 0 0 0 0
A=1
0 0 0 × 10 0 × × 0 10 1 0 0 1
0 1 1 0
SA = X 2 B R A = X 2 ' B'
1 0 0 1
1 1 × 0
XA XA
BC 00 01 11 10 BC 00 01 11 10
B=0
00 0 0 1 1 00 × × 0 0
01 0 0 × × 01 0 1 0 0
B=1
11 × 0 × × 11 1 1 0 0
10 0 0 1 0 10 × × 0 ×
S B = X1X 2 + X1A' R B = X1 ' X 2 + X1 ' A
39
Derivation of F/F Input Equations
State Graph
⇒ State Table
⇒ State Assignment
⇒ State Transition Table
(Choice of F/F)
⇒ K - map
⇒ F/F Input Equations
40
15-7
15-7 Equivalent
Equivalent State
State Assignments
Assignments
NOR implementation
X’
DA
B’
42
Adjacent
Adjacent states
states
43
15-8
15-8 Guildlines
Guildlines for
for State
State Assignment
Assignment
S1 S5
1/0 1/1
S2
根據guideline 1,S1、S5需要相鄰。
45
Guideline 2:同一個state跳出來的next states。
states has the same p.s.
S0
0/0 1/0
S1 S4
根據guideline 2,S1、S4需要相鄰。
46
Guideline 3:在相同的input條件下,會產生相同output的states。
same output states
S0 S1 S3 S4 S5
S1 S1 S5 S3 S1
根據guideline 3,S0、S1、S3、S4、S5需要相鄰。
47
Ex: P.S.
N.S.
x = 0 x =1 x = 0 x =1
Z
S0 S1 S2 0 0
S1 S3 S2 0 0
S2 S1 S4 0 0
3 F/F' s A , B , C
S3 S5 S2 0 0
S4 S1 S6 0 0
S5 S5 S2 1 0
S6 S1 S6 0 1
1.list
1.list relationship
relationship
States having the same n.s.
Rule 1: (S 0 ,S 1 ,S 3 ,S 5 ) (S 3 ,S 5 ) (S 4 ,S 6 ) (S 0 ,S 2 ,S 4 ,S 6 )
Rule 2 : (S 1 ,S 2 ) (S 2 ,S 3 ) (S 1 ,S 4 ) (S 2 ,S 5 ) × 2 (S 1 ,S 6 ) × 2
States having the same p.s. 48
2.Use
2.Use an
an assignment
assignment map
map
A A
BC 0 1 BC 0 1
00 S 0 00 S 0
01 S 2 S 5 01 S 1 S 6
11 S 4 S 3 11 S 3 S 4
10 S 6 S 1 10 S 5 S 2
6 gates 13 literals
50
Another straight forward assignment
N.S. Z
P.S. x=0 x =1 x=0 x =1
000 S0 S1 S2 0 0
001 S1 S3 S2 0 0
010 S2 S1 S4 0 0
011 S3 S5 S2 0 0
100 S4 S1 S6 0 0
101 S5 S5 S2 1 0
110 S6 S1 S6 0 1
10 gates 39 literals
51
Why guideline help ?
A+ B + C + Z
ABC x=0 x =1 x = 0 x =1
000 S0 110 S1 001 S2 0 0
110 S1 111 S3 001 S2 0 0
Next state map
001 S2 110 S1 011 S4 0 0
111 S3 101 S5 001 S2 0 0
011 S4 110 S1 010 S6 0 0
101 S5 101 S5 001 S0 1 0
010 S6 110 S1 010 S6 0 1 A+ B + C + Z
x=0 x =1 x = 0 x =1
S0 000 110 S1 001 S2 0 0
S2 001 110 S1 011 S4 0 0
S6 010 110 S1 010 S6 0 1
S4 011 110 S1 010 S6 0 0
− 100 × × × ××× − −
S5 101 101 S5 001 S 2 1 0
State transition graph
S1 110 111 S3 001 S 2 0 0
S3 111 101 S5 001 S 2 0 0 52
XA
BC 00 01 11 10
Next state map 00 S1 ╳ ╳ S2
S0 S0
01
S1 S5 S2 S4
S2 S5 S5 S2
11 S1 . S5 S2 S6
S4 S3 S3 S4
S0 S2 S4 S6
10
S1 S3 S2 S6 S4 S6
S6 S1 S1 S6
S3 S5 S1 S3 S5
XA A+ XA B+ XA C+
BC 00 01 11 10 BC 00 01 11 10 BC 00 01 11 10
00 1 × × 0 00 1 × × 1 00 0 × × 1
01 1 1 0 0 01 1 0 0 1 01 0 1 1 1
11 1 1 0 0 11 1 0 0 1 11 0 1 1 0
10 1 1 0 0 10 1 1 0 1 10 0 1 1 0
A + = X' due to S 2 S5 assignment 53
Ex:
N.S. Z
P.S. x = 0 x =1 x = 0 x =1 Guidelines
a a c 0 0
1.( b,d ) ( c,f ) ( b,e )
b d f 0 1
2.( a,c ) × 2 , ( d,f ) ( b,d )
c c a 0 0
d d b 0 1
( b,f ) ( c,e )
e b f 1 0 3.(a,c) ( b,d ) (e,f)
f c e 1 0
54
Assignment (a) Assignment (b)
Q1
0 1 Q1
Q2 Q3 a = 000 0 1
00 a c Q2 Q3 a = 100
b = 111 00 c a b = 111
01 e c = 100
01 e c = 000
11 b d d = 011
11 d b d = 011
e = 101
10 f e = 101
f = 110 10 f
f = 010
1.( b,d ) ( c,f ) ( b,e )
2.( a,c ) × 2 , ( d,f ) ( b,d )
( b,f ) ( c,e )
3.(a,c) ( b,d ) (e,f) 55
For Assignment (b)
P.S. N.S. Z
Q1Q 2 Q 3 x = 0 x =1 x = 0 x =1
m4 100 100 000 0 0
m7 111 011 010 0 1
m0 000 000 100 0 0
m3 011 011 111 0 1
m5 101 111 010 1 0
m2 010 000 101 1 0
m1 001 −−− −−− − −
m6 110 −−− −−− − −
56
State Transition Table
P.S. N.S. Z
Q1Q 2 Q 3 x = 0 x =1 x = 0 x =1 next state map
m0 000 000 100 0 0
m1 001 −−− −−− − 1 XQ1
Q2Q3 00 01 11 10
m2 010 000 101 1 0
00 000 100 000 100
m3 011 011 111 0 1
01 ╳ 111 010 ╳
m4 100 100 000 0 0
m5 101 111 010 1 0 11 011 011 010 111
m6 110 −−− −−− − −
10 000 ╳ ╳ 101
m7 111 011 010 0 1
57
Next State Map
J1
XQ1 Q1=0 XQ1
Q2Q3 Q2Q3 00 01 11 10
00 01 11 10
00 0 1 0 0 Q2=0 00 0 1 0 0
01 × 1 0 × Q1+ J2 01 × 1 0 ×
0 0 0 1 J 1 = XQ 2 Q2=1 0 0 0 1
11 11
× ×
k1 = X + Q 2 K2’ × ×
10 0 1 10 0 1
Q1=1 K1’
Q 1+
XQ1
Q2Q3 00 01 11 10 J2 = Q3
00 0 1 0 0 k2 = Q3'
Q3=0
Q3=1 01 × 1 0 ×
Q 3+
K3’ 0 0 0 1 J3
11 J 3 = XQ 2
10 0 × × 1 k 3 = XQ1 58
D - F/F Implementation
XQ1 XQ1
Q2Q3 00 01 11 10 Q2Q3 00 01 11 10
1 1 00
00
01 × 1 × 01 × 1 1 ×
11 1 11 1 1 1 1
10 × × 1 10 × ×
11 1 1 1 11 1 1
10 × × 1 10 1 × ×
Q +3 = X 1Q0 + X 2Q1 + X 3Q 2 + X 4Q 3
60
• For Moore machine,
S0: Q0Q1Q2=100, S1: 010, S2: 001
Z1 = Q 0 Z 2 = Q1 Z3 = Q2
61
HOMEWORK
HOMEWORK ---- Unit
Unit 15
15
• 15. 8
• 15. 20
• 15. 28
62
A Short Cut Method to Find J-K Flip-Flop Input Equations
Q For J - K F/F : JA , KA independent of QA 又 Q + = JQ'+ K' Q
⇒ Q = 0 時 Q+ = J Q = 1 時 Q + = K' Q Q+ J K
0 0 0 ×
Example
0 1 1 ×
QA QA
↓ ↓
Q QA QA
QB QC A QB QC JB map QB QC
0 1 0 1 0 1
00 1 1 00 1 1 00 1 1
B=0 C=0
01 × × 01 × × 01 × × C=1
JC map
11 0 0 11 0 0 11 0 0 K'C map
B=1
10 0 × 10 0 × 10 0 ×
JA map K'A map QB+ K'B map QC+
QA+ JB=1 KB=1 Jc=B’ Kc=1
JA = B' KA = B or C
64