Docsity

Sequential Logic Design - Digital Logic Design - Slides | ECEN 3233, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
Copyright © 2007 Elsevier <1>
Chapter 3 : Sequential Logic Design
Digital Logic Design
James E. Stine, Jr.
Portions of slides taken from Digital Design and Computer Architecture
D. M. Harris and S. L. Harris, Elsevier, 2007
Copyright © 2007 Elsevier <2>
Chapter 3 :: Topics
• Synchronous Logic Design
• Finite State Machines
Copyright © 2007 Elsevier <3>
Sequential Logic
• Sequential circuits: all circuits that aren’t combinational
• A problematic circuit:
• This circuit has no inputs and 1-3 outputs.
• It is an astable circuit that oscillates.
• Its period depends on the delay of the inverters – which
depends on the manufacturing process, temperature, etc.
• The circuit has a cyclic path: output fed back to input
X
Y
Z
time (ns)0 1 2 3 4 5 6 7 8
XYZ
Copyright © 2007 Elsevier <4>
Synchronous Sequential Logic Design
• Breaks cyclic paths by inserting registers
• These registers contain the state of the system
• The state changes at the clock edge, so we say the system is
synchronized to the clock
• Rules of synchronous sequential circuit composition:
– Every circuit element is either a register or a combinational circuit
– At least one circuit element is a register.
– All registers receive the same clock signal.
– Every cyclic path contains at least one register.
• Two common synchronous sequential circuits
– Finite state machines (FSMs)
– Pipelines
Copyright © 2007 Elsevier <5>
Finite State Machine (FSM)
• Consists of:
– State register that
• Store the current state and
• Load the next state at the clock edge
– Combinational logic that
• Computes the next state
• Computes the outputs
Next
State
Current
State
S’ S
CLK
C
L
Next State
Logic
Next
State
C
L
Output
Logic
Outputs
Copyright © 2007 Elsevier <6>
Finite State Machines (FSMs)
• Next state is determined by the current state and the inputs
• Two types of finite state machines differ in the output logic:
– Moore FSM: outputs depend only on the current state
– Mealy FSM: outputs depend on the current state and the inputs
CLK
MNk k
next
state
logic
output
logic
Moore FSM
CLK
MNk k
next
state
logic
output
logic
inputs
inputs
outputs
outputs
state
state
next
state
next
state
Mealy FSM
pf3
pf4

Partial preview of the text

Download Sequential Logic Design - Digital Logic Design - Slides | ECEN 3233 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Copyright © 2007 Elsevier < 1 >

Chapter 3 : Sequential Logic Design

Digital Logic Design

James E. Stine, Jr.

Portions of D. M. Harris and S. L. Harris, Elsevier, 2007 slides taken from Digital Design and Computer Architecture Copyright © 2007 Elsevier < 2 > Chapter 3 :: Topics

  • Synchronous Logic Design
  • Finite State Machines Copyright © 2007 Elsevier < 3 > Sequential Logic
  • Sequential circuits: all circuits that aren’t combinational
  • A problematic circuit:
  • This circuit has no inputs and 1-3 outputs.
  • It is an astable circuit that oscillates.
  • Its period depends on the delay of the inverters – which

depends on the manufacturing process, temperature, etc.

  • The circuit has a cyclic path : output fed back to input

X

Y

Z

0 1 2 3 4 5 6 7 8 time (ns) X Y Z Copyright © 2007 Elsevier < 4 > Synchronous Sequential Logic Design

  • Breaks cyclic paths by inserting registers
  • These registers contain the state of the system
  • The state changes at the clock edge, so we say the system is

synchronized to the clock

  • Rules of synchronous sequential circuit composition:
    • Every circuit element is either a register or a combinational circuit
    • At least one circuit element is a register.
    • All registers receive the same clock signal.
    • Every cyclic path contains at least one register.
  • Two common synchronous sequential circuits
    • Finite state machines (FSMs)
    • Pipelines Copyright © 2007 Elsevier < 5 > Finite State Machine (FSM)
  • Consists of:
  • State register that
  • Store the current state and
  • Load the next state at the clock edge
  • Combinational logic that
  • Computes the next state
  • Computes the outputs

Next

State

Current

State

S’ S

CLK

CL

Next State

Logic

Next

State

CL

Output

Logic

Outputs

Copyright © 2007 Elsevier < 6 > Finite State Machines (FSMs)

  • Next state is determined by the current state and the inputs
  • Two types of finite state machines differ in the output logic:
    • Moore FSM: outputs depend only on the current state
    • Mealy FSM: outputs depend on the current state and the inputs

CLK

M next k k N

s lotagtiec^ o luotgpiuct

Moore FSM

M CLK

snteaxtte k^ k N

logic o luotgpiuct

inputs

inputs

outputs

state outputs

n steaxtte state s^ nteaxtte

Mealy FSM

Copyright © 2007 Elsevier < 7 > Edward F. Moore, 1925 - 2003

  • Together with Mealy, developed automata theory , the mathematical underpinnings of state machines, at Bell Labs.
  • Not to be confused with Intel founder Gordon Moore
  • Published seminal article, Gedanken-experiments on Sequential Machines in 1956 Copyright © 2007 Elsevier < 8 > George H. Mealy
  • Published A Method of Synthesizing Sequential Circuits in 1955
  • Wrote the first Bell Labs operating system for the IBM 704 computer Copyright © 2007 Elsevier < 9 > Finite State Machine Example
  • Traffic light controller
  • Traffic sensors: TA , TB (TRUE when there’s traffic)
  • Lights: LA , LB

TA

LA

TA

LB

TB

TB

LA

LB

Duck Street McElroy

Modified to

be familiar to

OSU!

Road Copyright © 2007 Elsevier < 10 > FSM Black Box

  • Inputs: CLK , Reset , TA , TB
  • Outputs: LA , LB

TA

TB

LA

LB

CLK

Reset

Traffic

Light

Controller

Copyright © 2007 Elsevier < 11 > FSM State Transition Diagram

  • Moore FSM: outputs labeled in each state
  • States: Circles
  • Transitions: Arcs (^) S 0

LA : green

LB : red

S 1

LA : yellow

LB : red

S 3

LA : red

LB : yellow

S 2

LA : red

LB : green

TA

TA

TB

TB

Reset

Copyright © 2007 Elsevier < 12 > FSM State Transition Table

S3 X X S

S2 X 1 S

S2 X 0 S

S1 X X S

S0 1 X S

S0 0 X S

S TA TB S'

Next

Inputs State

Current

State

Copyright © 2007 Elsevier < 19 > FSM State Encoding

  • Binary encoding: i.e., for four states, 00, 01, 10, 11
  • One-hot encoding
    • One state bit per state
    • Only one state bit is HIGH at once
    • I.e., for four states, 0001, 0010, 0100, 1000
    • Requires more flip-flops
    • Often next state and output logic is simpler Copyright © 2007 Elsevier < 20 > Moore vs. Mealy FSM
  • Alyssa P. Hacker has a snail that crawls down a paper tape

with 1’s and 0’s on it. The snail smiles whenever the last four

digits it has crawled over are 1101. Design Moore and Mealy

FSMs of the snail’s brain.

Classic String Detector!!! Copyright © 2007 Elsevier < 21 > State Transition Diagrams reset Moore FSM S 00 S 01 S 02 S 03 S 14 0

reset S 0 S 1 S 2 S 3 0 / 0

1 / 0 1 / 0 0 / 0 1 /^1

Mealy FSM Mealy FSM: arcs indicate input/output