ECE 331 – Digital System Design
Derivation of Flip-Flop Input Equations and State Assignment (Lecture #24)
The slides included herein were taken fro...
Derivation of Flip-Flop Input Equations and State Assignment (Lecture #24)
The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6th Edition, by Roth and Kinney, and were used with permission from Cengage Learning.
Sequential Circuit Design 1. Understand specifications 2. Draw state graph (to describe state machine behavior) 3. Construct state table (from state graph) 4. Perform state reduction (if necessary) 5. Assign a binary value to each state (state assignment) 6. Create state transition table 7. Select type of Flip-Flop to use 8. Derive Flip-Flop input equations and FSM output equation(s) 9. Draw circuit diagram Spring 2011
ECE 331 - Digital System Design
2
Derivation of Flip-Flop Input Equations
Spring 2011
ECE 331 - Digital System Design
3
Derivation of FF Input Equations Example #2: Derive the Flip-Flop input equations for the FSM described by the following state table. Assume that JK Flip-Flops are used in the design.
Excitation Table:
Spring 2011
Q
Q+
J
K
0
0
0
x
0
1
1
x
1
0
x
1
1
1
x
0
ECE 331 - Digital System Design
4
Example #2: FF Input Equations
Present Next State State X = 0 X = 1 S0 S1 S2 S1 S2 S3 S2 S3 S0 S3 S0 S1
Output X=0 X=1 0 1 0 0 1 0 0 1
State Table
Spring 2011
ECE 331 - Digital System Design
5
Example #2: FF Input Equations 1. Assign a binary value to each state. 2. Construct the state transition table.
AB 00
A+B+ X=0 X=1
JAKA X=0 X=1
JBKB X=0 X=1
01 10 11
Spring 2011
ECE 331 - Digital System Design
6
Example #2: FF Input Equations 3. Construct K-maps for Flip-Flop inputs. 4. Derive the minimized FF input equation.
JA = Spring 2011
KA = ECE 331 - Digital System Design
7
Example #2: FF Input Equations 3. Construct K-maps for Flip-Flop inputs. 4. Derive the minimized FF input equation.
JB = Spring 2011
KB = ECE 331 - Digital System Design
8
Derivation of FF Input Equations Example #3: Derive the Flip-Flop input equations for the FSM described by the following state table. Assume that SR Flip-Flops are used in the design.
Excitation Table:
Spring 2011
Q
Q+
S
R
0
0
0
x
0
1
1
0
1
0
0
1
1
1
x
0
ECE 331 - Digital System Design
9
Example #3: FF Input Equations
Present Next State State X = 0 X = 1 S0 S1 S2 S1 S2 S3 S2 S3 S0 S3 S0 S1
Output X=0 X=1 0 1 0 0 1 0 0 1
State Table
Spring 2011
ECE 331 - Digital System Design
10
Example #3: FF Input Equations 1. Assign a binary value to each state. 2. Construct the state transition table.
AB 00
A+B+ X=0 X=1
SARA X=0 X=1
SBRB X=0 X=1
01 10 11
Spring 2011
ECE 331 - Digital System Design
11
Example #3: FF Input Equations 3. Construct K-maps for Flip-Flop inputs. 4. Derive the minimized FF input equation.
SA = Spring 2011
RA = ECE 331 - Digital System Design
12
Example #3: FF Input Equations 3. Construct K-maps for Flip-Flop inputs. 4. Derive the minimized FF input equation.
SB = Spring 2011
RB = ECE 331 - Digital System Design
13
State Assignment
Spring 2011
ECE 331 - Digital System Design
14
State Assignment ●
After the number of states in the state table has been reduced …
●
A binary value must be assigned to each of the states.
●
–
State assignment (or state encoding)
–
Binary value = state of Flip-Flops
The cost of the logic required to realize the FSM is dependent on the state assignment.
Spring 2011
ECE 331 - Digital System Design
15
State Assignment ●
Given: A FSM with three states.
●
Requires: Two Flip-Flops (A and B) –
●
Can implement a maximum of four states.
There are 4 x 3 x 2 = 24 possible state assignments.
Spring 2011
ECE 331 - Digital System Design
16
State Assignment ●
For a FSM realized using symmetrical FlipFlops (i.e. JK and SR) –
3 unique state assignments for 3-state FSM
–
3 unique state assignments for 4-state FSM
Binary Spring 2011
ECE 331 - Digital System Design
Gray Code 17
State Assignment
Spring 2011
ECE 331 - Digital System Design
18
Guidelines for State Assignment
The author provides a set of guidelines by which the optimal state assignment can be selected.
Spring 2011
ECE 331 - Digital System Design
19
One-Hot State Assignment ●
Sometimes, reducing the next-state logic is more important than reducing the number of Flip-Flops.
●
One-hot state assignment may result in minimal next-state logic.
Spring 2011
–
Uses one Flip-Flop per state.
–
Exactly one Flip-Flop is set to 1 for each state.
ECE 331 - Digital System Design
20
Example: State Assignments For a 4-state FSM, three possible state assignments are:
Spring 2011
State S0
Binary 00
Gray-code 00
One-hot 0001
S1
01
01
0010
S2
10
11
0100
S3
11
10
1000
# of FF
2
2
4
ECE 331 - Digital System Design
21
Example: State Assignments Binary state-assignment: Present Next State State X = 0 X = 1 S0 S1 S2 S1 S2 S3 S2 S3 S0 S3 S0 S1 State Table Spring 2011
AB 00 01 10 11
A+B+ X=0 X=1 01 10 10 11 11 00 00 01
State Transition Table ECE 331 - Digital System Design
22
Example: State Assignments Gray-code state-assignment: Present Next State State X = 0 X = 1 S0 S1 S2 S1 S2 S3 S2 S3 S0 S3 S0 S1 State Table Spring 2011
AB 00 01 11 10
A+B+ X=0 X=1 01 11 11 10 10 00 00 01
State Transition Table ECE 331 - Digital System Design
23
Example: State Assignments One-hot state-assignment: Present Next State State X = 0 X = 1 S0 S1 S2 S1 S2 S3 S2 S3 S0 S3 S0 S1 State Table Spring 2011
A+B+C+D+ ABCD X = 0 X = 1 0001 0010 0100 0010 0100 1000 0100 1000 0001 1000 0001 0010 State Transition Table