Skip to question
ASIC.FYI
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
ASIC.FYI/Interview questions/Handle wrapping 8-bit sequence numbers

Q235·Free·SystemVerilog

Handle wrapping 8-bit sequence numbers

Difficulty
Medium
Topic
Reliable RTL
Language
SV
Interview prompt

Question

Adapt window membership and advancement to 8-bit sequence numbers that wrap from 255 to 0.

Starting point

Question code

function bit in_window(byte unsigned seq);
function void advance_base();
Reviewed example

Trace one case

Input
8-bit sequence stream near rollover: 254, 255, 0, 1
Expected output
All four values are classified as consecutive; next expected sequence is 2.

Modulo-256 distance treats 0 as the successor of 255 rather than as an old packet.

What to cover

Requirements

  1. Compute forward distance modulo 256.
  2. Treat seq equal to base as distance zero.
  3. Restrict the window to at most 128 entries so old and future values are unambiguous.
  4. Wrap base modulo 256 after retirement.
Exact question handoffPractice Q235

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

Open in question bank →
Solution accessA Free account unlocks the complete reviewed solution.
Continue learning

SystemVerilog

  • Reliable RTL
  • Sequence numbers
  • Wraparound
  • Modular arithmetic
RTL design questions →
Continue practicing

Related questions

Q282 · Reliable RTLRepresent a 64-entry window with one bitmap→Q292 · ArbitersPredict a strict round-robin grant→Q207 · Reliable RTLDetect and recover an upset one-hot FSM→
ASIC.FYI · Learn silicon end to end.info@asic.fyi