Programs and State Machines Program & FSM connection What is - - PowerPoint PPT Presentation

programs and state machines program fsm connection
SMART_READER_LITE
LIVE PREVIEW

Programs and State Machines Program & FSM connection What is - - PowerPoint PPT Presentation

Programs and State Machines Program & FSM connection What is the connection between programs and finite state machines? P&SM2 Program & FSM connection 2 What is the connection between programs and finite state


slide-1
SLIDE 1

Programs and State Machines

slide-2
SLIDE 2

P&SM–2

Program & FSM connection

 What is the connection between programs and finite

state machines?

slide-3
SLIDE 3

P&SM–3

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

slide-4
SLIDE 4

P&SM–4

Program & FSM connection – 3

Program Control Graph Corresponding FSM In FSM actions are on the edges

slide-5
SLIDE 5

P&SM–5

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

slide-6
SLIDE 6

P&SM–6

Communication example

Control Display

Control performs operations Display shows status

slide-7
SLIDE 7

P&SM–7

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

slide-8
SLIDE 8

P&SM–8

Students & payment example

Fence diagram

time time