Micro-controllers-FSM –Finite State Machine-Tutorials and Examples-2
http://ingenuitydias.blogspot.com/2014/03/micro-controllers-fsm-finite-state_26.html
•Events:
–Wake up at fixed time every day
–Weekends: you don’t need alarm, so you wake up, turn off the alarm and resume sleep
•FSM modelling this chain of events, with:
–Wake up at fixed time every day
–Weekends: you don’t need alarm, so you wake up, turn off the alarm and resume sleep
•FSM modelling this chain of events, with:
–Three states:
•Asleep
•Asleep
•Awake but still in bed
•Awake and up
–Inputs:
–Inputs:
•Alarm
•Weekday (determines you how to react to alarm)
–Outputs:
–Outputs:
•Turn off the alarm
Read:
Micro-controllers-FSM –Tutorials and Examples-1
More Links:
Mealy and Moore machines
Finite State Machine-Digital Electronics
Embedded programming-Micro controller based Systems
State tables:
Read:
Micro-controllers-FSM –Tutorials and Examples-1
More Links:
Mealy and Moore machines
Finite State Machine-Digital Electronics
Embedded programming-Micro controller based Systems
State tables:
•Similar to the truth table
•Doesn't contain the system clock when specifying its transitions (it is implicit that transitions occur only when allowed by clock)
•Doesn't contain the system clock when specifying its transitions (it is implicit that transitions occur only when allowed by clock)
•Unless different stated, all the transitions are occurring on the positive edge of the clock
Alarm clock state table
•When you are asleep and alarm goes on, you go from being asleep to being awaken in bed; you also turn off the alarm
•The next two rows encode your actions:
–You get up
–You go back to sleep
•This table doesn't cover what you wouldn't do…(i.e.. if you are asleep and the alarm doesn't go off, you remain asleep, etc..)
Alarm clock state table
–First row covers the situation you are asleep, the alarm doesn't go off and you remain asleep
–Last row covers the situation you are awake and up and you remain awake and up
–The third row covers the case you are already up and the alarm goes off. You turn it off and remain Awake in bed
State diagram
•Graphical representation of the state table
•Each state is represented by a circle vertex
•Each row of the state table is represented as a directed arc from present state vertex to the next state vertex
•In this diagram, the outputs are associated with the states
Alternative state diagram
•The outputs are associated with the arcs
–An output of 1 represents that “turn off the alarm” is Yes
–By convention , inputs which are don’t care and inactive outputs are not shown.
Alarm clock state table
•When you are asleep and alarm goes on, you go from being asleep to being awaken in bed; you also turn off the alarm
•The next two rows encode your actions:
–You get up
–You go back to sleep
•This table doesn't cover what you wouldn't do…(i.e.. if you are asleep and the alarm doesn't go off, you remain asleep, etc..)
Alarm clock state table
•Covers all the cases
–First row covers the situation you are asleep, the alarm doesn't go off and you remain asleep
–Last row covers the situation you are awake and up and you remain awake and up
–The third row covers the case you are already up and the alarm goes off. You turn it off and remain Awake in bed
State diagram
•Graphical representation of the state table
•Each state is represented by a circle vertex
•Each row of the state table is represented as a directed arc from present state vertex to the next state vertex
•In this diagram, the outputs are associated with the states
Alternative state diagram
•The outputs are associated with the arcs
–An output of 1 represents that “turn off the alarm” is Yes
–By convention , inputs which are don’t care and inactive outputs are not shown.