Professional Documents
Culture Documents
Moore machine
A Moore machine is a collection of 6 things: 1. a finite set of states q0,q1,q2,, where q0 is designated the start state 2. an alphabet of input letters 3. an alphabet of output characters 4. a transition table that shows for each state and each input letter what state to go to next. 5. an output table that shows what character is output (or printed) when entering a state. 6. q0 the starting state
transition
state
Moore machine
Example: states = {q0,q1,q2,q3} Old state q0 q1 q2 q3 q0/ 1 Output by the old state 1 0 0 1 S={a,b} G={0,1}
a
q2/ 0
a b
b b
abab
a
q3/ 1
10010
Moore machine
Example: A machine that counts aabs
b a
q0/0 q1/0
a a
a
q2/0
q3/1
b b
Input State Output q0 0 a q1 0 a q2 0 a q2 0 b q3 1 a q1 0 b q0 0 b q0 0 a q1 0 a q2 0 b q3 1 b q0 0
Mealy machine
A Mealy machine is: 1. a finite set of states q0,q1,q2,, where q0 is designated the start state 2. an alphabet S of input letters 3. an alphabet G of output characters 4. a finite set of transitions that indicate, for each state and letter of the input alphabet, the state to go to next and the character that is output (printed).
state input/output state
Mealy machine
b/0 a/0
q0 q1
a/0
a/0
q2
a/0 b/1
q3
b/0
b/0
Mealy machine
Example a/0
q0
q1
b/1 a/0
q2
baaba 01110
b/0
a/1
q3
b/1
b/1
a/1
Mealy machine
Abbreviation: a/x
q4
q7
b/y
q4
a/x, b/y
q7
Mealy machine
Example: an Increment Machine 0/1
start
1/0
decimal: binary : reverse: 11 1011 1101
1111 (overflow)
reverse: decimal: 00 11 1100 12
0000
Mealy machine
Parity checker using mealy machine
Equivalence
Let Mo be a Moore machine that prints x in the start state. Let Me be a Mealy machine. The two machines are equivalent if for every input, whenever the output from Me is w, the output from Mo is xw.
a/t
b/t
c/t
q4
a
q0/0
q1/1
a,b
q3/1
q2/0
a/1
q0
q1
a/1
a/1,b/1
q3
b/0 b/0
q2
b/1
a/0
b
q1 4/ 0
a/1 b/1 b
q24/ 1
a/1 b/1
b/1
b/1
a
q13/0
a/0
a/0 a/0
q6
q6
b/1
q3
a/0
b
q23/1
a/0
q3
q13/ 0
a/0 b/1
b/1
a/0
q0
a/1
b/0
q2
a/0
b a
q1/1
b
q12/0
b
q2 0/ 1
b
q22/ 1
a b b a
q3/0
Solution
A Good Book
Theory Of Computation By A.A.Puntambekar
Available on Google Books http://booklens.com/dexterkozen/automata-andcomputability?ref=related
Mealy M/c
Mealy Moore
Mealy M/c
Moore M/c