Mealy and Moore Machine
• About Mealy Machine
• Formal Defination of Mealy Machine
• Construction of Mealy Machine
• About Moore Machine
• Formal Defination of Moore Machine
• Construction of Moore Machine
• Conversion Mealy to Moore Machine
• Conversion Moore to Mealy Machine
About Mealy Machine
• A Mealy machine is a type of finite-state machine where
the output is determined by both the current state and the
current input.
• We can see our input as well as output
• Every state gives its output
Formal Defination of Mealy Machine
• It can be described by a 6 tuple (Q, ∑, O, δ, X, q0) where −
– Q is a finite set of states.
– q0 is the initial state.
– ∑ is the input alphabet.
– O is the output alphabet.
– δ is the transition function which maps Q×∑ → Q.
– ‘λ’ is the output function that maps Q×∑→ O.
Example of Mealy Machine
Difference between DFA/NFA and Mealy/Moore Machine
DFA Mealy Machine
Construction of Mealy Machine
vConstruct a Mealy Machine that produces the 1’s
complement of any binary input string
1/0 We Know
10100
Start A 1’s -> 01011
0/1
v Construct a Mealy Machine that gives 2’s complement of any
binary input(Assume that the last carry bit is neglected
2’s complement = 1’scomplement + 1
0/0
0/1 10100 11100 11111
01011 00011 00000
1/1 +1 +1 +1
A B ______ ______ ______
01100 00100 00001
1/0
v Design a Mealy Machine accepting the language consisting
of strings from ꜫ={a,b} and the strings is either “aa” or “bb”
Assume
a/1 aa -1
B bb -1
a/0 other - 0
a/0 b/0
A
abaababb
00010001
b/0
C
b/1
About Moore Machine
• A Moore machine is a type of finite-state machine where the
output values are determined solely by the current state, not
by the input to the machine.
• It’s also give output with it’s input
Formal Defination of Moore Machine
• It can be described by a 6 tuple (Q, ∑, O, δ, X, q0) where
– Q is a finite set of states.
– q0 is the initial state.
– ∑ is the input alphabet.
– O is the output alphabet.
– δ is the transition function which maps Q×∑ → Q.
– λ is the output function which maps Q → O.
Example of Mealy Machine