11
The Phone A simple example of a finite state machine Ken Johnson

The phone is an example of a finite state machine

Embed Size (px)

DESCRIPTION

This slide set is a short presentation that helps give the idea of a finite state machine. The phone is an example of a finite state machine. It has state, and events transition it from one state to another.

Citation preview

Page 1: The phone is an example of a finite state machine

The Phone

A simple example of a finite state machineKen Johnson

Page 2: The phone is an example of a finite state machine

Waiting

The phone is idle and waiting for something to do

Page 3: The phone is an example of a finite state machine

Waiting

Dialling

Event: Start calling

You start to phone someone

Page 4: The phone is an example of a finite state machine

Waiting

Dialling Wait for answer

Event: Start calling

λ

You dial a number and start waiting for someone to answer the remote phone

Page 5: The phone is an example of a finite state machine

Waiting

Dialling Wait for answer

Conversation

Event: Start calling

Event: Pick up

λ

Someone answers the remote phone and you talk to him (her)

Page 6: The phone is an example of a finite state machine

Waiting

Dialling Wait for answer

Conversation

Event: Hang up

Event: Start calling

Event: Pick up

λ

You finish your conversation and hang up

Page 7: The phone is an example of a finite state machine

Waiting

Dialling Wait for answer

Conversation

Event: Hang up

Time out

Event: Start calling

Event: Pick up

λ

If nobody answers the remote phone, you hang up and the phone becomes idle again

Page 8: The phone is an example of a finite state machine

Waiting

Ringing

Dialling Wait for answer

Conversation

Event: Hang up

Time out

Event: Incoming call

Event: Start calling

Event: Pick up

λ

If there is an incoming call then the phone starts to ring

Page 9: The phone is an example of a finite state machine

Waiting

Ringing

Dialling

Conversation

Wait for answer

Conversation

Event: Hang up

Time out

Event: Answered

Event: Incoming call

Event: Start calling

Event: Pick up

λ

If you answer the phone then you can talk to the remote person

Page 10: The phone is an example of a finite state machine

Waiting

Ringing

Dialling

Conversation

Wait for answer

Conversation

Event: Hang up

Time out

Event: Answered

Event: Incoming call

Event: Start calling

Event: Pick up

Event: Hang up

λ

You hang up when you finish talking and the phone becomes idle again

Page 11: The phone is an example of a finite state machine

Waiting

Ringing

Dialling

Conversation

Wait for answer

Conversation

Event: Hang up

Time out

Event: Answered

Event: Incoming call

Event: Start calling

Event: Pick up

Event: Hang up

λ

If nobody answers a ringing phone it will go back into an idle state

Time out