Binary Multiplication by Hand
In Section 2.2, we completed the core Arithmetic Logic Unit (ALU). This section analyzes two complex arithmetic datapath circuits: multipliers and barrel shifters. Multipliers are critical components in modern computing. Digital signal processing (DSP) filters, graphics rendering pipelines, and neural network inference engines execute billions of multiply-accumulate (MAC) operations per second. This article examines the mathematical foundations of binary long multiplication and analyzes how digital hardware generates and accumulates partial products.
Positional Long Multiplication in Binary
Manual decimal multiplication calculates partial products for each multiplier digit and sums the shifted rows. For example, multiply 23 by 47:
- Multiply 23 by 7 to obtain 161.
- Multiply 23 by 40 to obtain 920.
- Sum $161 + 920 = 1{,}081$.
Binary multiplication follows the identical positional algorithm. Because binary digits are strictly 0 or 1, generating a partial product requires no multi-digit multiplication:
- If multiplier bit $B_i = 1$, the partial product equals multiplicand $A$ shifted left by $i$ positions.
- If multiplier bit $B_i = 0$, the partial product equals zero.
A row of 2-input AND gates computes each partial product bit directly.
Step-by-Step Numerical Walkthrough ($6 \times 5 = 30$)
Consider multiplying multiplicand $A = 0110_2$ ($6_{10}$) by multiplier $B = 0101_2$ ($5_{10}$):
0110 (Multiplicand A = 6)
x 0101 (Multiplier B = 5)
--------
0110 A x B[0], shift 0 (PP0)
0000 A x B[1], shift 1 (PP1)
0110 A x B[2], shift 2 (PP2)
0000 A x B[3], shift 3 (PP3)
--------
00011110 Product P = 30
Table 1 details the partial product rows aligned to 8 bits:
| Bit Position ($i$) | Multiplier Bit ($B_i$) | Partial Product Term | 8-Bit Aligned Binary Row |
|---|---|---|---|
| 0 | 1 | $A \ll 0$ | 0000_0110 |
| 1 | 0 | $0 \ll 1$ | 0000_0000 |
| 2 | 1 | $A \ll 2$ | 0001_1000 |
| 3 | 0 | $0 \ll 3$ | 0000_0000 |
Summing the aligned binary rows yields: $$P = 0000_0110_2 + 0001_1000_2 = 0001_1110_2 = 16 + 8 + 4 + 2 = 30_{10}$$
The Mathematical Multiplier Equation
For an $N$-bit multiplicand $A$ and an $N$-bit multiplier $B$, multiplication is defined by:
$$P = A \times B = \sum_{i=0}^{N-1} B_i \cdot (A \ll i) = \sum_{i=0}^{N-1} \sum_{j=0}^{N-1} (A_j \cdot B_i) \cdot 2^{i+j}$$
This fundamental equation defines hardware multiplier architectures:
- Partial Product Generation: An $N \times N$ matrix of 2-input AND gates computes terms $P_{i,j} = A_j \cdot B_i$.
- Partial Product Accumulation: An adder reduction network accumulates the shifted partial product rows into a single binary product.
Word Width Expansion Rules ($2N$ Bits)
Multiplying two $N$-bit unsigned numbers produces a product up to $2N$ bits wide. The maximum value of an $N$-bit unsigned integer is $2^N - 1$:
$$(2^N - 1) \times (2^N - 1) = 2^{2N} - 2^{N+1} + 1$$
This maximum product exceeds $2^{2N-1} - 1$ and requires $2N$ binary bits. For example, two 4-bit numbers have a maximum product:
$$15_{10} \times 15_{10} = 225_{10} = 1110_0001_2 \quad (8 \text{ bits})$$
In Hardware Description Languages (such as Verilog), declare the product vector as [2*N-1:0].
Declaring an $N$-bit output truncates the upper $N$ bits, corrupting arithmetic results.
Hardware Partial Product Generation
An $N \times N$ multiplier produces $N$ partial product vectors. Hardware architectures differ in how they accumulate these vectors:
- Array Multiplier: Uses a two-dimensional grid of full adders to accumulate one partial product row per stage. The circuit is modular but exhibits $O(N)$ propagation latency.
- Wallace Tree Multiplier: Uses carry-save adder (CSA) trees to reduce partial products in parallel, reducing latency to $O(\log N)$.
- Booth Encoding: Recodes the multiplier operand to reduce the total number of partial products by half before accumulation.
Signed Two’s Complement Multiplication Overview
Unsigned multiplication rules do not apply directly to signed two’s complement operands because the most significant bit possesses negative arithmetic weight ($-2^{N-1}$). Signed multiplication techniques include:
- Baugh-Wooley Algorithm: Adjusts partial product sign bits algebraically so that standard unsigned carry-save adder trees can accumulate signed numbers.
- Radix-4 Modified Booth Algorithm: Recodes multiplier bits into signed digit set ${-2, -1, 0, +1, +2}$, reducing the number of partial products from $N$ to $\lceil N/2 \rceil$.
Practice Exercises
Problem 1: Perform binary long multiplication for $A = 1011_2$ ($11_{10}$) and $B = 0110_2$ ($6_{10}$). Show the aligned 8-bit partial products and verify the product in decimal.
View Solution
Generate the partial products:
- $B_0 = 0 \implies \text{PP}_0 = 0000_0000_2$.
- $B_1 = 1 \implies \text{PP}_1 = A \ll 1 = 0001_0110_2$.
- $B_2 = 1 \implies \text{PP}_2 = A \ll 2 = 0010_1100_2$.
- $B_3 = 0 \implies \text{PP}_3 = 0000_0000_2$.
Sum the active partial products: $$P = 0001_0110_2 + 0010_1100_2 = 0100_0010_2$$
Decimal Verification: $$0100_0010_2 = 64 + 2 = 66_{10}$$ Because $11 \times 6 = 66$, the binary multiplication is verified.
Problem 2: Determine the maximum product of two 6-bit unsigned integers and calculate the required output word width.
View Solution
- Maximum 6-bit value: $2^6 - 1 = 63_{10}$.
- Maximum product: $$63 \times 63 = 3{,}969_{10}$$
- Word width evaluation: $$2^{11} = 2{,}048 < 3{,}969 < 4{,}096 = 2^{12}$$
The product requires 12 bits ($2N = 2 \times 6 = 12$). The result spans bit range $P[11:0]$.
In the next article, we implement the Array Multiplier using an interconnected matrix of full adder cells.