Docsity

Finite State Machine Optimization - Advanced Digital Design - Lecture Slides, Slides of Digital Systems Design

Partial preview of the text

Download Finite State Machine Optimization - Advanced Digital Design - Lecture Slides and more Slides Digital Systems Design in PDF only on Docsity!

Lecture 11

Finite State Machine Optimization

Outline

• Motivation for FSM Optimization

• State Minimization Algorithms

– Row Matching Method

– Implicit Chart Method

• State Assignment Algorithms

– Heuristic manual assignment

– One-hot encoding

• READING: Katz 9.1, 9.2.1, 9.2.2, 9.3 Dewey 9.3,

Motivation for State Reduction

Odd Parity Checker: two alternative state diagrams

**- Identical output behavior on all input strings

  • FSMs are** equivalent **, but require different implementation
  • Design state diagram without concern for # of states,** Reduce later 0 S [0] S [1] S [0] 1 S [0] S [1] 0 1 1 0 0 0 (^11)

Motivation for State Reduction

Implement FSM with fewest possible states

• Least number of flipflops

• Boundaries are power of two number of states

• Fewest states usually leads to more opportunities

for don't cares

• Reduce the number of gates needed for

implementation

Row Matching Method

Example FSM Specification: Single input X, output Z Taking inputs grouped four at a time, output 1 if last four inputs were the string 1010 or 0110 Example I/O Behavior: X = 0010 0110 1100 1010 0011... Z = 0000 0001 0000 0001 0000... Upper bound on FSM complexity: Fifteen states (1 + 2 + 4 + 8) Thirty transitions (2 + 4 + 8 + 16) sufficient to recognize any binary string of length four!

Row Matching Method

State Diagram for Example FSM:

Row Matching Method

Initial State Transition Table: Present State S 0 S 1 S 2 S 3 S 4 S 5 S 6 S 7 S 8 S 9 S 10 S 11 S 12 S 13 S 14 Input Sequence Reset 0 1 00 01 10 11 000 001 010 011 100 101 110 111

X=

X=

S 1 S 3 S 5 S 7 S 9 S

11 S 13 S 0 S 0 S 0 S 0 S 0 S 0 S 0 S 0

X=

S 2 S 4 S 6 S 8 S

10 S 12 S 14 S 0 S 0 S 0 S 0 S 0 S 0 S 0 S 0

X=

Next State Output

Row Matching Method

Present State S 0 S 1 S 2 S 3 S 4 S 5 S 6 S 7 S 8 S 9 S' 10 S 11 S 13 S 14 Input Sequence Reset 0 1 00 01 10 11 000 001 010 01 1 or 101 100 110 111 Next State X=0 X= S 1 S 3 S 5 S 7 S 9 S 11 S 13 S 0 S 0 S 0 S 0 S 0 S 0 S 0

S 2 S 4 S 6 S 8

S'

10 S' 10 S 14 S 0 S 0 S 0 S 0 S 0 S 0 S 0

X=

X=

Output

Row Matching Method

Present State S 0 S 1 S 2 S 3 S 4 S 5 S 6 S 7 ' S' 10 Input Sequence Reset 0 1 00 01 10 11 not (011 or 101) 01 1 or 101

X=

S 1 S 3 S 5 S 0 S 0

X=

S 2 S 4 S 6 S 0 S 0

X=

X=

Next State Output S 7

S

7

S

7

S

7

S

7

S'

10 S' 10 S 7

Row Matching Method

Present State S 0 S 1 S 2 S 3 S 4 S 5 S 6 S 7 ' S' 10 Input Sequence Reset 0 1 00 01 10 11 not (011 or 101) 01 1 or 101

X=

S 1 S 3 S 5 S 0 S 0

X=

S 2 S 4 S 6 S 0 S 0

X=

X=

Next State Output S 7

S

7

S

7

S

7

S

7

S'

10 S' 10 S 7

Critique of Row Matching

**- Straightforward to understand and easy to implement

  • Problem: does not allows yield the most reduced state table! Example: 3 State Odd Parity Checker No way to combine states S0 and S based on Next State Criterion!** Present State S 0 S 1 S 2 Next State X= S 0 S 1 S 2 X= S 1 S 2 S 1 Output 0 1 0

State Reduction by Implicant Charts

New example FSM: Single input X, Single output Z Output a 1 whenever the serial sequence 010 or 110 has been observed at the inputs State transition table: Present State S 0 S 1 S 2 S 3 S 4 S 5 S 6 Input Sequence Reset 0 1 00 01 10 11

X=

Next State Output X= S 1 S 3 S 5 S 0 S 0 S 0 S 0

X=

S 2 S 4 S 6 S 0 S 0 S 0 S 0

X=

Implication Chart Method

Filling in the Implication Chart Entry Xij — Row is Si, Column is Sj Si is equivalent to Sj if outputs are the same and next states are equivalent Xij contains the next states of Si, Sj which must be equivalent if Si and Sj are equivalent If Si, Sj have different output behavior, then Xij is crossed out Example: S0 transitions to S1 on 0, S2 on 1; S1 transitions to S3 on 0, S4 on 1; So square X<0,1> contains entries S1-S3 (transition on zero) S2-S4 (transition on one) S1-S S2-S S S

Implication Chart Method

have different I/O behavior This implies that S1 and S0 cannot

 - 0/0 1/ Reset - 0/0 1/0 0/0 1/ 
  • 0/0 1/0 0/0 1/0 0/0 1/0 0/0 1/
  • 0/0 1/0 0/ - 0/ - 1/0 1/ - 0/ - 1/ - 1/ - 0/ - 0/ - 1/ - 1/ - 0/ - 0/1 1/ - S2 and S Starting Implication Chart
  • S be combined
  • S
  • S
  • S
  • S
  • S - S0 S1 S2 S3 S4 S
    • S1-S
    • S2-S
    • S1-S
    • S2-S - S3-S - S4-S
    • S1-S
    • S2-S - S3-S - S4-S - S5-S - S6-S
    • S1-S
    • S2-S - S3-S - S4-S - S5-S - S6-S - S0-S - S0-S - S0-S - S0-S