Following the bit-level floating point coding rules, implement the floating-poin
ID: 3887573 • Letter: F
Question
Following the bit-level floating point coding rules, implement the floating-point add and multiply function with the following prototype. — typedef unsigned float_bits;float_bits float_add (float_bits x, float_bits y) ; float_bits float_multiply (float_bits x, float_bits y) ; Following the bit-level floating point coding rules, implement the floating-point add and multiply function with the following prototype. — typedef unsigned float_bits;
float_bits float_add (float_bits x, float_bits y) ; float_bits float_multiply (float_bits x, float_bits y) ; — typedef unsigned float_bits;
float_bits float_add (float_bits x, float_bits y) ; float_bits float_multiply (float_bits x, float_bits y) ;
Explanation / Answer
n this case, X is 1.01 X 22 and Y is 1.11 X 20.
For now, the resulting exponent is 2 + 0 = 2
Multiplying 1.01 by 1.11 results in 10.0011
Now, we have to renormalize 10.0011 to 1.00011 and increase the exponent by 1 to 3
The sign bit is 0 + 0 = 0.
We need to truncate 1.00011 x 23 to 1.000 x 23 and convert.