Hardware interview practice
Compute every product except one channel
Accept a frame of sensor-lane gain factors and emit, for each lane, the product of every other lane's gain without using division.
Reviewed example
Work through one case
Input
accepted gains by lane = [1, 2, 3, 4]Expected output
products by lane = [24, 12, 8, 6]Each output combines the prefix before its lane with the suffix after it, so division is never needed.
What to cover
Requirements
- Support 1 to 8 unsigned eight-bit gains and emit results in lane order.
- Use a 56-bit result because each output multiplies at most seven eight-bit factors.
- Return the empty product 1 for a one-lane frame and handle zero, one-zero, and multi-zero inputs naturally.
- Reuse a multiplier across bounded prefix, suffix, and output work rather than requiring division.
- Keep output lane, product, and last stable while stalled.
