Professional Documents
Culture Documents
Fdocuments - in - Moore Mealy Machine
Fdocuments - in - Moore Mealy Machine
MACHINE
COMPILED BY
ASHWIN PRAKASH SRIVASTAVA
2ND IT
234/05
LIMITATION OF
FINITE AUTOMATA MACHINES
One limitation of the FINITE AUTOMATA is that
output is limited to a binary signal TRUE(1) or
FALSE(0) depending on the basis of reachability of the
final state by the initial state. The only explicit task a
machine has done so far is to recognize a language
whereas computers can perform calculations and convey
the result i.e. provide OUTPUT.
FINITE AUTOMATA
WITH OUTPUT
Moore and Mealy machines remove this limitation and
provide output. They are FINITE AUTOMATA
MACHINE with OUTPUT.
For example We simply want to print out a copy of the
input string.
DIFFERENCE BETWEEN
MEALY AND MOORE
MACHINES
In Mealy machine output function Z(t) depends on both the
present state q(t) and the present input x(t).
q2 q2 q3 0
q3 q3 q0 0
VALUES OF
Q, Σ, Δ
Q = {q0 , q1 , q2 , q3 }
Σ={0,1}
Δ={0,1}
λ(q0) = 0 , λ(q1) = 1 , λ(q2) = 0 , λ(q3) = 0
TRANSITION DIAGRAM
0 1
1
q0 q1 0
0
1
1 0
0
1
0
q2 q3
0 0
PROCESSING OF STRING
THROUGH
MOORE MACHINE
Let the input string be w = 0111 and Output string will
be єw’ = 00010.
0 0 0 1 0
є 0 1 1 1
q0 q3 q0 q1 q2
|w| = 4
|w’| = 5
0 1
a
q1 q3
a a
b
b
0 b 0
q0 q2
b
a
aaabbbaabaa
0 0 0 0 1
a a a b
q0 q1 q2 q2 q3
b
0 0 0 0 1
b a a b
q0 qo q1 q2 q3
a
0 0
q1 a q2
000010000100
RESULT
The occurrence of 1’s in the output string is 2 so the
number of times “aab” appears in the input string is 2.
MEALY MACHINE
Independently developed by G.H. Mealy in 1955
Output is associated with each transition.
Output is fixed for a particular input symbol.
It can be represented by Transition table as well as
Transition diagram.
It is a six tuple machine.
MATHEMATICAL REPRESENTATION
M = (Q , Σ , λ , Δ , qo , δ)
Q = A nonempty finite set of state in M.
Σ = A nonempty finite set of input symbols.
Δ = A nonempty finite set of outputs.
δ = It is a transition function which takes two arguments input
state and input symbol.
qo = Initial state of M.
λ = It is a mapping function which maps Q * Σ to Δ giving output
associated with each transition.
REPRESENTATION OF
MEALY MACHINE
Let M be a Mealy machine and a1 , a2 , a3 , …….a n be
input symbols where n>0 then output of M is λ(q0 , a1) ,
λ(q1 , a2) λ(q2 , a3) λ(q3 , a4) λ(q4 , a5)………… λ(qn - 1 , an),
such that
δ(qi – 1 , ai ) = qi for 1<i<n.
EXAMPLE OF
MEALY MACHINE
TRANSITION TABLE
Present state Input a=0 Input a=1
State output State output
q1 q3 0 q2 0
q2 q1 1 q4 1
q3 q2 1 q1 0
q4 q4 1 q3 0
Values of
Q , Σ, Δ
Q = { q1 , q2 , q3 , q4 }
Σ={0,1}
Δ={0,1}
λ(q1 , 0) = 0 , λ(q2 , 0) = 1 , λ(q3 , 0) = 1 , λ(q4 , 0) = 1
λ(q1 , 1) = 0 , λ(q2 , 1) = 0 , λ(q3 , 1) = 1 , λ(q4 , 1) = 0
TRANSITION DIAGRAM
0/1
q1 q2
1/0
q3 1/0
q4 0/1
PROCESSING OF STRING
THROUGH
MEALY MACHINE
Let the input string be w = 0111 and Output string will
be w’ = 0100.
|w| = 4
|w’| = 4
TRANSFORMING A MOORE MACHINE INTO
A MEALY MACHINE
P
b d
q1
a/P
c
d
MOORE
MACHINE
b/P q1
MEALY
c/P MACHINE
EXAMPLE
1
q1
a a
0 1
q0 b q3 a/b
b b
q2 0
a
MOORE MACHINE
CONVERT INTO MEALY MACHINE
q1
a/1 a/1
b/0 b/1
q2
a/0
MEALY MACHINE
TRANSFORMING A MEALY MACHINE INTO
A MOORE MACHINE
b/0
a/0 a/1
b/1 b/1
q1
MEALY MACHINE
b
0 1 a/1
a/1
q11 q12
a b/1 b b/1
MOORE MACHINE
EXAMPLE
b/1
q1
a/0 a/1
a/1
q0 q2 b/0
b/0
b/1
a/0
q3
MEALY MACHINE
MOORE MACHINE
b 1 a
q1
a a
0
a
0 q01 q21 b
a a
b b
1
q02 b
q3 0
b q22
a
1
THANK
YOU