Float Point Multiplier
Float Point Multiplier
Eduardo Sanchez
EPFL HEIG-VD
sign
mantissa
exponent
23
1 10000010 00110000000000000000000
Eduardo Sanchez
Multiplication algorithm
part, implicit in normalization. The number of bits of the result is twice the
size of the operands (48 bits)
normalization of the result: the exponent can be modified accordingly
addition of the exponents, taking into account the bias
calculation of the sign
Eduardo Sanchez
Example
Eduardo Sanchez
normalization
100100000000000000000000
100110000000000000000000
the 48-bit result of the multiplication is:
0x558000000000
only the most significant bits are useful: after normalization (elimination of
the most significant 1), we get the 23-bit mantissa of the result. This
normalization can lead to a correction of the result's exponent
in our case, we get:
01 01010110000000000000000 0000000000000000000000
Eduardo Sanchez
10000011
10000010
10000001
10000110
Eduardo Sanchez
Laboratory
Eduardo Sanchez
Solutions
A = 134.0625 = 1.00001100001x27
A = 0 10000110 00001100001000000000000 = 0x43061000
B = -2.25 = -1.001x21
B = 1 10000000 00100000000000000000000 = 0xC0100000
AxB = -301.640625 = -1.00101101101001x28
AxB = 1 10000111 00101101101001000000000 = 0xC396D200
A = -14.5 = -1.1101x23
A = 1 10000010 11010000000000000000000 = 0xC1680000
B = -0.375 = -1.1x2-2
B = 1 01111101 10000000000000000000000 = 0xBEC00000
AxB = 5.4375 = 1.010111x22
AxB = 0 10000001 01011100000000000000000 = 0x40AE0000
Eduardo Sanchez
10
A = 7.5 = 1.111x22
A = 0 10000001 11100000000000000000000 = 0x40F00000
B = 15.5 = 1.1111x23
B = 0 10000010 11110000000000000000000 = 0x41780000
AxB = 116.25 = 1.11010001x26
AxB = 0 10000101 11010001000000000000000 = 0x42E88000
Eduardo Sanchez
11
0
1
0
1
0
4
0
1
0
4
+
5
AxB
Eduardo Sanchez
12