Watch the serial input and raise detected for one cycle whenever
the last three sampled bits were 1,1,0 (in that order — so detected
is high in the cycle where the 0 is sampled). Overlapping patterns
count: in 11010110 the pattern occurs at positions 3 and 8... check
yourself with the waveform. Synchronous reset returns to the initial
state.
| Port | Dir | Width | Meaning |
|---|---|---|---|
| clk, rst | in | 1 | clock, sync reset |
| din | in | 1 | serial bit per clock |
| detected | out | 1 | high when the last 3 bits were 110 |
Refresher: the state machines lesson — or keep a tiny shift register of recent bits, your choice.