Moore and Mealy Machines
LIMITATION OFFINITE 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 AUTOMATAWITH 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
Moore and Mealy Machines• Both these machine types follow the basic characteristics of
state machines, but differ in the way that outputs are produced.
• Moore Machine:– Outputs are independent of the inputs, ie output is
associated with the state.• Mealy Machine:
– Outputs are determined by the present state and the present inputs, ie output is associated with Transition.
• These types of machines are known as Transducers(An automata capable of producing strings of symbols as output).
• In these we may be in any state even not in
final state if the string has been processed we will have output . Where as in NFA/DFA we have final states.
MOORE MACHINE
• Developed by E.F. Moore in 1956.• It is a finite automata machine with output• The output is associated with each state. Every
state of this machine has a fixed Output.• There is no concept of final state in Moore
machine.• It can be represented by Transition table as well
as Transition diagram.• It is a six tuple machine.
Moore Machine Diagrams
•The Moore State Machine output is shown inside thestate bubble, because the output remains the same aslong as the state machine remains in that state.
•The output can be arbitrarily complex but must be thesame every time the machine enters that state.
Moore Machine
• Describe Outputs as Concurrent Statements Depending on State
state 1/output
state 2/output
transition condition 1
transition condition 2
Moore Machine
• A Moore Machine is a 6-tuple (Q, , Δ,q0, , λ) where– Q is a finite set of states– is an input alphabet– Δ is an output alphabet– q0 Q is the initial state– : Q × → Q is a transition function– λ : is the output function mapping Q into Δ
MEALY MACHINE
• Independently developed by G.H. Mealy in1955• 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.
Mealy Machine Diagrams
The Mealy State Machine generates outputs based on:
The Present State, and The Inputs to the M/c.
So, it is capable of generating many different patterns of output signals for the same state, depending on the inputs present on the clock cycle.
Outputs are shown on transitions since they are determined in the same way as is the next state.
Mealy Machine
• Describe Outputs as Concurrent Statements Depending on State and Inputs
state 1 state 2
transition condition 1 /output 1
transition condition 2 /output 2
Mealy Machine• A Mealy Machine is a 6-tuple (Q, , Δ,q0, , λ)
where– Q is a finite set of states– is an input alphabet– Δ is an output alphabet– q0 Q is the initial state– : Q × → Q is a transition function– λ : is the output function mapping Q × →Δ
• In this total number of outputs is same as total number of inputs.
Moore FSM - Example 1
• Moore FSM that Recognizes Sequence 10
S0 / 0 S1 / 0 S2 / 1
00
0
1
11
reset
Meaning of states:
S0: No elements of the sequenceobserved
S1: “1”observed
S1: “10”observed
Mealy FSM - Example 1• Mealy FSM that Recognizes Sequence 10
S0 S1
0 / 0 1 / 0 1 / 0
0 / 1reset
Meaning of states:
S0: No elements of the sequenceobserved
S1: “1”observed