Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Detect the wildcard pattern 110?01

Hardware interview practice

Detect the wildcard pattern 110?01

HardRTL DesignSystemVerilog

Implement both an overlapping FSM and a six-bit shift-register detector for 110?01, where ? is either binary value. Make their outputs agree.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

input logic clk, rst_n, in_bit;
output logic detect_fsm, detect_shift;
Reviewed example

Work through one case

Input
Streams 110001, 110101, and 110111
Expected output
First two match on bit 6; the third does not

The fourth bit may be 0 or 1, but the required fifth bit must be 0.

What to cover

Requirements

  1. Sample one binary input per rising edge and pulse on the final bit.
  2. Treat ? as a don't-care pattern position, not four-state X.
  3. Suppress detection until six bits have been sampled after reset.
  4. Preserve compatible prefix state for overlapping matches and assert both implementations agree.
asic.fyi · Learn silicon end to end.info@asic.fyi