Hardware interview practice
Detect overlapping 1011 sequences
Design a serial detector for the pattern 1011 with overlap enabled. Assert match in the cycle that the final bit is accepted, and provide a bus functional model (BFM) check based on a sliding-window model rather than duplicating the FSM.
Reviewed example
Work through one case
Input
accepted bits=[1,0,1,1,0,1,1] with arbitrary valid gapsExpected output
match pulses on accepted bits 4 and 7The sliding accepted-bit windows are 1011 at both endpoints in 1011011; valid gaps hold state and do not create positions.
What to cover
Requirements
- Sample one input bit whenever valid_in is high and hold state across valid gaps.
- Detect both occurrences in 1011011.
- Assert match only for a valid final bit and for one cycle per occurrence.
- The checker must compare against the last four accepted bits and preserve a short failure trace.
