Docsity

Sequential Logic Design: Finite State Machines and Their Applications, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Sequential Logic Design: Finite State Machines and Their Applications and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

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

Chapter 3 :: Topics

  • Synchronous Logic Design
  • Finite State Machines

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

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

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

George H. Mealy

  • Published A Method of Synthesizing Sequential

Circuits in 1955

  • Wrote the first Bell Labs operating system for the

IBM 704 computer

FSM Black Box

  • Inputs: CLK , Reset , T A

, T

B

  • Outputs: L A

, L

B T A T B L A L B CLK Reset Traffic Light Controller

FSM State Transition Diagram

  • Moore FSM: outputs labeled in each state
  • States: Circles
  • Transitions: Arcs S 0 L A : green L B : red S 1 L A : yellow L B : red S 3 L A : red LB : yellow S 2 L A : red LB : green TA T A T B T B Reset

FSM Encoded State Transition Table

S'

1 1

S

1 1 X X 0

1 X X 0

0 1 X 0

0 0 X 1

S'

0

T

B

T

A

S

0 Current State Inputs Next State S3 11

S2 10

S1 01

S0 00

State Encoding S' 1

= S

1

⊕ S

0 S' 0

= S

1

S

0

T

A

+ S

1

S

0

T

B

FSM Output Table

L

B 1 1

S

1 1 1 0 1

L

B 0

L

A 0

L

A 1

S

0 Current State Outputs red 10 yellow 01 green 00 Output Encoding L A 1

= S

1 L A 0

= S

1

S

0 L B 1

= S

1 L B 0

= S

1

S

0

FSM Schematic: Next State Logic

S 1 S 0 S' 1 S' 0 CLK next state logic state register Reset T A T B inputs S 1 S 0 r

FSM Schematic: Output Logic

S 1 S 0 S' 1 S' 0 CLK next state logic state register output logic Reset L A 1 L B 1 L B 0 L A 0 T A T B inputs outputs S 1 S 0 r

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

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!!!