Computation Theory 1 A.L. Mustafa Ghanem Saeed 1 | Page Computer Science Department Collage of Science Cihan University Finite State Machines with Output (Mealy and Moore Machines) We shall investigate two different models for FA's with output capabilities; these are Moore machine and Mealy machine. Moore Machines: A Moore machine M is the 5 tuple M = (Q,, Г, Ϩ, q0) where 1. A finite set of states q0, q1, q2, …, where q0 is designed as the start state. 2. An alphabet of letters for forming the input string Σ= { a, b, c, …}. 3. An alphabet of possible output characters Г = { x, y, z, …}. 4. A transition function Ϩ as in table that shows for each state and each input letter what state is reached next. 5. Start state as q0. An output table that shows what character from Г is printed by each state that is entered. A Moore machine does not define a language of accepted words, since every input string creates an output string and there is no such thing as a final state. The processing is terminated when the last input letter is read and the last output character is printed. Example 1: Input alphabet: Σ = {a, b} Output alphabet: Г = {0, 1} Names of states: q0, q1, q2, q3. (q0 = start state) Q Ϩ(q, a) Ϩ(q, b) Г(Q) q0 q1 q3 1 q1 q3 q1 0 q2 q0 q3 0 q3 q1 q2 1 Sol: The Moore machine is:
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Computation Theory 1 A.L. Mustafa Ghanem Saeed
1 | P a g e
Computer Science Department Collage of Science Cihan University
Finite State Machines with Output (Mealy and Moore Machines)
We shall investigate two different models for FA's with output capabilities; these are Moore machine and Mealy machine.
Moore Machines: A Moore machine M is the 5 tuple M = (Q,, Г, Ϩ, q0) where
1. A finite set of states q0, q1, q2, …, where q0 is designed as the
start state. 2. An alphabet of letters for forming the input string Σ= { a, b, c, …}. 3. An alphabet of possible output characters Г = { x, y, z, …}.
4. A transition function Ϩ as in table that shows for each state and each input letter what state is reached next.
5. Start state as q0. An output table that shows what character from Г is printed by each state
that is entered. A Moore machine does not define a language of accepted words, since
every input string creates an output string and there is no such thing as a final state. The processing is terminated when the last input letter is read