Hardware interview practice
Compute Hamming distance
Return the number of bit positions where two 32-bit integers differ.
Reviewed example
Work through one case
Input
left = 4'b1010, right = 4'b0011Expected output
2The XOR is 1001, which contains two set bits.
What to cover
Requirements
- Use XOR to expose mismatches.
- Count the set bits in the XOR result.
