I got this problem I have to solve where I have to multiply to floating point numbers (16 bit), but I have no way of double checking it. Any help is immensely appreciated.
Floating Point A: 0 11000 0111000000 Floating Point B: 0 11010 1011000000
I calculate the exponents:
A: 24-15=9 B: 26-15=11
Calculate mantissas (a & b):
(2^9*b) * (2^11*b) = 2^9+11 * (a*b) + 2^20 * (a*b)
Overflow, so I increase exponent of A to sane as B(11).
Then I shift mantissa of A in accordance with the calculation:
1.0111 > 0.10111 > 0.010111.
Then I multiply to get mantissa.
0.010111
* 1.101100
0000000
0000000
0010111
0010111
0000000
0010111
0010111_____
0.100110110100
I shift again.
0.100110110100 < 1.00110110100
Decrease exponent by 1, so it's 10.
Sign is 0, so it's positive number.
Answer: 0 01010 00110110100.
Is it correct?
Thanks in advance!
(2^9*b) * (2^11*b) = 2^9+11 * (a*b) + 2^20 * (a*b)
. You do not need to equalize the exponents to multiply: this is what you do to align the significands for addition and subtraction. – Pascal Cuoq