Notes On Logic Gates
Notes On Logic Gates
Scenario 1
2
3
1
2
4
3
5
5
6
8
7
8
9
Exam Question: Turing Machine 10
11
12
13
Specification:
A finite state machine (or FSM for short) is a computational model for a machine that is
always in a fixed state. Each finite state machine has a finite number of states and can
only ever be in one state at a point in time.
The state of a finite state machine will change depending on the current state and the input
data. If the input data is valid, the finite state machine will terminate in 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.
For example, the state transition diagram above has four states: S0, S1, S 2and S3. The
start state is S 0and S 3is an accepting state.
The transition functions are each represented by an arrow (the leading arrow merely
signifies the start state and does not represent a transition function).
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.
14
State Transition Tables
The transition function between S 0and S 1in the previous diagram could be described in
English as “If the finite state machine is in state S 0and the input is 1, move to state S1.”
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.
S0 1 S1
S0 0 S2
S1 1 S3
S1 0 S2
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.
Example - Parity
The machine has two states, one start state and one
accepting state.
S0 1 S1
S0 0 S0
S1 1 S0
S1 0 S1
2
3 17