Hardware interview practice
Shorten a critical path with pipelining
A four-operand W-bit sum is too slow as one long combinational expression. Re-architect it as a two-stage pipeline that accepts new inputs every cycle and carries a valid bit to the output.
Reviewed example
Work through one case
Input
W=8; accept a=200,b=100,c=50,d=10 at cycle0Expected output
10-bit sum=360 with out_valid at cycle2Stage one registers widened partials 300 and 60, and stage two registers their full sum while later transactions may enter every cycle.
What to cover
Requirements
- Add enough width to preserve the full mathematical sum.
- Register two pairwise partial sums, then register their final sum.
- Accept one transaction per cycle and produce results at fixed two-cycle latency.
- Explain that latency increases even though throughput can remain one result per cycle.
