DescriptionQ882
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 interpretationInput
A length4=[1,2,1,3]; B length4=[3,1,2,1]; inactive suffixes contain unrelated dataOutput
same_multiset=1Explanation
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.
