Professional Documents
Culture Documents
Mealy Machines and Moore Machines are finite state machines that generate
output strings (or a sequence of output symbols). They don’t have accept states.
They can be used for computing some simple function that requires reading the
input string only once, and memory given by a finite number of states.
Moore machine:
They have one output symbol for each state it goes to.
λ(q) = a means ‘If the automata (machine) goes to state q, output a’.
Example: λ(q1) = 0 means that if the machine goes to state q1, output 0.
While drawing the state diagram, we write the output symbol along with the
state name (see the figure below). Here, q1/0 means that on going to state q1, it
generates symbol ‘0’ on its output stream.
It has an initial output symbol (that corresponds to the initial state q0), so the
total length of the output = (n+1) bits, if input has n bits.
Here, the output is defined on moves (i.e., it depends on the current state
and the current symbol, just like δ)
On an input of length n, it has an output string also of length n.
On the arrow from state q to state r, we write two symbols. For example,
if we have transition δ(q0, 0) = (q1) and output function λ’(q0, 0) = 1, we
draw the states and the move (along with the output) as follows:
(On the label of the arrow, the first symbol is input symbol, second one is output
symbol. It means that on seeing a 0 when in state q0, the machine moves to state
q1, and generates an output symbol ‘1’.)
Verify that an input string 1101 generates output 1110 on this machine.
[Note: A Mealy Machine can be converted to a Moore Machine and vice versa.
We are not doing conversion in the class right now.]