Case study: Alarm State Machine

Building the machine

The states value will be stored in flipflops (each flipflop can be seen as a 1 bit memory).
This can be done in two way:

  • each flipflop will be assigned to a state
  • the flipflops will store the current state number expressed in binary

(The two circuits will be studied and built here)

We will just have to describe the conditions (using the inputs (Arm, Disarm, Intrusion, Time-Out), and the current state) to be in each state.



These conditions are the transition conditions and the stay conditions. To be in a state, you have to satisfy a transition condition and then a stay condition.




For this alarm, we have the following equations:


1 2.Disarm + 3.Disarm 1.Arm
2 1.Arm + 3.TimeOut 2.(Disarm.Intrusion)
3 2.Intrusion 3.(Disarm.TimeOut)


Hence, the complete conditions for each state:


12.Disarm + 3.Disarm + 1.Arm
21.Arm + 3.TimeOut + 2.(Disarm.Intrusion)
32.Intrusion + 3.(Disarm.TimeOut)


Logic is done and can be easely construct when each flipflop correspond to only one state.