0% found this document useful (0 votes)
143 views

Chap. 15: Reduction of State Tables/ State Assignment

1) The document discusses methods for reducing state tables by eliminating redundant states. 2) It introduces the concept of equivalent states and describes how to determine if two states are equivalent by comparing their next states and outputs for all inputs. 3) An implication table is used to systematically compare all state pairs and identify equivalent state pairs based on their satisfying the conditions for equivalent states.

Uploaded by

studboy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

Chap. 15: Reduction of State Tables/ State Assignment

1) The document discusses methods for reducing state tables by eliminating redundant states. 2) It introduces the concept of equivalent states and describes how to determine if two states are equivalent by comparing their next states and outputs for all inputs. 3) An implication table is used to systematically compare all state pairs and identify equivalent state pairs based on their satisfying the conditions for equivalent states.

Uploaded by

studboy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Chap.

15:

Reduction of State Tables/


State Assignment

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

When setting up states, some extra states may be included.


⇒ eliminate these states

Ex:a previous example

X Z Z gives "1" after X receiving


0101 or 1001
CLK

A brute force solution:


Reset state A, checks 3 consequent bits of every possible combinations.
After 4th bit coming-in, give output and reset to state A.

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

Ex: P.S. N.S.


x = 0 x = 1 Z
a da
╳ c 0
b f h 0
c e
╳ c d
╳ a 1
d a e 0
e c a 1
f f b 1
g b h 0
h c g 1
9
Implication chart construction P.S. N.S.
x = 0 x = 1 Z
1. state comparison by implied pair
(only for the same output)
a d c 0
b f h 0
c e d 1
d–f
b c–h Output shall be the same 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

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:

A can only gives 100 , 110


⎧ "0" 100 received⎫
B gives ⎨ if ⎬ at 3rd bit
⎩ "1" 110 received⎭

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

Let S0 = 000 , S1 = 110 , S2 = 001 , S3 = 111 ,


S4 = 011 , S5 = 101 , S6 = 010
20
Transition Table

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

A+B+C+ JAKA JBKB JCKC


X= X= X= X=
ABC 0 1 0 1 0 1 0 1
000 110 001 1× 0× 1× 0× 0 × 1×
110 111 001 ×0 ×1 ×0 ×1 1× 1×
001 110 011 1× 1× : : : :
111 101 001 ×0 ×1 : : : :
011 110 010 1× ×0 : : : :
101 101 001 ×0 0× : : : :
010 110 010 ×0 ×0 : : : :
24
Derivation of Flip-Flop Input Equations from Next State Maps

Q=0 Q=1 Rules for forming input map from


next state map
Type of F/F Input Q+ =0 Q+=1 Q+ = 0 Q+ = 1 Q=0 Half of Map Q=1 Half of Map

D-F/F D 0 1 0 1 No change No change

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

Q=0 Q=1 Rules for forming input map from


next state map
Type of F/F Input Q+ =0 Q+=1 Q+ = 0 Q+ = 1 Q=0 Half of Map Q=1 Half of Map

D-F/F D 0 1 0 1 No change No change


T-F/F T 0 1 1 0 No change Complement

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

Q=0 Q=1 Rules for forming input map from


next state map
Type of F/F Input Q+ =0 Q+=1 Q+ = 0 Q+ = 1 Q=0 Half of Map Q=1 Half of Map

D-F/F D 0 1 0 1 No change No change


T-F/F T 0 1 1 0 No change Complement

S 0 1 0 x No change Replace 1’s


with x’s
S-R F/F R x 0 1 0 *Replace 0’s
with x’s Complement
*Replace 1’s
with 0’s

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 Q=1 Rules for forming input map from


next state map
Type of F/F Input Q+ =0 Q+=1 Q+ = 0 Q+ = 1 Q=0 Half of Map Q=1 Half of Map

D-F/F D 0 1 0 1 No change No change


T-F/F T 0 1 1 0 No change Complement

S 0 1 0 x No change Replace 1’s


with x’s
R-S F/F R x 0 1 0 *Replace 0’s
with x’s Complement
*Replace 1’s
with 0’s
J 0 1 x x No change Fill in with x’s
J-K F/F
K x x 1 0 Fill in with x’s Complement
31
Next State Map J-K F/F Input 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

Derivation of J-k F/F input equations


34
Q Q+ S R
0 0 0 ×
(3) Choose S-R F/F 0 1 1 0
1 0 0 1
1 1 × 0

A+B+C+ SARA SBRB SCRC


X= X= X= X=
ABC 0 1 0 1 0 1 0 1
000 110 001 10 0x : : : :
110 111 001 x0 01 : : : :
001 110 011 10 0x : : : :
111 101 001 x0 01 : : : :
011 110 010 10 0x : : : :
101 101 001 x0 01 : : : :
010 110 010 10 0x : : : :
35
Ex:Another example with 2 inputs X1X 2 , 2 outputs Z1 Z 2

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

Different state assignment


⇒ different F/F Input Equations !

