SlideShare a Scribd company logo
Finite state Machines with
            output


Moore and Mealy machines




                              1
Moore Machine           output is associated with
                     states

A Moore machine is a six tuple
(Q , Σ, ∆, δ, λ, q0)
∆ : Is the output alphabet
λ : I s a mapping from Q to ∆ giving output
       associated with each state.
Output in response to input a1 a2 …an is
λ(q0) λ(q1) λ(q2)… λ(qn)

Where q0, q1,…qn is the sequence of states such
 that δ (qi-1,ai) = qi
                        STRING LENGTH
                                                     2
                        N+1
Note
Any Moore machine gives output

λ(q0) in response to input - empty
                                 string




                                          3
DFA may be viewed as a special case of
 Moore machine where

output for accepting state is 1

output for nonaccepting state is 0




                                         4
Example
To find the residue mod 3 for binary string treated
    as a binary integer
 if a number i written in binary is followed by 0,
    resulting string has value 2i
If I is followed by 1 the resulting string has value 2i
    +1
If a string x(when treated as binary integer) has
    remainder p(when divided by 3) then string ‘x0’
    will have remainder 2p mod 3
And string ‘X1’ will have remainder 2p+1 mod 3

                                                          5
input 1010 value 10 so 10 mod 3 = 1
          q0 1 q1 0 q2 1 q2 0 q1
output    0       1        2       2       1

     0                1                    2
              1                        0
     q0               q1                   q2


              1                0


                                   1
          0
                                                6
• 25 = 1 1 0 0 1
    • Q0- 1 q1 – 1-   q0 0- q0- 0 - q0 – 1 – q1
    •0      1           0    0      0       1




                                                  7
Mealy Machine       out put is associated with
                      transition

A Mealy machine is a six tuple
(Q , Σ, ∆, δ, λ, q0)
∆ : Is the output alphabet
λ : I s a mapping from QX Σ to ∆ giving
  output λ(q,a)      associated with the
  transitions from state q and input each
  state.

                                                 8
Output in response to input a1 a2 …an is
λ(q0, a1) λ(q1,a2) λ(q2,a3)… λ(qn-1,an)
Where q0, q1,…qn is the sequence of states
 such that δ (qi-1,ai) = qi



Note that this sequence has length n
 rather that n+1 as in Moore machine


                                           9
Mealy machine to add two integers
  using their binary expansions
Inputs xn xn-1 …x0
         yn yn-1…y0
We assume that both xn and yn are zero.
 a state q0 represents that previous carry is
  zero
A state q1 represents that previous carry
  was 1
Inputs to the machine are pairs of bits:
  there are four possible inputs(00,01,10,11)
                                            10
Input            010010                      18
                      011101                      29
              01, 1                       01, 0   47
                           11, 0


                  q0                       q1


      00, 0                00, 1                       11, 1


                10, 1
                                        10, 0

 0 - 01- q0 - 10 - q0 - 01 - q0- 01 - q0- 11 - q1 - 00- q0
      1               1   1        1      0            1
                                                               11
out put is : 1 0 1 1 1 1 value 47
Equivalence of Moore and Mealy
           Machines
A Moore machine M can never be correctly
 equivalent to a Mealy machine M’
 because the length of output string from a
 Moore machine M is one greater than that
 from the Mealy machine M’ on the same
 input.
However we may neglect the response of
 Moore machine to input λ and say

                                          12
Moore machine M and a Mealy machine M’
 are equivalent if for all inputs w


         b TM’ (w)   = TM(w)



where b is the output of Moore machine M
 for its initial state



                                           13
• Theorem: I If M1= (Q , Σ, ∆, δ, λ, q0)
  is a Moore machine then there is a
  Mealy machineM2 equivalent to M1
• Proof: Construct Mealy machine M2 as
(Q , Σ, ∆, δ, λ’, q0)
   λ’ is defined as:

λ’(q,a) = λ(δ(q,a)) for all states q and
  input symbols a


                                           14
input 1010 value 10 so 10 mod 3 = 1
                                q0 1 q1 0 q2 1 q2 0 q1
 output of Moore                       0      1           2       2        1

          0                             1                     2
                           1/1                      0/2
           q0                            q1                   q2


                               1/0                  0/1


                                              1/2
                     0/0
Out put for Mealy machine on the same input
                                                                      15
q0 - 1   (1)    q1 - 0   (2)   q2- 1 (2) q2 - 0 (1) q1
• on input 1010 out by Moore machine is
      0 1        2     2    1
While output from the constructed Mealy
  machine is
           1      2     2    1
By the condition of equivalence
   we should add out put of q0 0 of Moore
  machine in the beginning of out put of
  Mealy machine
