GATE Computer ScienceHardGATE CS (PYQ pattern)

A Mealy detector for the pattern 1011 is fed the stream 11010110111010110 (left bit first). How many 1s does it output if (i) overlapping occurrences are allowed, and (ii) the detector restarts from scratch after each detection (non-overlapping)?

  1. A. 3 and 3
  2. B. 4 and 2
  3. C. 2 and 2
  4. D. 3 and 2

Correct answer: D. 3 and 2

Numbering the bits 1-17, 1011 occupies bits 4-7, bits 7-10 (sharing bit 7) and bits 13-16. Overlapping: 3. Non-overlapping: after the hit at bit 7 the machine restarts, so the second occurrence (using bit 7) is lost: 2.

More Digital Logic questions

Exams that ask this topic