Programs and State Machines
Program & FSM connection What is the connection between programs and finite state machines? P&SM–2
Program & FSM connection – 2 What is the connection between programs and finite state machines? The program control graph and its corresponding FSM are duals of each other Not standard graph definition of a dual Nodes become edges and vice-versa P&SM–3
Program & FSM connection – 3 Corresponding FSM Program Control In FSM actions Graph are on the edges P&SM–4
Communicating state machines State machines can influence each other A transition's action may cause an event in another machine A transition's guard may query the state of another machne P&SM–5
Communication example Control performs operations Display shows status Control Display P&SM–6
Communication example – 3 In each machine, considered independently, there are no unreachable states In Control can go from state A to state D and back again When considered together, the previous path is impossible Cannot go from state B to state D unless Display is in the Off state Control cannot be in state B unless Display is in the On state. Collectively machines can have unreachable states P&SM–7
Students & payment example Fence diagram time time P&SM–8
Recommend
More recommend