Skip to main content

Floating point multiplication

Short answer

Multiply mantissas, add exponents (e = ex + ey - bias). Sign = sx xor sy. Normalize product by shifting and adjust exponent. Example: 1.100×2² × 1.010×2¹ = 1.111×2³ = 15.

Explain the floating point multiplication algorithm with flowchart and example.

For X = mx × 2^ex and Y = my × 2^ey, the product is X × Y = (mx × my) × 2^(ex + ey). The mantissas are multiplied as fixed-point numbers and the exponents are added.

Algorithm

  1. Check for zero: if either operand is 0, the result is 0.
  2. Add the exponents: e = ex + ey. With biased exponents, subtract the bias once: e = ex + ey - bias.
  3. Sign of the result = sign(X) xor sign(Y).
  4. Multiply the mantissas (for example by Booth's algorithm or shift-and-add).
  5. Normalise the product (if the product mantissa is 10.xxx, shift right and add 1 to the exponent; if it has leading zeros, shift left and decrease the exponent).
  6. Round the mantissa and check for exponent overflow or underflow.
 Start
   |
 X = 0 or Y = 0? --yes--> result 0
   | no
 e = ex + ey - bias ; sign = sx xor sy
   |
 Multiply mantissas
   |
 Normalise and round
   |
 Exponent overflow/underflow? --yes--> error
   | no
  Stop

Example

X = 1.100 × 2² (6) and Y = 1.010 × 2¹ (2.5).

  • Exponent: 2 + 1 = 3.
  • Mantissas: 1.100 × 1.010 = 1.5 × 1.25 = 1.875 = 1.111 (already normalised).
  • Result = 1.111 × 2³ = 1.875 × 8 = 15. ✓ (6 × 2.5 = 15).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 5 questions →