14
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Dr. Shi Dept. of Electrical and Computer Engineering

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

  • Upload
    eddy

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Dr. Shi Dept. of Electrical and Computer Engineering. STATE REDUCTION. Overview. Important to minimize the size of digital circuitry Analysis of state machines leads to a state table (or diagram) - PowerPoint PPT Presentation

Citation preview

Page 1: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS

DESIGN

Dr. Shi

Dept. of Electrical and Computer Engineering

Page 2: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

STATE REDUCTION

Page 3: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Overview Important to minimize the size of digital circuitry Analysis of state machines leads to a state table (or

diagram) In many cases reducing the number of states

reduces the number of gates and flops This is not true 100% of the time

In this course we attempt state reduction by examining the state table

Other, more advanced approaches, possible Reducing the number of states generally reduces

complexity.

Page 4: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

FSM Optimization State Reduction:

Motivation:

lower cost fewer flip-flops in one-

hot implementations possibly fewer flip-flops

in encoded implementations

more don’t cares in next state logic

fewer gates in next state logic

Simpler to design with extra states then reduce later.

Example: Odd parity checker

S0[0]

S1[1]

S2[0]

0

1

11

0

0

S0[0]

S1[1]

0

1

0

1

Page 5: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

State Reduction “Row Matching” is based on the state-transition table:• If two states

have the same output and both transition to the same next state and self-loop or both transition to each other

then they are equivalent.• Combine the equivalent states into a new renamed state.• Repeat until no more states are combined

NS outputPS x=0 x=1 S0 S0 S1 0 S1 S1 S2 1 S2 S2 S1 0

State Transition Table

Page 6: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

FSM Optimization Merge state S2 into

S0 Eliminate S2 New state machine

shows same I/O behavior

Example: Odd parity checker.

S0[0]

S1[1]

S2[0]

0

1

11

0

0

S0[0]

S1[1]

0

1

0

1

NS outputPS x=0 x=1 S0 S0 S1 0 S1 S1 S0 1

State Transition Table

Page 7: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Row Matching Example

NS outputPS x=0 x=1 x=0 x=1 a a b 0 0 b c d 0 0 c a d 0 0 d e f 0 1 e a f 0 1 f g f 0 1 g a f 0 1

State Transition Table

Page 8: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Row Matching Example NS outputPS x=0 x=1 x=0 x=1 a a b 0 0 b c d 0 0 c a d 0 0 d e f 0 1 e a f 0 1 f e f 0 1

NS outputPS x=0 x=1 x=0 x=1 a a b 0 0 b c d 0 0 c a d 0 0 d e d 0 1 e a d 0 1

Reduced State Transition Diagram

Page 9: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Partitioning Minimization (Moore)

Step 1: P1= (abcdefg) Step 2: P2=(abd)(cefg)

Step 3: (abd) 0-successors

(bdb) (abd) 1-successors

(cfg) (cefg) 0-successors

(ffef) (cefg) 1-successors

(ecdg) P3: (abd)(ceg)(f)

NS outputPS x=0 x=1 a b c 1 b d f 1 c f e 0 d b g 1 e f c 0 f e d 0 g f g 0

State Transition Table

Page 10: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Partitioning Minimization

Step 3: P3: (abd)(ceg)(f)

Step 4: (abd) 0-successors

(bdb) (abd) 1-successors

(cfg) b must be removed (ceg) 0-successors (fff) (ceg) 1-successors

(ecg) P4: (ad)(b)(ceg)(f)

NS outputPS x=0 x=1 a b c 1 b d f 1 c f e 0 d b g 1 e f c 0 f e d 0 g f g 0

State Transition Table

Page 11: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Partitioning Minimization

Step 4: P4: (ad)(b)(ceg)(f)

Step 5: (verify no change)

NS outputPS x=0 x=1 a b c 1 b a f 1 c f c 0 f c a 0

State Transition Table

Page 12: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

STATE ASSIGNMENT

Page 13: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Encoding State Variables

Option 1: Binary values000, 001, 010, 011, 100 …

Option 2: Gray code000, 001, 011, 010, 110 …

Option 3: One hot encodingOne bit for every stateOnly one bit is a one at a given timeFor a 5-state machine

00001, 00010, 00100, 01000, 10000

Page 14: ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN

Summary

Important to create smallest possible FSMs This course: use visual inspection method Often possible to reduce logic and flip flops State encoding is important

One-hot coding is popular for flip flop intensive designs.