0% found this document useful (0 votes)
71 views4 pages

4.2. Finite State Machines (FSMS)

This document discusses finite state machines (FSMs) including: 1) FSMs are models that have a fixed set of states, can only be in one state at a time, and transition between states based on input data or transition rules. 2) State transition diagrams are used to visually represent FSMs as states connected by transitions, with an accepting state indicated by a double circle. 3) State transition tables formally describe the transition functions between states with columns for current state, input, and next state.

Uploaded by

Christine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views4 pages

4.2. Finite State Machines (FSMS)

This document discusses finite state machines (FSMs) including: 1) FSMs are models that have a fixed set of states, can only be in one state at a time, and transition between states based on input data or transition rules. 2) State transition diagrams are used to visually represent FSMs as states connected by transitions, with an accepting state indicated by a double circle. 3) State transition tables formally describe the transition functions between states with columns for current state, input, and next state.

Uploaded by

Christine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

AQA Computer Science AS Level

3.4.2 Finite state machines (FSMs)


Intermediate Notes

www.pmt.education
Specification:

3.4.2.1 Finite state machines (FSMs) without output:


Be able to draw and interpret simple state transition diagrams and state
transition tables for FSMs with no output.

www.pmt.education
Finite State Machines

A finite state machine (or FSM for short) is a ​model​ for a machine that is ​always in a fixed
state​. Each finite state machine has a ​set number of states ​and can ​only ever be in one
state​ at once.

Data can be input to a finite state machine and if the input data is valid, the finite state
machine will terminate in what’s known as an ​accepting state​.

A finite state machine’s state ​can change​ and does so according to​ transition rules​, rules
that describe what a finite state machine should do given certain criteria.

State Transition Diagrams

State transition diagrams are used by computer scientists as a ​visual representation​ of a


finite state machine. They consist of ​states ​(circles) joined by ​transitions ​(arrows) and an
accepting state​, shown as a ​double circle​.

For example, the state transition diagram above has ​four states​: S​0​, S​1​, S​2​ and S​3​. S​3​ is an
accepting state.

The​ transition functions ​are each represented by an ​arrow ​from one state to another.

The finite state machine represented by the state transition diagram will ​only accept​ input
data that starts with ​11​
. For example: ​11​
, ​110​
, ​11101​and ​11001100.

www.pmt.education
State Transition Tables

The ​transition function​ between S​0​ and S​1​ in the previous diagram could be described in
English as “​If the finite state machine is in state S​0​ and the input is 1, move to state S​1.​ ​”

The transition functions in a finite state machine can be notated more formally using a
state transition table​, with columns for current state, input and next state, like the one
below.

Current State Input Next State

S​0 1 S​1

S​0 0 S​2

S​1 1 S​3

S​1 0 S​2

Example - Parking Machine

The finite state machine shown by the state transition diagram below represents a parking
machine which requires 50p to be payed. The machine is only designed to take coins
worth 10p or more.

If the customer first pays 10p, the machine moves into the 10p state, from which the
customer can input another 10p or 20p. The 50p state is the accepting state.

www.pmt.education

You might also like