Hardware interview practice
Clear the lowest set bit
Return x with its least-significant 1 bit cleared.
Reviewed example
Work through one case
Input
value = 8'b1011_0000Expected output
8'b1010_0000ANDing with value - 1 clears only the lowest set bit, which is bit 4 here.
What to cover
Requirements
- Return zero when x is zero.
- Use one arithmetic and one bitwise operation.
