PROJECTENGRAM

UNSIGNED MULTIPLICATION (ARRAY & SEQUENTIAL MULTIPLIERS)

Module 04: Unsigned Multiplication (Array & Sequential Multipliers)

Tags: #◇Computer Science #◇CSARCH2 #◇Computer Architecture #◇Hardware Modeling #◇Unsigned Multiplication (Array & Sequential Multipliers)


◇Overview

Binary multiplication forms the mathematical core of scientific computing, graphics rasterization, signal processing, and memory address indexing. This module examines the hardware realization of unsigned binary integer multiplication. We analyze pure combinational Array Multipliers constructed from AND gate arrays and adder reduction matrices, evaluating their critical path delays and silicon area complexity. Furthermore, we formalize the microarchitectural mechanics of Sequential Multipliers, detailing register datapath configurations (A,Q,M,CA, Q, M, C), control state machines, and cycle-by-cycle execution traces.

◇Key Definitions

  • Multiplicand (MM): The number being multiplied (nn bits).
  • Multiplier (QQ): The number by which the multiplicand is multiplied (nn bits).
  • Partial Product: The intermediate result generated by multiplying the entire multiplicand MM by a single bit of the multiplier QiQ_i, shifted left by ii bit positions.
  • Bit Product: The boolean AND combination of two individual bits (pij=Mj⋅Qip_{ij} = M_j \cdot Q_i).
  • Array Multiplier: A purely combinational circuit consisting of a grid of AND gates producing partial product bits, reduced through a two-dimensional matrix of Half Adders and Full Adders.
  • Sequential Multiplier: A sequential synchronous hardware datapath that computes the 2n2n-bit product over nn consecutive clock cycles using a single nn-bit adder, shift registers, and a down-counter.
  • Carry Flip-Flop (CC): A 1-bit register that captures the carry-out generated during the addition of the multiplicand to the accumulator (A←A+MA \leftarrow A + M).
  • Logical Shift Right (LSRLSR): A shift operation where all bits shift right by one position, the carry bit CC shifts into the MSb of the accumulator (An−1A_{n-1}), the LSb of AA (A0A_0) shifts into the MSb of QQ (Qn−1Q_{n-1}), and a 0 enters CC.

◇Theoretical Framework / Core Concepts

1. Mathematical Formulation of Unsigned Multiplication

Let M=∑j=0n−1Mj2jM = \sum_{j=0}^{n-1} M_j 2^j and Q=∑i=0n−1Qi2iQ = \sum_{i=0}^{n-1} Q_i 2^i be two nn-bit unsigned integers. Their product PP is a 2n2n-bit unsigned integer:

P=M×Q=M×(∑i=0n−1Qi2i)=∑i=0n−1(M⋅Qi)2iP = M \times Q = M \times \left( \sum_{i=0}^{n-1} Q_i 2^i \right) = \sum_{i=0}^{n-1} (M \cdot Q_i) 2^i

『』
TEXT
Paper-and-Pencil Multiplication (4-bit Example):
              M3   M2   M1   M0    (Multiplicand M)
       x      Q3   Q2   Q1   Q0    (Multiplier Q)
       ------------------------
            M3Q0 M2Q0 M1Q0 M0Q0    (Partial Product 0)
       M3Q1 M2Q1 M1Q1 M0Q1   0     (Partial Product 1 << 1)
  M3Q2 M2Q2 M1Q2 M0Q2   0    0     (Partial Product 2 << 2)
+ M3Q3 M2Q3 M1Q3 M0Q3   0    0    0(Partial Product 3 << 3)
------------------------------------------------------------
  P7   P6   P5   P4   P3   P2   P1   P0  (8-bit Product)

