RTL Design #5 · 2026-09-28 · FSMs · Easy · about 10 min

Overlapping 1011 detector

seq1011 watches a serial bit stream on din and raises hit whenever the last four bits sampled were 1, 0, 1, 1. hit is registered: it is 1 for exactly the cycle after the edge that sampled the final 1.

Matches may overlap. In 1011011 the fourth bit ends the first match and starts the second, so hit pulses twice.

The current FSM finds isolated matches but misses overlapping ones and some that follow a near miss. Fix detector.sv.

Write and run your answer in the browser. The hidden tests check it, and it’s free.