Finite State Machines - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Finite State Machines

Description:

Determine logic equations for all flip-flops and outputs. A ... with the inputs that cause them, unlabeled edges are unconditional transitions. show start state ... – PowerPoint PPT presentation

Number of Views:72
Avg rating:3.0/5.0
Slides: 16
Provided by: csCor
Category:

less

Transcript and Presenter's Notes

Title: Finite State Machines


1
Finite State Machines
  • Prof. Sirer
  • CS 316
  • Cornell University

2
Finite State Machines
  • An electronic machine which has
  • external inputs
  • externally visible outputs
  • internal state
  • Output and next state depend on
  • inputs
  • current state

3
Designing an FSM
  • Draw a state diagram
  • Write down state transition table
  • Assign numbers to states
  • Determine logic equations for all flip-flops and
    outputs

4
A Simple Example
  • Goal flash hello on LEDs
  • Inputs clock
  • Outputs Just one 7-segment LED
  • Flash h then e then l then l then o
  • h lt0011101gt
  • e lt0111110gt
  • l lt0010110gt
  • o lt1110111gt

5
HELLObox State Diagram
S0
S1
S2
S3
S4
lt0011101gt H
lt0111110gt E
lt0010110gt L
lt 0010110 gt L
lt1110111gt O
  • Determine the transitions
  • label all edges (transitions) with the inputs
    that cause them, unlabeled edges are
    unconditional transitions
  • show start state

6
HELLObox State Table
  • Build state table
  • rote encoding of the state diagram

7
HELLObox State Assignment 1
  • Assign bit patterns to states that would make the
    resulting device simple
  • One option is shown
  • Determine logic equations for every bit of output
    and next state, for every flip-flop and output

8
HELLObox 1
  • 12 bits of information (7 outputs 5 bits of
    next state) are computed by the combinatorial
    circuit
  • All 12 bits have non-trivial logic equations

combinational circuit
flip-flops
9
HELLObox State Assignment 2
  • Assign bit patterns to states that would make the
    resulting device simple
  • Here, we use far more bits than necessary
  • to simplify the combinatorial circuit

10
HELLObox 2
  • 15 bits of information (7 outputs 8 bits of
    next state) are computed by the combinatorial
    circuit
  • 8 bits have non-trivial logic equations
  • all 7 outputs are simple pass-throughs

combinational circuit
flip-flops
11
FSM Serial Adder
  • Add two input bit streams
  • streams are sent with least-significant-bit (lsb)
    first

10110
00101
01111
12
FSM State Diagram
00/1
00/0
S0
S1
11/1
11/0
10/1
01/1
10/0
01/0
  • Two states S0 (no carry), S1 (carry in hand)
  • Inputs a and b
  • Output z
  • Arcs labelled with input bits a and b, and output
    z

13
Serial Adder State Table
  • Write down all input and state combinations

14
Serial Adder State Assignment
  • Two states, so 1-bit is sufficient
  • A single flip-flop will encode the state

15
Serial Adder Circuit
a
  • Equations
  • z abs abs abs abs
  • s abs abs abs abs

z
combinational logic
b
s
s
Q
D
clk
Write a Comment
User Comments (0)
About PowerShow.com