Skip to question
ASIC.FYI
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
ASIC.FYI/Interview questions/Represent a 64-entry window with one bitmap

Q282·Free·SystemVerilog

Represent a 64-entry window with one bitmap

Difficulty
Easy
Topic
Reliable RTL
Language
SV
Interview prompt

Question

Optimize a fixed 64-entry transaction window by replacing the associative received set with one 64-bit bitmap.

Sequence numbers B through B plus sixty-three mapped to offsets in a single receive bitmap
A sequence maps to one bitmap bit using its offset from the current window base.
Starting point

Question code

class BitmapWindowTracker;
  bit [63:0] seen;
  int base;
  function bit accept(int seq);
endclass
Reviewed example

Trace one case

Input
base=254; accept sequence 256, then 254, then 255
Expected output
offset2 sets first; accepting 254 and 255 advances base to257; bitmap returns to zero

The fixed bitmap records offset two out of order, then right-shifts once for each contiguous bit-zero retirement across the numeric boundary.

What to cover

Requirements

  1. Map seq minus base to bit positions zero through 63.
  2. Reject negative, too-large, and already-set offsets.
  3. Set the accepted bit.
  4. Shift right and increment base while bit zero is set.
Exact question handoffPractice Q282

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
  • Sliding window
  • Bitmap
  • Shift register
RTL design questions →
Continue practicing

Related questions

Q235 · Reliable RTLHandle wrapping 8-bit sequence numbers→Q207 · Reliable RTLDetect and recover an upset one-hot FSM→Q097 · Temporal ChecksMonitor ready/valid without SVA→
ASIC.FYI · Learn silicon end to end.info@asic.fyi