Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ863
Page ↗
Q863DesignASIC interview problem

Detect nonoverlapping 10110 sequences

TechniquesDesignSystemVerilogFSMSequence detectorNonoverlap
DifficultyMedium
TopicSequential RTL
LanguageSystemVerilog
Requirements4 checkpoints
01

Problem

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.

Starting declarationSystemVerilog
input  logic clk, rst_n, bit_in;
output logic detected;

Example input and output

Use this case to check your interpretation
Input
bit_in at successive rising edges = 1, 0, 1, 1, 0
Output
detected = 0, 0, 0, 0, 1
Explanation

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

02

Requirements (4)

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