Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ882
Page ↗
Q882DesignASIC interview problem

Compare packet-symbol multisets

TechniquesHistogramBounded alphabetTransaction state
DifficultyMedium
TopicRTL Datapaths
LanguageSystemVerilog
Requirements4 checkpoints
01

Problem

Determine whether two bounded packet descriptors contain the same 4-bit symbols with the same multiplicities, regardless of ordering.

Example input and output

Use this case to check your interpretation
Input
A length4=[1,2,1,3]; B length4=[3,1,2,1]; inactive suffixes contain unrelated data
Output
same_multiset=1
Explanation

Both active prefixes have counts {1:2,2:1,3:1}; ordering and inactive lanes do not affect the 16-bin comparison.

02

Requirements (4)

  • Support active lengths from zero through MAX_LEN and ignore inactive slots.
  • Treat the 4-bit alphabet as exactly 16 possible symbols.
  • Return false immediately in the logical result when lengths differ.
  • Capture each request while idle and clear all per-request counting state.