2.7Finite automata with output: Mealy and Moore machines
Covers IGNOU MCS-212 §2.4.3, Examples 17–19
A DFA only answers “yes” or “no”. Many real devices instead produce an output at every step: a vending machine releases items, a traffic controller switches lights, a serial decoder outputs bits. Mealy and Moore machines are finite automata that write an output symbol as they run.
Mealy
Moore
Output attached to
transitions (a/x on edges)
states (q/x in circles)
Output length for input of length n
n
n+1 (first output at start)
Final states
none
none
Typical use
sequence detectors, serial transducers
controllers where each state is a configuration (traffic lights)
The two models are equivalent: for every Mealy machine there is a Moore machine producing the same output (apart from the extra first symbol), and vice versa.
The elevator controller of Example 17 is another finite machine without accepting states: its six states (waiting on floor 1 or 2, about to go up or down, moving up or down) and inputs (no call, call to 1, call to 2) describe the control logic, and its outputs are the motor actions.
Key takeaways
Mealy: output on each transition (a/x); Moore: output on each state (q/x).
For input of length n: Mealy gives n outputs, Moore n+1.
No final states; the purpose is translation, not acceptance.
Mealy and Moore machines are equivalent in power.
Practice questions
Answer on paper first, then check. The explanation matters more than the letter you chose.
Question 6 · short answer
Design a Mealy machine over {0,1} that outputs 1 whenever the current input equals the previous input, and 0 otherwise (output 0 for the first symbol). Trace 0011.
Show worked answer
States: s (start, nothing read), p0 (previous was 0), p1 (previous was 1). Transitions: s0/0p0, s1/0p1, p00/1p0, p01/0p1, p11/1p1, p10/0p0. Trace 0011: s0/0p00/1p01/0p11/1p1; output 0101.
MCA Online notes are made for reading on screen. Open https://mcastudy.online/mcs-212/automata-and-languages/finite-automata-with-output-mealy-and-moore-machines/ to read this page.