Hardware interview practice
Find a target-sum operand pair
Design a bounded operand-bank unit that finds two distinct valid entries whose unsigned sum equals a target. Return the lexicographically earliest pair of indices.

Reviewed example
Work through one case
Input
W=4; valid values by index=[2,7,4,5]; target=9Expected output
found=1; idx_a=0; idx_b=1Pairs (0,1) and (2,3) both sum to nine in W+1 bits, so lexicographic priority selects the lower first index.
What to cover
Requirements
- Support a parameterized bank with at least two entries and return idx_a < idx_b.
- Add in W+1 bits so W-bit wraparound cannot create a false match.
- Capture a request only while idle, pulse done for one cycle, and return zero indices when no pair exists.
- When several pairs match, choose the lowest idx_a and then the lowest idx_b.