Each single-bit product MjQiM_j Q_i is computed with a single 2-input AND gate because:
Mj⋅Qi={Mjif Qi=10if Qi=0M_j \cdot Q_i = \begin{cases} M_j & \text{if } Q_i = 1 \\ 0 & \text{if } Q_i = 0 \end{cases}

2. Combinational Array Multiplier Architecture

An n×nn \times n array multiplier uses an n×nn \times n grid of AND gates to generate all n2n^2 bit products in parallel, feeding into a matrix of adders:

『』
TEXT
4x4 Array Multiplier Topology:
         M3       M2       M1       M0
          |        |        |        |
Q0 -------+--------+--------+--------+---> [Row 0: 4 AND Gates] ---------> P0
          |        |        |        |
Q1 -------+--------+--------+--------+---> [Row 1: 4 AND Gates + 4 Adders] -> P1
          |        |        |        |
Q2 -------+--------+--------+--------+---> [Row 2: 4 AND Gates + 4 Adders] -> P2
          |        |        |        |
Q3 -------+--------+--------+--------+---> [Row 3: 4 AND Gates + 4 Adders] -> P3
                                                    |
                                                    v
                                          [P7, P6, P5, P4]

Hardware & Complexity Analysis:

  • AND Gate Count: Exactly n2n^2 gates.
  • Adder Count: n(n−1)n(n - 1) Full/Half Adders (nn Half Adders in the first stage, n(n−2)n(n-2) Full Adders in subsequent stages).
  • Silicon Area: Scales quadratically as O(n2)O(n^2).
  • Critical Path Latency:
    tcritical=tAND+(n−1)tcarry+(n−1)tsum≈O(n)t_{\text{critical}} = t_{\text{AND}} + (n - 1) t_{\text{carry}} + (n - 1) t_{\text{sum}} \approx O(n)

Trade-off: High speed (computes result in 1 combinational clock cycle), but prohibitive silicon area cost for large word sizes (e.g., 64-bit multiplier requires 4,096 AND gates and over 4,000 adders).

3. Sequential Circuit Multiplier Architecture

To conserve hardware area, the sequential multiplier uses a single nn-bit parallel adder and reuses registers over nn clock cycles:

『』
TEXT
+--------------------------------------------------------------------------+
|                     SEQUENTIAL MULTIPLIER DATAPATH                       |
|                                                                          |
|       +------------------------------------+                             |
|       |     Multiplicand Register (M)      | (n bits)                    |
|       +------------------------------------+                             |
|                          |                                               |
|                          v                                               |
|               +----------------------+                                   |
|               |   n-bit CLA Adder    |                                   |
|               +----------------------+                                   |
|                          ^                                               |
|                          |                                               |
|                          v                                               |
|  +---+      +-------------------------+      +-------------------------+ |
|  | C | ---> | Accumulator Register (A)| ---> | Multiplier Register (Q) | |
|  |1b |      | (n bits, init to 0)     |      | (n bits, holds Q)       | |
|  +---+      +-------------------------+      +-------------------------+ |
|    ^                     |                                |       |      |
|    |                     +------- Logical Shift Right <---+       |      |
|    |                                (LSR)                         |      |
|    |                                                              v      |
|    +-------------------- Control Logic <---------------------- [ Q0 ]    |
|                          (Counter = n)                                   |
+--------------------------------------------------------------------------+

Algorithm Execution Flow (Per Clock Cycle):

  1. Test LSB of Multiplier (Q0Q_0):
    • If Q0=1Q_0 = 1: Add multiplicand to accumulator:
      [C,A]←A+M[C, A] \leftarrow A + M
    • If Q0=0Q_0 = 0: No addition occurs (AA remains unchanged, C←0C \leftarrow 0).
  2. Logical Shift Right (LSRLSR):
    • Shift the combined composite register [C,A,Q][C, A, Q] right by 1 bit:
      Qi←Qi+1,Qn−1←A0,Ai←Ai+1,An−1←C,C←0Q_i \leftarrow Q_{i+1}, \quad Q_{n-1} \leftarrow A_0, \quad A_i \leftarrow A_{i+1}, \quad A_{n-1} \leftarrow C, \quad C \leftarrow 0
  3. Loop Control:
    • Decrement the cycle counter: Count←Count−1\text{Count} \leftarrow \text{Count} - 1.
    • If Count≠0\text{Count} \neq 0, repeat from Step 1.
    • When Count=0\text{Count} = 0, the 2n2n-bit product resides across registers [A,Q][A, Q] (where AA contains the upper nn bits and QQ contains the lower nn bits).

◇Worked Examples / Calculations / Hardware Traces

Example 1: 4-Bit Sequential Multiplier Execution Trace

Problem: Multiply unsigned 4-bit integers M=10112 (1110)M = 1011_2\ (11_{10}) and Q=11012 (1310)Q = 1101_2\ (13_{10}) using the sequential shift-and-add hardware multiplier. Show the complete cycle-by-cycle register trace table.

Solution:

  • Multiplicand M=10112M = 1011_2
  • Initial state: C=0C = 0, A=00002A = 0000_2, Q=11012Q = 1101_2, Count=4\text{Count} = 4.
  • Expected final product: 11×13=14310=(10001111)211 \times 13 = 143_{10} = (10001111)_2.

Execution Trace Table:

CycleOperationCCAAQQCountNotes
0Initialization0000011014Load M=1011M=1011, Q=1101Q=1101, clear A,CA, C
1Q0=1  ⟹  A←A+MQ_0 = 1 \implies A \leftarrow A + M01011110140000+1011=10110000 + 1011 = 1011, no carry (C=0C=0)
LSR [C,A,Q][C, A, Q]0010111103Shift right 1 bit
2Q0=0  ⟹  No AddQ_0 = 0 \implies \text{No Add}0010111103Q0=0Q_0 = 0, skip addition
LSR [C,A,Q][C, A, Q]0001011112Shift right 1 bit
3Q0=1  ⟹  A←A+MQ_0 = 1 \implies A \leftarrow A + M01101111120010+1011=11010010 + 1011 = 1101, C=0C=0
LSR [C,A,Q][C, A, Q]0011011111Shift right 1 bit
4Q0=1  ⟹  A←A+MQ_0 = 1 \implies A \leftarrow A + M10001111110110+1011=100012  ⟹  C=1,A=00010110 + 1011 = 10001_2 \implies C=1, A=0001
LSR [C,A,Q][C, A, Q]0100011110C=1C=1 shifts into A3A_3; Count reaches 0
  • Final Register Contents:
    • A=10002A = 1000_2 (High 4 bits)
    • Q=11112Q = 1111_2 (Low 4 bits)
    • Combined Product [A,Q]=100011112[A, Q] = 10001111_2
  • Decimal Verification:
    100011112=128+8+4+2+1=1431010001111_2 = 128 + 8 + 4 + 2 + 1 = 143_{10}
    11×13=14310✓11 \times 13 = 143_{10} \quad \checkmark

Example 2: Critical Path Delay Comparison (Array vs Sequential)

Problem: An engineering team evaluates building a 32-bit unsigned multiplier:

  • Option A: Combinational Array Multiplier where tAND=0.2 nst_{\text{AND}} = 0.2\text{ ns}, tcarry=0.3 nst_{\text{carry}} = 0.3\text{ ns}, tsum=0.4 nst_{\text{sum}} = 0.4\text{ ns}.
  • Option B: Sequential Multiplier running at 1.5 GHz1.5\text{ GHz} (Tclk=0.667 nsT_{\text{clk}} = 0.667\text{ ns}), taking 32 clock cycles.

Calculate the total multiplication latency for both implementations.

Solution:

  • Option A (Array Multiplier):
    tArray=tAND+(n−1)tcarry+(n−1)tsumt_{\text{Array}} = t_{\text{AND}} + (n - 1) t_{\text{carry}} + (n - 1) t_{\text{sum}}
    tArray=0.2 ns+(31×0.3 ns)+(31×0.4 ns)=0.2+9.3+12.4=21.9 nst_{\text{Array}} = 0.2\text{ ns} + (31 \times 0.3\text{ ns}) + (31 \times 0.4\text{ ns}) = 0.2 + 9.3 + 12.4 = 21.9\text{ ns}

  • Option B (Sequential Multiplier):
    tSequential=32×Tclk=32×0.667 ns=21.34 nst_{\text{Sequential}} = 32 \times T_{\text{clk}} = 32 \times 0.667\text{ ns} = 21.34\text{ ns}

Analysis: While both yield similar total latencies (≈21.5 ns\approx 21.5\text{ ns}), Option B requires less than 5%5\% of the silicon area, freeing up die area for on-chip caches.

◇Complexity Analysis / Common Pitfalls

  • Applying Unsigned Multipliers to Signed Negative Numbers: A critical error is attempting to multiply negative 2's complement numbers using this unsigned shift-and-add algorithm. Because negative numbers have leading 1s (due to sign weight −2n−1-2^{n-1}), treating them as unsigned leads to grossly incorrect positive results. Signed multiplication requires Booth's algorithm or sign-correction logic.
  • Forgetting to Capture Carry in Flip-Flop CC: In sequential multiplier hardware, when A+M≥2nA + M \ge 2^n, the generated carry bit CC must be shifted into the MSB of AA during the subsequent LSR. Discarding CC results in truncation errors.
  • Logical vs. Arithmetic Shift Right: Sequential unsigned multiplication strictly requires a Logical Shift Right (inserting 0 into CC), whereas signed multiplication requires an Arithmetic Shift Right (retaining the sign bit).

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

In an nn-bit sequential unsigned multiplier, what is the size of the final product and where is it stored?

Q2

How many 2-input AND gates are required to construct an n×nn \times n combinational array multiplier?

Q3

During cycle kk of an unsigned sequential multiplication, the multiplier bit Q0=0Q_0 = 0. What action does the hardware datapath perform?

Q4

Why can an unsigned sequential multiplier not be used directly on negative 2's complement integers?

Q5

If an 8-bit sequential multiplier operates at a clock frequency of 500 MHz500\text{ MHz}, how long does it take to compute an 8-bit ×\times 8-bit multiplication?