Hardware interview practice
Constrain unique increasing addresses
Randomize eight addresses from 0 through 1023 in strictly increasing order.
Reviewed example
Work through one case
Input
randomize exactly eight addresses in inclusive range 0..1023Expected output
One valid result: [4, 19, 103, 255, 511, 700, 900, 1023]All eight addresses are in range and each is strictly greater than its predecessor; many other increasing sequences are valid.
What to cover
Requirements
- Every address must stay inside the legal range.
- Each address after the first must exceed its predecessor.
- Do not add a redundant uniqueness constraint.
