exercise: designing finite state machines · 2016. 1. 22. · exercise: designing finite state...

Post on 28-Jan-2021

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

  • Exercise: Designing Finite State Machines Activity sheet to support Tenderfoot Unit 5: Theoretical Computers

    Source: Ideas and resources from Maths Maniacs www.mathmaniacs.org

    Hair Dryer: Airhead 2020

    Let's design a finite state machine that models the behaviour of a hair dryer - the top of the range Airhead 2020!

    Here are the specifications:

    Inputs: The inputs to the hair blower can be thought of as moving the switches in a given direction. So, we would have 4 inputs: Slide the left button up (let's call this "L-up"), slide the left button down (L-down), and similarly for R-up and R-down.

    Outputs: The machine is slightly different to the ones developed in the Fickle Fruit activites. The fruit activities had a singular output (a banana or apple) in response to an input request. We labelled the output on the transition, paired with the input.

    Here, the button will cause, say, air to be out-put, but not just one "chunk" of air. Instead, it makes more sense to think of the machine as being "in a continuous state of blowing air", until another input is received.

    We will therefore have NO outputs, but instead label the states to indicate what the hair blower is doing at any given time.

    States: As explained, the states of the machine should reflect exactly what the hair blower is doing at a given time. Thus, there would be one state called "blowing cool air fast", another one for "blowing hot air slow" and so on.

    Hint: make a state for each possible arrangement of the switches.

    Transitions: The machine should behave as you suspect. For example, if it was blowing cool air fast, and the input R-down were received, then it should next be in the state of blowing cool air slow.

    Note: In the state shown, if L-down were received, then since there is nothing cooler than "cool", the machine's behaviour would not change - it would stay in the same state. This would be like trying to force the button down further than it can go. (Or perhaps we could add a state for "broken"?).

    On the reverse side, or on a separate piece of paper, draw a state diagram for the Airhead

    2020

top related