Download presentation
1
ECE 301 – Digital Electronics
Sequential Logic Circuits: State Assignment And State Minimization (Lecture #20)
2
State Assignment Problem
ECE Digital Electronics
3
State Assignment Problem
Some state assignments are better than others. The state assignment influences the complexity of the state machine. The combinational logic required in the state machine design is dependent on the state assignment. Types of state assignment Binary encoding: 2N states → N Flip-Flops Gray-code encoding: 2N states → N Flip-Flops One-hot encoding: N states → N Flip-Flops ECE Digital Electronics
4
FSM: State Assignment Example:
Design a FSM that detects a sequence of two or more consecutive ones on an input bit stream. The FSM should output a 1 when the sequence is detected, and a 0 otherwise. This is another example of a sequence detector. ECE Digital Electronics
5
ECE 301 - Digital Electronics
FSM: State Assignment Input: … Output: … ECE Digital Electronics
6
ECE 301 - Digital Electronics
FSM: State Assignment C z = 1 Reset B z = A w 1 S0 / 0 S1 / 0 S2 / 1 State Diagram ECE Digital Electronics
7
ECE 301 - Digital Electronics
FSM: State Assignment Present State Next State Output w = 0 w = 1 S0 S1 S2 1 State Table ECE Digital Electronics
8
FSM: State Assignment #1
State Assigned Table Present State Next State Output w = 0 w = 1 QA QB QA+ QB+ z S0 S1 1 S2 d Using Binary Encoding for the State Assignment ECE Digital Electronics
9
FSM: State Assignment #1
State Assigned Table Present State Next State FF Inputs w = 0 w = 1 QA QB QA+ QB+ DA DB S0 1 S1 S2 d Characteristic Equation: D = Q+ ECE Digital Electronics
10
FSM: State Assignment #1
ECE Digital Electronics
11
FSM: State Assignment #1
K-Map and Boolean expression for z ECE Digital Electronics
12
FSM: State Assignment #1
DA = w.(QA + QB) z A z = QA w B DB = w.QA'.QB' ECE Digital Electronics
13
FSM: State Assignment #2
State Assigned Table Present State Next State Output w = 0 w = 1 QA QB QA+ QB+ z S0 S1 1 S2 d Using Gray-code Encoding for the State Assignment ECE Digital Electronics
14
FSM: State Assignment #2
State Assigned Table Present State Next State FF Inputs w = 0 w = 1 QA QB QA+ QB+ DA DB S0 1 S1 S2 d Characteristic Equation: D = Q+ ECE Digital Electronics
15
FSM: State Assignment #2
K-Map and Boolean expression for DA, DB and z ECE Digital Electronics
16
FSM: State Assignment #2
D Q Y 2 1 w Clock z y Resetn A B DA = w.QB DB = w z = QA ECE Digital Electronics
17
FSM: State Assignment #3
State Assigned Table Present State Next State w = 0 w = 1 QA QB QC QA+ QB+ QC+ S0 1 S1 S2 For each state only one flip-flop is set to 1. The remaining combination of state variables are not used. Using One-hot Encoding for the State Assignment Characteristic Equation: D = Q+ ECE Digital Electronics
18
FSM: State Assignment #3
ECE Digital Electronics
19
FSM: State Assignment #3
Resetn D Q Clock DA = w.QC' z z = QA A B C DB = w.QC DC = w.' w ECE Digital Electronics
20
ECE 301 - Digital Electronics
State Minimization ECE Digital Electronics
21
FSM: State Minimization
Definition: Two states Si and Sj are said to be equivalent if and only if for every possible input sequence, the same output sequence will be produced regardless of whether Si or Sj is the initial state. ECE Digital Electronics
22
FSM: State Minimization
Definition: A partition consists of one or more blocks, where each block comprises a subset of states that may be equivalent, but the states in a given block are definitely not equivalent to the states in other blocks. ECE Digital Electronics
23
State Minimization: Partitioning
State Minimization through Partitioning: Form an initial partition (P1) that includes all states. Form a second partition (P2) by separating the states into two blocks based upon their output values. Form a third partition (P3) by separating the states into blocks corresponding to the next state values. Continue partitioning until two successive partitions are the same (i.e. PN-1 = PN). All states in any one block are equivalent. Equivalent states can be combined into a single state. ECE Digital Electronics
24
State Minimization: Partitioning
Example: Use partitioning to minimize the number of states in the following Finite State Machine (FSM). ECE Digital Electronics
25
State Minimization: Partitioning
F / 0 E / 0 D / 1 B / 1 C / 0 A / 1 State Diagram ECE Digital Electronics
26
State Minimization: Partitioning
Present Next state Output state w = 1 z A B C D F E G ECE Digital Electronics
27
State Minimization: Partitioning
Initial Partition: P1 = (ABCDEFG) The initial partition contains all states in the state diagram / table. ECE Digital Electronics
28
State Minimization: Partitioning
Separate states based on output value. P2 = (ABD)(CEFG) Present Next state Output state w = 1 z A B C D F E G ECE Digital Electronics
29
State Minimization: Partitioning
Separate states based on next state values. P3 = (ABD)(CEG)(F) ABD CEFG 1 1 BDB CFG FFEF ECDG unique state ECE Digital Electronics
30
State Minimization: Partitioning
Separate states based on next state values. P4 = (AD)(CEG)(F)(B) ABD CEG 1 1 BDB CFG FFF ECG unique states ECE Digital Electronics
31
State Minimization: Partitioning
Separate states based on next state values. P5 = (AD)(CEG)(F)(B) AD CEG 1 1 BB CG FFF ECG same as previous partition (P4) ECE Digital Electronics
32
State Minimization: Partitioning
Since P4 = P5, state minimization is complete. The equivalent states are: A = D C = E = G B F Thus, the FSM can be realized with just 4 states. ECE Digital Electronics
33
FSM: State Minimization
Present Next state Output state w = 1 z A B C F Minimized State Table ECE Digital Electronics
34
FSM: State Minimization
Minimized State Diagram ECE Digital Electronics
35
Acknowledgments The slides used in this lecture were taken, with permission, from those provided by McGraw-Hill for Fundamentals of Digital Logic with VHDL Design (3rd Edition). They are the property of and are copyrighted by McGraw-Hill Higher Education. ECE Digital Electronics
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.