0% found this document useful (0 votes)
54 views13 pages

Moore and Mealy

Uploaded by

ridhikatomar125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views13 pages

Moore and Mealy

Uploaded by

ridhikatomar125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

FA with output

FA with output
• Finite automata may have outputs corresponding to each
transition. There are two types of finite state machines that
generate output −
• Mealy Machine
• Moore machine
Moore Machine

• Moore machine is an FSM whose outputs depend on only the present


state.
• A Moore machine 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
• q0 is the initial state from where any input is processed (q0 ∈ Q).
• is the output transition function where : Q → O
Example
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
• q0 is the initial state from where any input is processed (q 0 ∈ Q).
• is the output transition function where : Q × ∑ → O
Example
Mealy Machine Moore Machine
Output depends both upon the Output depends only upon the
present state and the present present state.
input
Generally, it has fewer states Generally, it has more states
than Moore Machine. than Mealy Machine.
The value of the output The value of the output
function is a function of the function is a function of the
transitions and the changes, current state and the changes at
when the input logic on the the clock edges, whenever state
present state is done. changes occur.
Mealy machines react faster to In Moore machines, more logic
inputs. They generally react in is required to decode the
the same clock cycle. outputs resulting in more
circuit delays. They generally
react one clock cycle later.
Question-1
Construct a Moore machine that takes set of all strings over { a, b} as
input and prints 1 as output for every occurrence of ‘ab’ as a substring.
Question-2
Construct a Moore machine that takes set of all strings over { a, b} as
input and counts the occurrences of substring ‘baa’.
Question-3
Construct a Moore machine that takes set of all strings over { a, b} as
input and produces ‘A’ as output if input ends with ‘10’ , ‘B’ as output if
input ends with ’11’, otherwise outputs ‘C’
Question-4
• Construct a Moore machine that determines whether an input
string contains an even or odd number of 1's. The machine
should give 1 as output if an even number of 1's are in the
string and 0 otherwise.
Solution-1
Question-5
• Design a Moore machine for a binary input sequence such
that if it has a substring 101, the machine output A, if the
input has substring 110, it outputs B otherwise it outputs C.
Solution
Mealy Questions
Question-1
Construct a Mealy machine that takes set of all strings over { a, b} as
input and prints 1 as output for every occurrence of ‘ab’ as a substring.
Question-2
Construct a Moore machine that takes set of all strings over { a, b} as
input and counts the occurrences of substring ‘baa’.

You might also like