DescriptionQ150
Q150DVASIC interview problem
Classify an address range
TechniquesRangesEnumBoundary cases
DifficultyEasy
TopicVerification Utilities
LanguageSystemVerilog
Requirements3 checkpoints
01
Problem
Return LOW for [0:16], MED for [17:127], HIGH for [128:256], and OUT otherwise.
Example input and output
Use this case to check your interpretationInput
unsigned addresses=[0,16,17,127,128,256,257]Output
classes=[LOW,LOW,MED,MED,HIGH,HIGH,OUT]Explanation
Both endpoints of each legal interval are inclusive, adjacent class boundaries have no gap or overlap, and 257 is above the highest legal address.
02
Requirements (3)
- Treat all interval endpoints as inclusive.
- Represent OUT explicitly.
- Avoid gaps or overlaps.
