Hardware interview practice
Find the unpaired fault ID
Consume a framed stream in which every fault ID appears exactly twice except one ID that appears once, then return the unpaired ID.
Reviewed example
Work through one case
Input
accepted fault IDs=[5,2,5,2,7], last asserted with 7Expected output
result_id=7Pairwise IDs cancel under XOR and the final accepted unpaired zero-capable accumulator result is held until consumed.
What to cover
Requirements
- Change the accumulator only when fault_valid and fault_ready are both asserted.
- Include the accepted final item in the result when fault_last is asserted.
- Support an unpaired ID of zero.
- Hold result_id and result_valid stable during result backpressure.
