Module 05: Signed Multiplication (Booth's & Extended Booth's Algorithm)
Tags: #◇Computer Science #◇CSARCH2 #◇Computer Architecture #◇Hardware Modeling #◇Signed Multiplication (Booth's & Extended Booth's Algorithm)
◇Overview
Multiplying signed integers in 2's complement representation poses distinct architectural challenges because the Most Significant Bit (MSB) carries a negative positional weight (). Simple shift-and-add algorithms fail for negative operands without cumbersome sign-extension corrections. This module analyzes the mathematical foundations of signed multiplication, beginning with paper-and-pencil 2's complement multiplication. We then formalize Booth's Algorithm (Radix-2), which treats contiguous blocks of
1s as single algebraic operations, and Extended Booth's Algorithm (Radix-4 Bit-Pair Recoding), which halves the required adder cycles and partial products by inspecting three multiplier bits simultaneously.
◇Key Definitions
- Radix-2 Booth's Recoding: A technique that encodes an -bit multiplier into signed digits by inspecting adjacent bit pairs , transforming consecutive sequences of additions into a single addition and a single subtraction.
- Extended Booth's Algorithm (Radix-4 Bit-Pair Recoding): An optimized multiplication algorithm that evaluates triplets of overlapping multiplier bits to generate multiplier factors in the set , reducing total partial products to .
- Flip-Flop: An implicit 1-bit register appended to the right of the multiplier register , initialized to
0, used to store the bit shifted out of the multiplier during Arithmetic Shift Right. - Arithmetic Shift Right (): A shift operation that moves all bits of the composite register one position to the right while replicating the sign bit () in , preserving the mathematical sign of negative 2's complement numbers.
- String Property of 1s: The mathematical identity showing that a contiguous run of
1s from position to () can be evaluated as:
◇Theoretical Framework / Core Concepts
1. The Challenge of Signed 2's Complement Multiplication
Let and be -bit 2's complement numbers. The multiplier is formally expressed as:
If is negative (), its MSB must be subtracted rather than added:
Paper-and-Pencil Rules for Signed Multiplication:
- Every intermediate partial product must be sign-extended to the full -bit result width.
- If the multiplier is negative, the final partial product corresponding to the MSB () must be subtracted (by adding the 2's complement of , ).
Paper-and-Pencil Example: (-5) x (+3) in 4-bit (Product = -15, 8-bit):
M = 1011 (-5)
Q = 0011 (+3)
-------------------------------------------------
1 1 1 1 1 0 1 1 (Partial Product 0: M * 1, sign extended to 8 bits)
1 1 1 1 0 1 1 0 (Partial Product 1: M * 1 << 1, sign extended)
0 0 0 0 0 0 0 0 (Partial Product 2: M * 0 << 2)
0 0 0 0 0 0 0 0 (Partial Product 3: M * 0 << 3)
-------------------------------------------------
1 1 1 1 0 0 0 1 (8-bit 2's complement = -15 in decimal) (Correct!)
2. Booth's Algorithm (Radix-2)
Booth's algorithm takes advantage of the fact that a sequence of ones:
can be replaced by two operations:
Hardware Datapath Setup:
- Accumulator (): bits, initialized to
00...0. - Multiplier (): bits, holds .
- Implicit Bit (): 1 bit, initialized to
0. - Multiplicand (): bits, holds .
- ALU: Capable of and ().
- Counter: Initialized to .
+-------------------------------------------------------------------------+
| BOOTH'S MULTIPLIER DATAPATH |
| |
| +-----------------------------------+ |
| | Multiplicand Register (M) | |
| +-----------------------------------+ |
| | |
| v |
| +-----------------------+ |
| | ALU Adder/Subtractor | |
| +-----------------------+ |
| ^ |
| | |
| v |
| +-----------------------+ +-----------------------+ +--+ |
| |Accumulator Register(A)| ---> |Multiplier Register(Q) | ---> |Q | |
| | (n bits, init 0) | | (n bits, holds Q) | |-1| |
| +-----------------------+ +-----------------------+ +--+ |
| | | | | | |
| +-------+--- Arithmetic Shift Right --+-------+------------+ |
| (ASR: sign bit A_{n-1} replicated) | | |
| v v |
| Control Logic <------------------------------ [ Q0 , Q-1 ] |
+-------------------------------------------------------------------------+
Radix-2 Decision Table:
| Algebraic Interpretation | Datapath Action | ||
|---|---|---|---|
0 | 0 | String of zeros / no transition | Do nothing; ASR |
0 | 1 | End of a run of ones () | ; then ASR |
1 | 0 | Beginning of a run of ones () | ; then ASR |
1 | 1 | Middle of a run of ones | Do nothing; ASR |
3. Extended Booth's Algorithm (Radix-4 Bit-Pair Recoding)
Standard Booth's algorithm requires clock cycles for an -bit operand. Extended Booth's Algorithm groups multiplier bits in sets of three overlapping bits: for .
Radix-4 Bit Grouping (8-bit Multiplier Example):
Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 | Q_{-1}
[ Triplet 3 ] |
[ Triplet 2 ] |
[ Triplet 1 ] |
[ Triplet 0 ] | (init Q_{-1}=0)
Bit-Pair Recoding Formulation:
Radix-4 Recoding Table:
| Recoded Multiplier Factor | Hardware Operation | |||
|---|---|---|---|---|
0 | 0 | 0 | Add | |
0 | 0 | 1 | Add | |
0 | 1 | 0 | Add | |
0 | 1 | 1 | Add (Shift left 1 bit) | |
1 | 0 | 0 | Subtract (Add 2's complement of ) | |
1 | 0 | 1 | Subtract (Add 2's complement of ) | |
1 | 1 | 0 | Subtract (Add 2's complement of ) | |
1 | 1 | 1 | Add |
Advantages of Radix-4:
- Halves the number of adder iterations to .
- and are generated by a simple 1-bit hardwired left shift of or , requiring no complex multiplication hardware.
◇Worked Examples / Calculations / Hardware Traces
Example 1: Booth's Algorithm (Radix-2) Execution Trace ()
Problem: Multiply signed 4-bit numbers and using Radix-2 Booth's algorithm. Show the complete step-by-step register trace. Expected product: (8-bit 2's complement).
Setup:
- Multiplicand
- Two's complement of :
- Initial state: , , , .
Execution Trace Table:
| Step | Condition () | Operation | Count | |||
|---|---|---|---|---|---|---|
| Init | — | Clear ; Load | 0000 | 0011 | 0 | 4 |
| 1 | 0110 | 0011 | 0 | 4 | ||
| ASR | 0011 | 0001 | 1 | 3 | ||
| 2 | No arithmetic operation | 0011 | 0001 | 1 | 3 | |
| ASR | 0001 | 1000 | 1 | 2 | ||
| 3 | () | 1011 | 1000 | 1 | 2 | |
| ASR | 1101 | 1100 | 0 | 1 | ||
| 4 | No arithmetic operation | 1101 | 1100 | 0 | 1 | |
| ASR | 1110 | 1110 | 0 | 0 |
- Final 8-bit Result: .
- Decimal Verification:
Example 2: Extended Booth's (Radix-4) Bit-Pair Recoding Calculation
Problem: Multiply 6-bit signed integers and using Radix-4 Bit-Pair Recoding. Expected product: .
Solution:
-
Recode Multiplier with appended :
- Triplet 0 (): Bits
- Triplet 1 (): Bits
- Triplet 2 (): Bits
-
Compute Multiples of :
-
Sum Partial Products (Shifted by 2 bits per stage):
『』TEXTStage 0 (-2M * 4^0): 1 1 1 1 1 1 0 1 0 1 1 0 Stage 1 (+2M * 4^1): 1 1 1 0 1 0 1 0 - - - - (000000101010 << 2) Stage 2 (-1M * 4^2): 1 0 1 0 1 1 - - - - - - (111111101011 << 4) -------------------------------------------------------------------- Sum (12-bit Result): 1 1 1 1 0 0 1 0 1 1 1 0_2 -
Verify Decimal Value of :
- Invert:
- Add 1:
- Value:
◇Complexity Analysis / Common Pitfalls
- Logical Shift Right vs. Arithmetic Shift Right: The single most common failure in implementing Booth's algorithm is performing a Logical Shift Right () instead of an Arithmetic Shift Right (). In , bit must be copied to itself so that negative numbers retain their leading ones.
- Off-by-One Bit Triplet Grouping in Radix-4: In Extended Booth's recoding, students often create non-overlapping triplets instead of overlapping triplets . Triplet 0 must always include as its rightmost bit.
- Sign Extension of Multiplicand in ALU: During or , arithmetic must be carried out across the full -bit register width without dropping the MSB carry/overflow until occurs.
◇References & Navigation
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
In Radix-2 Booth's algorithm, what hardware action is taken when the bit pair ?
What is the primary performance advantage of Extended Booth's (Radix-4) multiplication over standard Booth's (Radix-2) multiplication?
In Radix-4 Extended Booth's recoding, what operation corresponds to the multiplier bit triplet 011?
What is the initial value of the flip-flop at the start of Booth's algorithm?
Why does Booth's algorithm perform Arithmetic Shift Right () rather than Logical Shift Right ()?