Finite State Machines - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Finite State Machines

Description:

the state of a system is a snapshot of all the relevant ... cell phone controls. 16. fsm.ppt 1-22-04. automatic door opener (at stores) 17. fsm.ppt 1-22-04 ... – PowerPoint PPT presentation

Number of Views:419
Avg rating:3.0/5.0
Slides: 21
Provided by: patpa
Category:
Tags: cell | finite | machines | phone | state

less

Transcript and Presenter's Notes

Title: Finite State Machines


1
Finite State Machines

2
state
  • the state of a system is a snapshot of all the
    relevant elements of the system at the moment the
    snapshot is taken
  • the state of a basketball game can be represented
    by...
  • number of points
  • time remaining
  • possession
  • fouls accumulated
  • the state of a tic-tac-toe game can be
    represented by...
  • the placement of Xs and Os on the board

3
state of a sequential lock
  • the round lock example has several different
    states
  • A - not open...
  • ...and no relevant operations have been performed
  • B - not open...
  • ...and the user has completed the R-13 operation
  • C - not open...
  • ...and the user has completed R-13, followed by
    L-22
  • D - open

4
a state diagram for the sequential lock
A - not open... B - not open... C - not open... D
- open
5
finite state machine (automaton)
  • a model of computation
  • states
  • start state
  • input alphabet
  • transition function to a next state
  • computation begins in start state with an input
    string
  • machine changes states depending on the
    transition function
  • many variants
  • Mealy outputs associated with transitions
  • Moore outputs associated with states
  • recognizer some states are accepting states

6
finite state machine another definition
  • a description of a system with the following
    components
  • a finite number of states
  • a finite number of inputs
  • a finite number of outputs
  • all state transitions are specified
  • cause of each output is specified
  • may be described by a state diagram
  • deterministic if exactly one transition for each
    given input and state
  • otherwise, non-deterministic
  • output is possibly misleading
  • I prefer to call them side effects
  • things that happen as a result of
  • making a particular transition
  • OR
  • entering a state and being in it (regardless of
    where you came from)

7
2-bit counter
  • count from 0 to 3
  • then wrap around to 0 and continue
  • can be shown as a state diagram
  • what causes a state change?
  • synchronous clock
  • asynchronous some less predictable event

8
traffic light
  • north-south may be green
  • then east-west must be red
  • north-south may be red
  • then east-west may be green
  • its not quite that simple
  • lets model it...

repeat
10 s
10 s
5 s
1 s
9
getting a degree
  • seek information
  • send application materials (all)
  • get accepted
  • show up
  • take courses
  • apply for matriculation (graduation)
  • receive degree
  • leave

is it deterministic?
10
cordless phone
  • talk
  • redial
  • memory
  • vol UP
  • vol DOWN
  • flash
  • digits(0..9), ,

11
device with buttons (PDA)
  • on/off
  • calendar
  • phone
  • up
  • down
  • memo
  • todo
  • hotsync

12
stairway light switch
  • two switches
  • one at bottom of stairs
  • one at top of stairs
  • both switches control the light
  • how does the control work?

13
washing machine or dryer controls
14
television controls
15
cell phone controls
16
automatic door opener (at stores)
17
elevator controls (inside and outside cars)
18
user interface of an editor
  • think of insert mode

19
user interface of a Word processor
  • what menus are available when?

20
the end
Write a Comment
User Comments (0)
About PowerShow.com