Skip to question
SystemVerilogDesignVerificationFirmwareArchitectureASIC Interview Questions→
/Interview questions/Detect nonoverlapping 10110 sequences

Q186·Free·SystemVerilog

Detect nonoverlapping 10110 sequences

Difficulty
Medium
Topic
Sequential RTL
Language
SV
Interview prompt

Question

Design a serial sequence detector that accepts one bit per clock and emits a one-cycle pulse when 10110 completes. Bits consumed by a match cannot begin the next match.

Candidate starting point

Implementation scaffold

module sequence_detector (
  input logic clk, rst_n, bit_in,
  output logic detected
);
  typedef enum logic [2:0] {S0, S1, S10, S101, S1011} state_t;
  state_t state;

  always_ff @(posedge clk or negedge rst_n) begin : update_prefix_and_pulse
    // Implement here: reset, prefix advance/fallback and a nonoverlapping pulse.
  end
endmodule
Reviewed example

Trace one case

Input
bit_in at successive rising edges = 1, 0, 1, 1, 0
Expected output
detected = 0, 0, 0, 0, 1

The fifth sampled bit completes 10110, so the registered output pulses for the following cycle and the FSM returns to its no-prefix state.

What to cover

Requirements

  1. Recognize the exact five-bit pattern 10110 without overlap.
  2. Pulse detected for exactly one destination clock cycle.
  3. Clear all partial-match state on reset.
  4. Retain the longest useful suffix after every mismatch, but return to the start state after a full match.
Exact question handoffPractice Q186

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessEach time you open this Solution, one Practice Credit is used; it is not permanently unlocked. Premium Solution content also uses one credit per opening.
Continue learning

RTL Logic and State

Review combinational logic, sequential state, counters, arithmetic, and finite-state machines.

  • Sequential RTL
  • SystemVerilog
  • FSM
  • Sequence detector
RTL Logic and State →
Continue practicing

Related questions

Q204 · FSMsDetect overlapping 1011 sequencesMediumP→Q799 · RTL DesignDetect overlapping 1101 sequencesMediumP→Q430 · FSMsDetect 1011 with optional overlapMediumP→Q074 · RTL DesignOverlapping 101 sequence detectorEasy→Q990 · RTL DesignDetect Overlapping 1011 SequencesMediumP→
ASIC.FYI · Learn silicon end to end.info@asic.fyi