Hardware interview practice
Constrain five non-overlapping address windows
Randomize five sorted, non-overlapping 16-byte windows inside byte addresses 0 through 1023. Every base must be 4-byte aligned.
Starting point
Question code
rand bit [9:0] base[5];Reviewed example
Work through one case
Input
base='{0,16,64,128,1008}Expected output
Legal resultEach base is aligned; adjacent inclusive windows do not overlap; the last window ends at 1023.
What to cover
Requirements
- Align every base to four bytes.
- Keep each inclusive window [base, base+15] within 0..1023.
- Sort bases in strictly increasing order.
- Require neighboring windows to be disjoint.
