l5 – sequential circuit design. sequential circuit design mealy and moore characteristic...

18
L5 – Sequential Circuit Design

Upload: brian-newton

Post on 11-Jan-2016

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

L5 – Sequential Circuit Design

Page 2: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Sequential Circuit Design Mealy and Moore Characteristic Equations Design Procedure Example Sequential Problem – from

specification to implementation

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 2

Page 3: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Types of State Machines Mealy Machine

Characterized by – Outputs are a function of both inputs and current state.

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 3

NextStateLogic

OutputLogic

StateMemory

(F/F)

CLOCK

Inputs Excitation

CurrentState

Outputs

Page 4: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Types of State Machines Moore Machine

Characterized by – Outputs are a function of the current state only.

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 4

NextStateLogic

OutputLogic

StateMemory

(F/F)

CLOCK

Inputs Excitation

CurrentState

Outputs

Page 5: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Notes on Mealy and Moore Both Mealy and Moore machine

implementation can be implemented with any sequential element.

Why choose one elements over another? Efficiency – The next state logic may differ

significantly when using different F/F types. Efficiency of implementation is also drastically

affected by choice of state assignment.

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 5

Page 6: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

The characteristic equation The Characteristic Equation formally

specifies the flip-flop’s next state as a function of its current state and inputs

Q* means the next state value for the Q output of the F/F

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 6

Page 7: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Characteristic equations for F/Fs

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 7

S-R Latch D Latch D F/F D F/F with Enable J-K F/F T F/F

Q* = S + R’ Q Q* = D Q* = D Q* = EN D + EN’ Q Q* = J Q’ + K’ Q Q* = Q’

when T = 1

Page 8: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Summary of the Design Procedure 1. Given the problem statement, determine the relationship

between input and output. Understand the specification and or problem statement. Resolve any questions. Then generate a state graph and/or state table.

2. Reduce the state table to the minimum number of states. 3. From the number of state determine the number of flip-

flops (m states n flip-flops where m <= 2n) 4. Generate a transition table (current state – next state) 5. Use K-maps to derive flip-flop input equations. 6. Derive output functions and implement.

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 8

Page 9: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Example – problem statement Sequential Code Converter (16.2 example) Word description: Design a sequential circuit to

convert BCD to excess 3 code. The inputs arrive sequentially, lsb first, i.e. serial input stream. After 4 inputs the circuit resets to the initial state ready for another group of 4 inputs. The excess 3 code is output serially at the same time.

First question – is it possible to generate the output serially without delay?

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 9

Page 10: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Input – output table Input BCD – Output excess 3

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 10

Page 11: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Construct a state Graph Walk through the sequences

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 11

Page 12: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Build a state table From the State Graph can build the state table Note the relationship between the two

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 12

Page 13: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Then reduce the state table And just how is that done – (the coming

attraction) How many flip-flops are needed?

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 13

Page 14: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

What next? Choose state assignment Pick flip-flop of implementation – here D

F/Fs

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 14

Page 15: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Next state logic Logic to generate the next state is generated Use K-maps

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 15

Page 16: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

From there: implement the design D flip-flop implementation

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 16

Page 17: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Implementation with other F/Fs? Use the characteristic equation for generation

of the transition table. Say T flip-flops – example for T1

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 17

T1 = Q1' Q2' + Q1 Q2

Page 18: L5 – Sequential Circuit Design. Sequential Circuit Design  Mealy and Moore  Characteristic Equations  Design Procedure  Example Sequential Problem

Assignment See course web page

Spring 2014 – implement BCD to Excess 3 converter in a FPGA. HW2 – submit to dropbox.

9/2/2012 – ECE 3561 Lect 5

Copyright 2012 - Joanne DeGroat, ECE, OSU 18