Micro-controllers-FSM –Finite State Machine-Tutorials and Examples-2

•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:

–Three states:
•Asleep
•Awake but still in bed
•Awake and up
–Inputs:
•Alarm
•Weekday (determines you how to react to alarm)
–Outputs:




•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) 



•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


•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.

Related

Mealy and Moore machines 3033306159623449195

Post a Comment

SPAMMING will not be Appreciated.

emo-but-icon

Hot in week

Recent

Comments

Our Channel

Contact Us

Name

Email *

Message *

Follow by Email

item