Hence the machine made is equivalent to
  the give Moore machine.
                                            16
• Theorem: If M1= (Q , Σ, ∆, δ, λ, q0)
  is a Mealy machine then there is a
  Moore machine M2 equivalent to M1.
• Proof:We can do the reverse of what we
  did in the construction of Mealy
  machine.
As the different edges terminating to a
  node may have different outputs.



                                       17
We look into each state and see the edges with
  different outputs are terminating to it.
Say state qi is having all the terminating edges
  with 0,1, 2 as outs on them.
State qi is split into
Qi0, qi1, qi2 ie. In the Moore machine in place
  of qi state we take three state
qi0, qi1, qi2.
With these states we associate outputs as
 0,1,2 respectively in the Moore machine

                                                   18
In q0 four edges are terminating and in different outputs
   on them are only two 0 and 1
So q0 is split into two states q00 and q01
         01, 1                         01, 0

                     11, 0


             q0                         q1


 00, 0               00, 1                        11, 1


           10, 1
                                     10, 0

Similarly on state q1 four edges are terminating with two
different output vales 0 and 1 so it is also split into two
new states as q10 and q11.
                                                          19
01,10

 00          00
                                     00
                     q01     1                1
             01
                           11        10, 01
                                              q11
      q00
              10
0                    00                                 11
                                     11
        11
                     q10
                             0


                  01,10
010010             18 q00 -01-q01-10-q01-01-q01-01-q01-11-q10-00-
                                                  q01
                                                                    20
011101             29    0 1 1 1 1 0 1 ie         101111 = 47
• 0 1 0 0 1 0 18
• 0 1 1 1 0 1 29       47

q00 - 01- q01 -10 - q01 - 01- q01 - 01-
  q01-11- q10 – 00 -    q01
•    0 1 1 1 1 0 1 ie
•    101111 = 47

                                          21

More Related Content

What's hot

Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
Irfan Anjum
 

What's hot (20)

Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
 
Church Turing Thesis
Church Turing ThesisChurch Turing Thesis
Church Turing Thesis
 
Control Unit Design
Control Unit DesignControl Unit Design
Control Unit Design
 
K - Map
  K - Map    K - Map
K - Map
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
 
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
 
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
 
Regular Expression to Finite Automata
Regular Expression to Finite AutomataRegular Expression to Finite Automata
Regular Expression to Finite Automata
 
Applications of Mealy & Moore Machine
Applications of  Mealy  & Moore Machine Applications of  Mealy  & Moore Machine
Applications of Mealy & Moore Machine
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Pda
PdaPda
Pda
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Pipelining & All Hazards Solution
Pipelining  & All Hazards SolutionPipelining  & All Hazards Solution
Pipelining & All Hazards Solution
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
 

Viewers also liked

Mealy state machine
Mealy state machineMealy state machine
Mealy state machine
Arif Siyal
 
Finite state machines
Finite state machinesFinite state machines
Finite state machines
dennis gookyi
 

Viewers also liked (20)

Mealy and moore machines
Mealy and moore machinesMealy and moore machines
Mealy and moore machines
 
Mealy state machine
Mealy state machineMealy state machine
Mealy state machine
 
Meley & moore
Meley & mooreMeley & moore
Meley & moore
 
Finite state machines
Finite state machinesFinite state machines
Finite state machines
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machine
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machines
 
Synchronous state machines. Moore and Mealy state machines (FSM)
Synchronous state machines.  Moore and Mealy state machines (FSM)Synchronous state machines.  Moore and Mealy state machines (FSM)
Synchronous state machines. Moore and Mealy state machines (FSM)
 
Finite state machines
Finite state machinesFinite state machines
Finite state machines
 
Fsm sequence detector
Fsm sequence detector Fsm sequence detector
Fsm sequence detector
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfa
 
Finite State Machines - Why the fear?
Finite State Machines - Why the fear?Finite State Machines - Why the fear?
Finite State Machines - Why the fear?
 
Finite State Machines
Finite State Machines Finite State Machines
Finite State Machines
 
Counters
CountersCounters
Counters
 
Sayısal Devreler 07, Feza BUZLUCA
Sayısal Devreler 07, Feza BUZLUCASayısal Devreler 07, Feza BUZLUCA
Sayısal Devreler 07, Feza BUZLUCA
 
Deterministic Finite Automata
Deterministic Finite AutomataDeterministic Finite Automata
Deterministic Finite Automata
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine design
 
Mealy machine
Mealy machineMealy machine
Mealy machine
 
Mgd finite statemachine
Mgd finite statemachineMgd finite statemachine
Mgd finite statemachine
 
