Tuesday, 8 March 2011

Finite State Machines

A Finite State Machine:
  • This is a machine that consists of a fixed set of states.
  • Has a set of allowable inputs
  • Has a set of possible outputs the are dependant upon the current state
  • A FSM that has no outputs is a finite state automation
We can represent a FSM with finite state diagrams or state transistion tables.

A simple FSM would be a door. We can use:









To represent a state. you would put an arrow pointing to this if it was the starting state, or a smaller circle within it if it was the closed state(known as the accept state).


To represent a connector which shows the transistion between states.
You would write the transistion (input and output) on the connector.

So a basic door would have two states: Opened and Closed
and the inputs would be opening and closing              
So:
We can replace longer state names with: S1, S2, S3...  and then add a key to show what they are.
Also with some FSM we can add an output to each connector (this would go next to the input separated by a comma.

Decision Tables
This can be re written as pseudo
If X is greater than 6 AND Y is less than 7 OR Z is  equal to 3
Then  Output “Pass”
Else Output “Fail”



1 comment:

  1. Good summary - you missed the concept of having outputs as part of the transitions

    ReplyDelete