A digital design project implementing and comparing hardware multiplier architectures in VHDL, developed as an academic assignment in digital systems design.
- Overview
- Project Structure
- Array Multiplier
- Add and Shift (Sequential Multiplier)
- Comparison with Other Algorithms
- Simulation / Usage
- Contribute
- License
Binary multiplication can be implemented in hardware using several different architectures, each with its own trade-offs between speed, area (gate count), and design complexity. This project implements two of these architectures and documents two additional ones for comparison:
- Array Multiplier — a combinational, fully-parallel multiplier built from AND gates, half adders, and full adders.
- Shift and Add (Sequential Multiplier) — a sequential, clock-driven multiplier that computes the product one bit at a time using a shift-and-accumulate FSM.
- Booth's Algorithm (discussed, not implemented) — handles signed multiplication uniformly and reduces the number of partial-product additions.
- Wallace Tree (discussed, not implemented) — sums partial products in parallel using carry-save counters to minimize delay.
.
├── Array Multiplier/ # Combinational array multiplier (VHDL source)
├── Add & Shift/ # Sequential shift-and-add multiplier (VHDL source)
└── Digital Project.pdf # Project report / slides covering all four algorithms
A combinational multiplier that computes the product directly from partial products generated by AND gates, then reduces them using a network of half adders and full adders — similar in structure to how multiplication is done by hand (long multiplication), but performed entirely in parallel hardware.
| Component | Count |
|---|---|
| AND gates | n² |
| Half adders | n |
| Full adders | n(n − 2) |
- Fully combinational — no clock required, output is available after propagation delay.
- Gate count and critical-path delay both grow with
n, making it fast but area-expensive for large bit widths.
The Array Multiplier folder contains a structural VHDL implementation using chained half_adder and full_adder components to build up the partial-product reduction network, producing an 8-bit product S from two 4-bit operands.
A sequential multiplier that trades speed for hardware simplicity. On each clock cycle:
- The least significant bit of the multiplier register is checked.
- If it is
1, the multiplicand is added to the accumulator. - The combined accumulator + multiplier register is then shifted right by one bit.
- This repeats for all
nbits of the multiplier; the final result is held in the accumulator.
- 3 registers (multiplicand, multiplier/accumulator working registers)
- A counter (counts up to
nbits after each shift) - An arithmetic unit (ALU) for addition
The Add & Shift folder contains a generic (N-bit, default 8) sequential multiplier described as a finite state machine with states:
IDLE → LOAD → CHECK_ADD → SHIFT → FINISH
- IDLE: waits for
start. - LOAD: loads operands
AandBinto working registers, resets the accumulator and counter. - CHECK_ADD: conditionally adds the multiplicand to the accumulator based on the current LSB.
- SHIFT: performs a logical right shift across the combined accumulator/multiplier register.
- FINISH: asserts
doneand outputs the final productP.
Entity interface:
| Port | Direction | Width | Description |
|---|---|---|---|
clk |
in | 1 | Clock |
reset |
in | 1 | Synchronous reset |
start |
in | 1 | Starts a new multiplication |
A |
in | N |
Multiplicand |
B |
in | N |
Multiplier |
P |
out | 2*N |
Product |
done |
out | 1 | Asserted when result is ready |
| Algorithm | Type | Signed Support | Relative Speed | Relative Area |
|---|---|---|---|---|
| Array Multiplier | Combinational | No (unsigned) | Fast | Large (O(n²) gates) |
| Add and Shift | Sequential | No (unsigned) | Slow (n cycles) | Small |
| Booth's Algorithm | Combinational/Sequential | Yes | Faster than plain shift-and-add | Moderate |
| Wallace Tree | Combinational (carry-save) | No | Fastest | Large |
- Booth's Algorithm computes the product identically for signed and unsigned operands and reduces the number of partial-product additions needed.
- Wallace Tree sums partial-product bits column-by-column in parallel using counters, avoiding sequential carry propagation and minimizing delay at the cost of extra area.
Each folder contains synthesizable VHDL source files intended for simulation in a standard HDL simulator (e.g., ModelSim, GHDL, or Vivado Simulator):
- Open the project in your simulator of choice.
- Compile all VHDL files within the relevant folder (
Array MultiplierorAdd & Shift). - For the Array Multiplier, apply the two input operands and observe the product output combinationally.
- For the Add & Shift multiplier, instantiate
sequential_multiplier, driveclk/reset, applyAandB, pulsestart, and wait fordonebefore readingP. - A testbench is expected/recommended for each design to automate stimulus and result checking.
Note: Some VHDL snippets in the source material contain OCR/transcription artifacts (e.g. stray characters, malformed signal names). Review and clean up the source files before compiling.
Contributions are welcome and greatly appreciated!
Whether you'd like to fix a bug, improve documentation, optimize code, or add a new embedded systems project, your help is appreciated. you can also reach out via email at rseyednozadi@gmail.com. If you'd like to improve this project:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/booth-multiplier). - Make your changes (e.g. fix VHDL syntax issues, add a testbench, implement Booth's or Wallace Tree).
- Commit your changes with a clear message.
- Open a pull request describing what you changed and why.
This project is licensed under the MIT License. See the LICENSE file for details.