3-Stage Pipelined Multiplier (8x8)
advanced · pipeline · 370 XP
Sign in to write your solution, run it in the simulator and submit it for grading.
Sign in or create a free account →Problem
3-Stage Pipelined 8×8 Multiplier
Design an **8-bit unsigned multiplier** with **3 pipeline stages** for 1 result per cycle throughput after pipeline fills.
**Stages:**
1. **Stage 1:** Generate 8 partial products (8 x 8-bit values = 64 bits total)
2. **Stage 2:** Reduce partial products using a 4-2 adder tree, produce 2 rows
3. **Stage 3:** Final add of 2 rows → 16-bit product
**Interface**
| Port | Direction | Width | Description |
|-------------|-----------|-------|-------------------------------------|
| `clk` | input | 1 | Clock |
| `rst` | input | 1 | Sync reset |
| `valid_in` | input | 1 | Input valid (start multiplication) |
| `a` | input | 8 | Multiplicand |
| `b` | input | 8 | Multiplier |
| `product` | output | 16 | 16-bit result |
| `valid_out` | output | 1 | Output valid (pipelined) |
**Key properties:**
- **Latency:** 3 cycles (from valid_in to valid_out)
- **Throughput:** 1 result per cycle (after pipeline fills)
- **Correctness:** `8'hFF × 8'hFF = 16'hFE01` (255 × 255 = 65025 = 0xFE01)
**Why 4-2 adder tree?** A 4-2 compressor (or Dadda multiplier tree) reduces 8 rows → 2 rows in logarithmic depth, keeping Stage 2 fast. Stage 3 is a simple 16-bit final adder.
This is a classic interview problem that tests pipeline design, partial product generation, and datapath optimization.
Constraints
- Stage 1: Compute 8 partial products (one per bit of b); latch in registers.
- Stage 2: Reduce 8 rows to 2 rows using a 4-2 adder tree or Wallace tree logic; latch in registers.
- Stage 3: Final 16-bit addition; latch result in registers.
- valid_out is registered; valid_out[t] = valid_in[t-3].
- Throughput: one new result available every cycle (once pipeline is full).
- Support flushing: set valid_in=0 for 3 cycles, output should settle with last valid result.
Examples
Input: valid_in=1, a=8'h02, b=8'h03 at t=0
Output: valid_out=1, product=0x0006 at t=3
2×3=6, 3-cycle latency
Input: Back-to-back inputs: valid_in pulses every cycle
Output: valid_out pulses every cycle starting at t=3
Sustained throughput
Input: a=8'hFF, b=8'hFF
Output: product=16'hFE01 (65025)
255×255 test case
Common questions
- What does the 3-Stage Pipelined Multiplier (8x8) problem ask you to build?
- 3-Stage Pipelined 8×8 Multiplier Design an **8-bit unsigned multiplier** with **3 pipeline stages** for 1 result per cycle throughput after pipeline fills. **Stages:** 1. **Stage 1:** Generate 8 partial products (8 x 8-bit values = 64 bits total) 2.
- What constraints does 3-Stage Pipelined Multiplier (8x8) have?
- Stage 1: Compute 8 partial products (one per bit of b); latch in registers.; Stage 2: Reduce 8 rows to 2 rows using a 4-2 adder tree or Wallace tree logic; latch in registers.; Stage 3: Final 16-bit addition; latch result in registers.; valid_out is registered; valid_out[t] = valid_in[t-3].; Throughput: one new result available every cycle (once pipeline is full).; Support flushing: set valid_in=0 for 3 cycles, output should settle with last valid result.
- What is an example input and output for 3-Stage Pipelined Multiplier (8x8)?
- Input valid_in=1, a=8'h02, b=8'h03 at t=0 gives output valid_out=1, product=0x0006 at t=3. 2×3=6, 3-cycle latency
- Which Verilog concepts does 3-Stage Pipelined Multiplier (8x8) practise?
- pipeline, capstone, multiplier, interview, datapath.