You are on page 1of 8

3/7/2012

Floating Point Multiply Algorithms


by Kelvin Bidwell

IEEE 754-2008
Arithmetic Formats Interchange Formats Rounding Rules Operations Exceptions

3/7/2012

Arithmetic Formats
Finite Numbers

Base 2 or Base 10 Sign bit Significand Exponent

Infinities Not A Number (NaN)


Quiet NaN (qNaN) Signaling NaN (sNaN)

Interchange Formats
(-1)sign bit x Significand x (Base)Exponent Basic

Binary 16, 32, 64, 128 Decimal 32, 64, 128

Extended

3/7/2012

Rounding Rules
Roundings to nearest

Ties to even
Nearest LSB zero

Ties away from zero


Round up for + numbers, down for numbers

Directed Roundings

Round toward 0 Round toward + Round toward -

Operations
Arithmetic Operations

Add, Subtract, Multiply, Divide, Remainders, etc...

Conversions Sign Manipulations Comparison

3/7/2012

Exceptions
Invalid Operation Division by zero Overflow Underflow Inexact

Floating Point Multiplication


Long Multiplication Booth's Algorithm Lattice Multiplication Peasant Multiplication Karatsuba Multiplication Toom-Cook Multiplication

3/7/2012

Binary Coded Decimal


BCD-8421 0 1 2 3 4 5 6 7 8 9 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 BCD-5421 0000 0001 0010 0011 0100 1000 1001 1010 1011 1100 BCD-4221 0000 0001 0010 | 0100 0011 | 0101 1000 | 0110 1001 | 0111 1010 | 1100 1011 | 1101 1110 1111 BCD-5211 0000 0001 | 0010 0100 | 0011 0101 | 0110 0111 1000 1001 | 1010 1100 | 1011 1110 | 1101 1111

Signed Digit Radix-10


Recoding [0,9] to [-5,5] Simplifies the generation of partial products

3/7/2012

Multiples for SD Radix-10

3/7/2012

Floating Point Multiplier

3/7/2012

Sources
http://people.wallawalla.edu/~curt.nelson/cptr350/lecture/chapter3.pdf http://en.wikipedia.org/wiki/IEEE_754-2008 http://en.wikipedia.org/wiki/Booth%27s_multiplication_algorithm http://en.wikipedia.org/wiki/Multiplication_algorithm http://en.wikipedia.org/wiki/Horner_scheme#Floating_point_multiplicati on_and_division http://www.cs.berkeley.edu/~krioukov/dflpMult.pdf http://www2.lirmm.fr/arith18/papers/vazquez-DecimalMultiplier.pdf

You might also like