GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A Moore machine outputs 1 exactly when the last four serial input bits are 0101 or 1010 (overlapping allowed) and 0 otherwise, including before four bits have arrived. What is the minimum number of states?

  1. A. 8
  2. B. 9
  3. C. 10
  4. D. 12

Correct answer: B. 9

Take the 31-state machine whose state is the last up to four input bits, and merge states with the same output and equivalent successors. The minimum is found by partition refinement; the machine needs one state per useful prefix and the two accepting states for the two patterns.

More Digital Logic questions

Exams that ask this topic