Template

     Y12 - Unit 2 - Problem Solving
     Topic 6: Finite State Machines
Key Vocabulary:
Finite
State
Transition
Automaton
Start State
Accept State
End State
In this lesson, you will
  • Understand what is meant by a finite state machine
  • List some of the uses of a finite state machine
  • Draw and interpret simple state transition diagrams for finite state machines with no output
  • Draw a state transition table for a finite state machine with no output


1 / 32
suivant
Slide 1: Diapositive
Computer ScienceLower Secondary (Key Stage 3)

Cette leçon contient 32 diapositives, avec quiz interactifs et diapositives de texte.

time-iconLa durée de la leçon est: 60 min

Éléments de cette leçon

     Y12 - Unit 2 - Problem Solving
     Topic 6: Finite State Machines
Key Vocabulary:
Finite
State
Transition
Automaton
Start State
Accept State
End State
In this lesson, you will
  • Understand what is meant by a finite state machine
  • List some of the uses of a finite state machine
  • Draw and interpret simple state transition diagrams for finite state machines with no output
  • Draw a state transition table for a finite state machine with no output


Slide 1 - Diapositive

     
     What is a finite state machine?
  • It is not a “machine” in the sense of some physical, mechanical thing with moving parts
  • It is an abstract representation of how something changes from one state to another in response to a condition or event

Slide 2 - Diapositive


     In a finite state machine (FSM):

  • The machine can only be in one state at a time
  • It can change from one state to another in response to an event or condition; this is called a transition
  • The FSM is defined by a list of its states and the conditions for each transition
  • There can be outputs linked to the FSM’s state, but we will be considering only FSMs with no output

Slide 3 - Diapositive


     Example: a turnstile

  • A turnstile is used to control access to a railway platform
  • It can be in one of two states: locked or unlocked
  • Inserting a ticket unlocks the turnstile, allowing a single customer to pass through
  • The arms are locked again until another ticket is inserted

Slide 4 - Diapositive


     FSM representing a turnstile

  • Pushing the arm when the turnstile is in the locked state has no effect
  • Putting another ticket in when in the unlocked state also has no effect

Slide 5 - Diapositive


     FSM representing a turnstile

  • Suppose the turnstile will not accept any ticket – it has to be a valid one for the journey
  • Can you draw a new state transition diagram with two extra inputs: valid ticket and invalid ticket?
  • There will be a third state – ticket inserted

Slide 6 - Diapositive


     FSM representing a turnstile

Slide 7 - Diapositive


     Applications of FSMs

  • Robotics
  • Video games industry
  • Design of digital hardware systems
  • Design of compilers and network protocols
  • Definition of languages, and to decide whether a particular word is allowed in a language

Slide 8 - Diapositive


     Finite state automaton


  • A FSM which has no output is known as a finite state automaton
  • It has a start state and a set of end or accept states
  • If the automaton can reach a final state, it is said to accept the input
  • Starting in an initial state, the automaton processes a sequence of symbols and follows it to the target state
  • The symbols depend on the application – they usually represent events

Slide 9 - Diapositive


     Notation


Slide 10 - Diapositive


     Recognising a language



  • A finite state system accepts a string



     if there is a path from the start state to the end or accept state labelled by         the symbols C1, …., Cn

  • The language recognised by the FSM consists of all strings accepted by it.

Slide 11 - Diapositive


     Applications of FSMs

  • Which of the following strings will be accepted by this finite state automaton?

 aaac  badc  adadbd  ac  bdaac  bd


Slide 12 - Diapositive


Slide 13 - Question ouverte


     Worksheet 6



  • Now try the questions in Task 1 of Worksheet 6

Slide 14 - Diapositive


     Worksheet 6

  • Now try the questions in Task 1 of Worksheet 6

Slide 15 - Diapositive


Slide 16 - Question ouverte


     Worksheet 6

  • Now try the questions in Task 1 of Worksheet 6

Slide 17 - Diapositive


Slide 18 - Question ouverte


     Worksheet 6

  • Now try the questions in Task 1 of Worksheet 6

Slide 19 - Diapositive


     State transition tables


  • An alternative representation of a FSM is a State Transition Table
  • The FSM below accepts two inputs a and b
  • The transition table shows what the next state is for any input. What strings does it accept?

Slide 20 - Diapositive


     Example



  • Complete the transition table for the FSM shown
  • Which of the following strings are accepted?

Slide 21 - Diapositive


Slide 22 - Question ouverte


     Worksheet 6



  • Now try the questions in Task 2 of Worksheet 6

Slide 23 - Diapositive


     Worksheet 6



  • Now try the questions in Task 2 of Worksheet 6

Slide 24 - Diapositive


Slide 25 - Question ouverte


     Worksheet 6

  • Now try the questions in Task 2 of Worksheet 6

Slide 26 - Diapositive


     Worksheet 6



  • Now try the questions in Task 2 of Worksheet 6

Slide 27 - Diapositive


Slide 28 - Question ouverte


     Worksheet 6



  • Now try the questions in Task 2 of Worksheet 6

Slide 29 - Diapositive


Slide 30 - Question ouverte


     How NES Games Use State Machines For Everything



Slide 31 - Diapositive

     Y12 - Unit 2 - Problem Solving
     Topic 6: Finite State Machines

Slide 32 - Diapositive