Lecture 7-8 - Mealy Moore Machines - II
Lecture 7-8 - Mealy Moore Machines - II
Moore Machines
Mealy Machines
2
INTRODUCTION
o Finite automata may have outputs
corresponding to each transition.
1. Moore Machine
2. Mealy Machine
3
INTRODUCTION
FA with Output
4
MOORE MACHINE VS. MEALY MACHINE
5
MOORE MACHINE
6
MOORE MACHINE
Moore machine is an FSM whose outputs depend on only
the present state.
It can be described by a 6 tuple (Q, ∑, O, δ, X, q0)
where −
Q is a finite set of states.
∑ is a finite set of symbols called the input alphabet.
O is a finite set of symbols called the output alphabet.
δ is the input transition function where δ: Q × ∑ → Q
X is the output transition function where X: Q → O
7
X: Q → O
𝑝1 → 1
𝑝2 → 0 8
MOORE MACHINE
Example
𝑝1 → 1 𝑝2 → 0
Input String: ab
Input 𝒂 𝒃
States
𝑝1 𝑝1 𝑝2
1 1 0
9
Output
MOORE MACHINE
In Moore Machine if the string of length is ‘n’ as an
input, then the output produced will be a string of
length ‘n+1’
n → (n+1)
Example:
Input String: ab
Output String: 110
10
MEALY MACHINE
11
MEALY MACHINE
A Mealy Machine is an FSM whose output depends on the
present state as well as the present input.
It can be described by a 6 tuple (Q, ∑, O, δ, X, q0)
where −
Q is a finite set of states.
∑ is a finite set of symbols called the input alphabet.
O is a finite set of symbols called the output alphabet.
δ is the input transition function where δ: Q × ∑ → Q
X is the output transition function where X: Q × ∑ → O
12
X: Q × ∑ → O
(𝑝1 × a) → 1 (𝑝1 × b) → 0 13
MEALY MACHINE
(𝑝1 × a) → 1
(𝑝1 × b) → 0
(𝑝2 × a) → 1
(𝑝2 × b) → 0
14
MEALY MACHINE
Example
Input String: ab
Input 𝒂 𝒃
States
𝑝1 𝑝1 𝑝2
Output
1 0 15
MEALY MACHINE
In Mealy Machine, if the string of length is ‘n’ as an
input, then the output produced will be a string of
length ‘n’
n→n
Example:
Input String: ab
Output String: 10
16