40
15-7
15-7 Equivalent
Equivalent State
State Assignments
Assignments

§ Cost of logic strongly depends on state assignments.

Ex: Assign 1 Assign 2 N.S. Z


AB AB P.S. x = 0 x =1 x = 0 x =1
11 00 S1 S1 S3 0 0
10 01 S2 S2 S1 0 1
01 10 S3 S2 S3 1 0
NOR implementation
* Assignment 1 X’
DA
S1 = 00 , S2 = 01 , S3 = 10 B
D - F/F : 2 F/F' s A , B A
B
D A = XB' D B = X' (A + B) X
DB
41
* Assignment 2
S1 = 11 , S2 = 10 , S3 = 01
D - F/F : 2 F/F' s A , B
D A = X' + B' D B = X + A' B'

NOR implementation
X’
DA
B’

A’ ⇒ 2 more gates for


B’ DB
X NOR implementation

42
Adjacent
Adjacent states
states

2 states are adjacent


S1 ( 0 1 0 ) S2 ( 0 1 1 ) ⎫
⎬adjacent
(10 0 ) ( 11 0 ) ⎭
S1 ( 0 1 0 ) S2 ( 1 1 1 ) ⎫
⎬ not adjacent
( 0 01) ( 111 ) ⎭

43
15-8
15-8 Guildlines
Guildlines for
for State
State Assignment
Assignment

work for D F/F , J - K F/F


not for T F/F , S - R F/F

1 . States which have the same next state should


be given adjacent assignment .
2. States which are next states of the same state
should be given adjacent assignment .
3.States which have the same output
⇒ adjacent states To minimize
In above order !! output function

No guarantee a minimum solution 44


Guideline 1:在相同的input條件下,會跳到同一個next state
的states。
state has the same n.s.

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

0/0 0/0 0/0 0/0 0/0

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

Assignment (a) Assignment (b)


States having the same n.s.
High
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 ) priority
Rule 2 : (S 1 ,S 2 ) (S 2 ,S 3 ) (S 1 ,S 4 ) (S 2 ,S 5 ) × 2 (S 1 ,S 6 ) × 2
49
States having the same p.s.
Assignment(a)
N.S. Z
P.S. x = 0 x =1 x = 0 x =1
000 S0 S1 S2 0 0
110 S1 S3 S2 0 0
001 S2 S1 S4 0 0
111 S3 S5 S2 0 0
011 S4 S1 S6 0 0
101 S5 S5 S2 1 0
010 S6 S1 S6 0 1

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 × ×

Q1+ = X' Q1Q 2 '+ XQ 2 ' Q 2+ = Q 3


XQ1 XQ1
Q2Q3 00 01 11 10 Q2Q3 00 01 11 10
00 00
01 × 1 × 01 × 1 ×

11 1 1 1 11 1 1

10 × × 1 10 1 × ×

Q 3+ = XQ 1 ' Q 3 + X' Q 2 Q 3 ' Z = XQ 2 Q 3 + X' Q 2 ' Q 3


+ X' Q 2 Q 3 ' 59
15-9
15-9 Using
Using aa One-Hot
One-Hot State
State Assignment
Assignment
• When design with CPLD and FPGAs, it may not be important to
minimize the number of F/F used in the design
• In order to design faster logic, the number of cells and interconnections
between cells should be reduced
• One-hot state assignment
– Using one F/F only for each state
– 4 states use 4 F/F (Q0, Q1 , Q2 , Q3) with following state assignment
S0: Q0Q1Q2Q3=1000, S1: 0100, S2: 0010, S3: 0001

Write next-state and output eq.


directly by inspecting the state graph

Q +3 = X 1Q0 + X 2Q1 + X 3Q 2 + X 4Q 3
60
• For Moore machine,
S0: Q0Q1Q2=100, S1: 010, S2: 001

Q1+ = F' R ' Q0 + FQ2 + F' RQ1


Q +2 = F' R ' Q1 + FQ0 + F' RQ 2
Q +3 = F' R ' Q 2 + FQ1 + F' RQ0

Z1 = Q 0 Z 2 = Q1 Z3 = Q2

• When design with CPLDs or FPGAs, try both an assignment with a


minimum number of state variables and a one-hot assignment

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 ×

Next state map : Q +A Q +B Q C+ 1 0 × 1


1 1 × 0
QA QA
P.S. N. S. QA
↓ ↓
QA
QAQBQC QA+QB+QC+ QA
QB QC 0 1 QB QC 0 1 QB QC 0 1
000 111 00 1 1 00 1 1 00 1 1
001 xxx 01 × × 01 × × 01 × ×
010 000
011
11 0 0 11 0 0 11 0 0
000
100 111 10 0 × 10 0 × 10 0 ×
101 xxx
110 xxx
QA+ QB+ QC+
111 000
63
Q For J - K F/F : JA , KA independent of QA 又 Q + = JQ'+ K' Q
⇒ Q = 0 時 Q+ = J Q = 1 時 Q + = K'

Next state map : Q +A Q +B Q C+

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

You might also like