CH15B

advertisement
Incompletely Specified State Tables
Network A
X
B
Seq. Network
Subsystem
Z
Network C
Assumptions:
(i) Network A can only generate sequences
X=100 and X = 110.
(ii) Network B produces output Z=1
when it receives X=110
and output Z=0 for X=100
(iii) Network C ignores values of Z
at other times, so that we don’t care
what Z is during the first two inputs of
the sequence.
( - is a don’t
care output)
t0, t1, t2 represent three successive clock cycles,1
Incompletely Specified State Tables
S0
1/-
0/0
0/1
S2
0/-
S3
S1
1/-
Present Next State
Z
State X=0 X=1 X=0 X=1
S0
S1
S1
S2
S3
S2
S0
0
S3
S0
1
Whenever there is a don’t
Input Output
care state or a don’t care
X=100 Z=--0
output, I can fill it with any X=110 Z=--1
value. I can also use row
2
matching to reduce the table.
Incompletely Specified State Tables
S0
1/-
0/0
0/1
S2
0/-
S3
Present
State
S0
S1
S2
S3
S1
1/-
Next State
Z
X=0 X=1 X=0 X=1
S0 S1
0
S2 S3
S0 S1
0
S0
1
-
Therefore, I should fill it in
a way that allows
minimization of the state
machine.
Input Output
X=100 Z=--0
X=110 Z=--1
3
Incompletely Specified State Tables
0/0
S0
1/0/1
0/1
S2
0/-
S3
Present
State
S0
S1
S2
S3
1/-
S1
1/-
Next State
Z
X=0 X=1 X=0 X=1
S0 S1
0
S2 S0 S3
1
S0 S1
0
S0 S3
1
-
S2 no longer exists in
the row reduced table,
so it is replaced with S0
Input Output
X=100 Z=--0
X=110 Z=--1
4
Incompletely Specified State Tables
0/0
S0
1/0/1
1/-
Input Output
X=100 Z=--0
X=110 Z=--1
S1
Present
State
S0
S1
S2
S3
Next State
Z
X=0 X=1 X=0 X=1
S0 S1
0
S2 S0 S3
1
S0 S1
0
S0 S3
1
-
Present
State
S0
S1
Next State
Z
X=0 X=1 X=0 X=1
S0 S1
0
S0 S1
1
-
S3 no longer exists in row reduced table,
so it is replaced with S1
5
Derivation of FF Input Equations
1. Assign FF state values to correspond to states
in the reduced table.
2. Construct a transition table which gives the next
states of the FF’s as a function of the present
states and inputs.
3. Derive next state maps from the transition table.
4. Find FF input maps from the next state maps
and find the input equations form the maps.
6
Derivation of FF Input Equations
Example:
Design a sequential
network to realize
the state table shown.
(This state assignment
is derived in 15.8)
For 7 states we need
3 FF’s, A B C
Transition Table based on state assignments
S0 = 000 S1 = 110 S2 = 111 …..
7
Derivation of D-FF Input Equations
Next State
maps for
D FF
realization
8
Derivation of JK-FF Input Equations
For a JK-FF with output Q, the characteristic
eqn. is Q+ = JQ’ + K’Q
From the next state map;
A+ = X’ = X’(A’+A) = X’A’+X’A
= JAA’ + KA’A => JA= X’, KA = X
B+ = X’C’+A’C+A’B
= (X’C’+A’C)(B’+B) + A’B
= (X’C’+A’C)B’ + (X’C’+A’C)B + A’B
= (X’C’+A’C)B’ + (X’C’+A’C+A’)B
= (X’C’+A’C)B’ + (X’C’+A’)B
= JBB’ + KB’B
=> JB= X’C’+A’C,
KB = (X’C’+A’)’ = [(A’+c’)(A’+X’)]’
= AC+XA
C+ = A+XB’
= (A+XB’)(C’+C)
= (A+XB’)C’ + (A+XB’)C
= JCC’ + KC’C
=> JC = A+XB’
KC = (A+XB’)’ = [(X+A)(A+B’)]’
= X’A’ + A’B
9
Derivation of JK-FF Input Equations
Alternate Method
JK-FF
shortcut method
10
Finding an Optimal State Assignment
(15.7)
• Why does choice of state assignment matter?
– BIG effect on complexity of excitation and output
equations AND thus on the amount of logic.
• How to find the best state assignment?
– The only known way is to try ALL assignments
and determine the resulting equations.
• N = 2: (2^2)! = 4! = 24 assignments
• N = 3: (2^3)! = 8! = ~ 40,000 assignments
• N = 4: (2^4)! = 16! = ~ 20,000,000,000,000
assignments for 4 state bits!
THIS IS NOT PRACTICAL!
\ Use heuristic guidelines for pretty good assignments.
•
There is no effective way to guarantee a “best”
assignment.
- the heuristic methods sometimes perform poorly!
11
Finding an Optimal State Assignment
(15.7)
It seems that we will not be able to
enumerate all possible state assignments,
generate the next state and output
equations, compute the
cost and then choose the best one.
Therefore we must settle for “good” state
assignments.
12
Guidelines for State Assignment
Good state assignments result when the
following set of empirical rules are followed in
the selection of the state assignment:
Rule 1: States that have the same next
state for a given input should be
given adjacent assignments.
Sa
Sb
I0=1
I0=1
Sc
Pred(Sc, I0=1) = {Sa , Sb}
Sa and Sb should be given
adjacent assignments.
13
Guidelines for State Assignment
Rule 2: States that are the next states of
the same state should be given
adjacent assignments.
1
Sj
Si
0
Sk
Suc(Si) = {Sj , Sk}
Sj and Sk should be
given adjacent
assignments.
14
Guidelines for State Assignment
Rule 3: States that have the same output
for a given input should be
given adjacent assignments.
Guideline:
The cost of the circuit will not be affected
by the choice of which state receives the
state “0” (according to McCluskey).
Therefore to simplify reset generating circuits,
the state “0” should always be assigned
to the reset state.
15
Guidelines for State Assignment
Example: Derivation of state assignment is
illustrated for state table given.
(i)
(ii)
The sets of adjacent states specified by guidelines
1 and 2 are:
K-maps (i) and (ii) are obtained by trial and error,
attempting to fulfill the adjacency conditions.
Conditions from guideline 1 have precedence over 2
Also conditions that are 2x have precedence over 1x
The k-map in (i) corresponds to the given state table
For this state assignment we need 6 gates, 13 inputs
to realize D-FF input eqns. vs. 10 gates, 39 inputs
16
for straight binary assignment.
Guidelines for State Assignment
Example (Cont’d):
The state assignment obtained using the guidelines
simplifies the FF input eqns.
Next state map in terms of Si map
(is used to obtain the A+, B+, C+ next state maps)
17
Guidelines for State Assignment
Example (Cont’d):
Next state map in
terms of Si map
(is used to obtain the
A+, B+, C+
next state maps)
1
1
0
1
1
0
1
1
0
1
1
0
1
18
Guidelines for State Assignment
Another Example:
1. (b,d) (c,f) (b,e)
2. (a,c) 2x (d,f) (b,d)
(b,f) (c,e)
3. (a,c) (b,d) (e,f)
We arrange the
states on k-maps
attempting to
satisfy as many
guideline pairs as
possible.
We derive D-FF
input eqns. for
this assignment by
first constructing
the transition table
19
Guidelines for State Assignment
Another Example (cont’d):
1. (b,d) (c,f) (b,e)
2. (a,c) 2x (d,f) (b,d)
(b,f) (c,e)
3. (a,c) (b,d) (e,f)
20
Download