Divide by N clock
Divide by N clockDivide by N clock
Divide by N clock
 

Similar to Moore and mealy machines

ALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docx
ALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docxALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docx
ALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docx
nettletondevon
 
Analysis of state machines & Conversion of models
Analysis of state machines & Conversion of modelsAnalysis of state machines & Conversion of models
Analysis of state machines & Conversion of models
Abhilash Nair
 
Designing Clocked Synchronous State Machine
Designing Clocked Synchronous State MachineDesigning Clocked Synchronous State Machine
Designing Clocked Synchronous State Machine
Abhilash Nair
 
Mux decod pld2_vs2
Mux decod pld2_vs2Mux decod pld2_vs2
Mux decod pld2_vs2
WanNurdiana
 

Similar to Moore and mealy machines (20)

Lect21 Engin112
Lect21 Engin112Lect21 Engin112
Lect21 Engin112
 
Synchronous design process
Synchronous design processSynchronous design process
Synchronous design process
 
Finite automata
Finite automataFinite automata
Finite automata
 
ALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docx
ALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docxALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docx
ALC-Prac-10A.pdfMAT2ALC Practice Class 10A Turing Machines.docx
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
 
TuringMachines.ppt
TuringMachines.pptTuringMachines.ppt
TuringMachines.ppt
 
Analysis of state machines & Conversion of models
Analysis of state machines & Conversion of modelsAnalysis of state machines & Conversion of models
Analysis of state machines & Conversion of models
 
Quantum Cost Calculation of Reversible Circuit
Quantum Cost Calculation of Reversible CircuitQuantum Cost Calculation of Reversible Circuit
Quantum Cost Calculation of Reversible Circuit
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion
 
12 latches
12 latches12 latches
12 latches
 
lec7.ppt
lec7.pptlec7.ppt
lec7.ppt
 
Lec 25 26_27
Lec 25 26_27Lec 25 26_27
Lec 25 26_27
 
Lec9
Lec9Lec9
Lec9
 
Autoata.pptx
Autoata.pptxAutoata.pptx
Autoata.pptx
 
Designing Clocked Synchronous State Machine
Designing Clocked Synchronous State MachineDesigning Clocked Synchronous State Machine
Designing Clocked Synchronous State Machine
 
Lesson 18 Automata .ppt
Lesson 18 Automata .pptLesson 18 Automata .ppt
Lesson 18 Automata .ppt
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential Circuit
 
Mux decod pld2_vs2
Mux decod pld2_vs2Mux decod pld2_vs2
Mux decod pld2_vs2
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 

More from lavishka_anuj

More from lavishka_anuj (10)

Simplifiaction of grammar
Simplifiaction of grammarSimplifiaction of grammar
Simplifiaction of grammar
 
Properties of cfg
Properties of cfgProperties of cfg
Properties of cfg
 
One ques
One quesOne ques
One ques
 
Non regular languages
Non regular languagesNon regular languages
Non regular languages
 
Grammar
GrammarGrammar
Grammar
 
Flat
FlatFlat
Flat
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
 
Finite automata
Finite automataFinite automata
Finite automata
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
 
Turing machines
Turing machinesTuring machines
Turing machines
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
UiPath New York Community Day in-person event
UiPath New York Community Day in-person eventUiPath New York Community Day in-person event
UiPath New York Community Day in-person event
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

