Skip to the selected question
ASIC.FYI

ASIC Interview Question Bank

1,000+ hardware interview questions.Curated and reviewed by industry engineers.1,000+ hardware questions1,000+ questionsEngineer-reviewed
DescriptionQ282
Page ↗
Q282DesignFollow-up to Q560ASIC interview problem

Represent a 64-entry window with one bitmap

TechniquesSliding windowBitmapShift register
DifficultyEasy
TopicReliable RTL
LanguageSystemVerilog
Requirements4 checkpoints
01

Problem

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.
Class declarationSystemVerilog
class BitmapWindowTracker;
  bit [63:0] seen;
  int base;
  function bit accept(int seq);
endclass

Example input and output

Use this case to check your interpretation
Input
base=254; accept sequence 256, then 254, then 255
Output
offset2 sets first; accepting 254 and 255 advances base to257; bitmap returns to zero
Explanation

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

02

Requirements (4)

  • Map seq minus base to bit positions zero through 63.
  • Reject negative, too-large, and already-set offsets.
  • Set the accepted bit.
  • Shift right and increment base while bit zero is set.