Moore and mealy machines

  • 1. Finite state Machines with output Moore and Mealy machines 1
  • 2. Moore Machine output is associated with states A Moore machine is a six tuple (Q , Σ, ∆, δ, λ, q0) ∆ : Is the output alphabet λ : I s a mapping from Q to ∆ giving output associated with each state. Output in response to input a1 a2 …an is λ(q0) λ(q1) λ(q2)… λ(qn) Where q0, q1,…qn is the sequence of states such that δ (qi-1,ai) = qi STRING LENGTH 2 N+1
  • 3. Note Any Moore machine gives output λ(q0) in response to input - empty string 3
  • 4. DFA may be viewed as a special case of Moore machine where output for accepting state is 1 output for nonaccepting state is 0 4
  • 5. Example To find the residue mod 3 for binary string treated as a binary integer if a number i written in binary is followed by 0, resulting string has value 2i If I is followed by 1 the resulting string has value 2i +1 If a string x(when treated as binary integer) has remainder p(when divided by 3) then string ‘x0’ will have remainder 2p mod 3 And string ‘X1’ will have remainder 2p+1 mod 3 5
  • 6. input 1010 value 10 so 10 mod 3 = 1 q0 1 q1 0 q2 1 q2 0 q1 output 0 1 2 2 1 0 1 2 1 0 q0 q1 q2 1 0 1 0 6
  • 7. • 25 = 1 1 0 0 1 • Q0- 1 q1 – 1- q0 0- q0- 0 - q0 – 1 – q1 •0 1 0 0 0 1 7
  • 8. Mealy Machine out put is associated with transition A Mealy machine is a six tuple (Q , Σ, ∆, δ, λ, q0) ∆ : Is the output alphabet λ : I s a mapping from QX Σ to ∆ giving output λ(q,a) associated with the transitions from state q and input each state. 8
  • 9. Output in response to input a1 a2 …an is λ(q0, a1) λ(q1,a2) λ(q2,a3)… λ(qn-1,an) Where q0, q1,…qn is the sequence of states such that δ (qi-1,ai) = qi Note that this sequence has length n rather that n+1 as in Moore machine 9
  • 10. Mealy machine to add two integers using their binary expansions Inputs xn xn-1 …x0 yn yn-1…y0 We assume that both xn and yn are zero. a state q0 represents that previous carry is zero A state q1 represents that previous carry was 1 Inputs to the machine are pairs of bits: there are four possible inputs(00,01,10,11) 10
  • 11. Input 010010 18 011101 29 01, 1 01, 0 47 11, 0 q0 q1 00, 0 00, 1 11, 1 10, 1 10, 0 0 - 01- q0 - 10 - q0 - 01 - q0- 01 - q0- 11 - q1 - 00- q0 1 1 1 1 0 1 11 out put is : 1 0 1 1 1 1 value 47
  • 12. Equivalence of Moore and Mealy Machines A Moore machine M can never be correctly equivalent to a Mealy machine M’ because the length of output string from a Moore machine M is one greater than that from the Mealy machine M’ on the same input. However we may neglect the response of Moore machine to input λ and say 12
  • 13. Moore machine M and a Mealy machine M’ are equivalent if for all inputs w b TM’ (w) = TM(w) where b is the output of Moore machine M for its initial state 13
  • 14. • Theorem: I If M1= (Q , Σ, ∆, δ, λ, q0) is a Moore machine then there is a Mealy machineM2 equivalent to M1 • Proof: Construct Mealy machine M2 as (Q , Σ, ∆, δ, λ’, q0) λ’ is defined as: λ’(q,a) = λ(δ(q,a)) for all states q and input symbols a 14
  • 15. input 1010 value 10 so 10 mod 3 = 1 q0 1 q1 0 q2 1 q2 0 q1 output of Moore 0 1 2 2 1 0 1 2 1/1 0/2 q0 q1 q2 1/0 0/1 1/2 0/0 Out put for Mealy machine on the same input 15 q0 - 1 (1) q1 - 0 (2) q2- 1 (2) q2 - 0 (1) q1
  • 16. • on input 1010 out by Moore machine is 0 1 2 2 1 While output from the constructed Mealy machine is 1 2 2 1 By the condition of equivalence we should add out put of q0 0 of Moore machine in the beginning of out put of Mealy machine Hence the machine made is equivalent to the give Moore machine. 16
  • 17. • Theorem: If M1= (Q , Σ, ∆, δ, λ, q0) is a Mealy machine then there is a Moore machine M2 equivalent to M1. • Proof:We can do the reverse of what we did in the construction of Mealy machine. As the different edges terminating to a node may have different outputs. 17
  • 18. We look into each state and see the edges with different outputs are terminating to it. Say state qi is having all the terminating edges with 0,1, 2 as outs on them. State qi is split into Qi0, qi1, qi2 ie. In the Moore machine in place of qi state we take three state qi0, qi1, qi2. With these states we associate outputs as 0,1,2 respectively in the Moore machine 18
  • 19. In q0 four edges are terminating and in different outputs on them are only two 0 and 1 So q0 is split into two states q00 and q01 01, 1 01, 0 11, 0 q0 q1 00, 0 00, 1 11, 1 10, 1 10, 0 Similarly on state q1 four edges are terminating with two different output vales 0 and 1 so it is also split into two new states as q10 and q11. 19
  • 20. 01,10 00 00 00 q01 1 1 01 11 10, 01 q11 q00 10 0 00 11 11 11 q10 0 01,10 010010 18 q00 -01-q01-10-q01-01-q01-01-q01-11-q10-00- q01 20 011101 29 0 1 1 1 1 0 1 ie 101111 = 47
  • 21. • 0 1 0 0 1 0 18 • 0 1 1 1 0 1 29 47 q00 - 01- q01 -10 - q01 - 01- q01 - 01- q01-11- q10 – 00 - q01 • 0 1 1 1 1 0 1 ie • 101111 = 47 21