hastings
- 80
- 0
Consider a floating point binary notation with 16 bits. From left to right, it consists of 1bit for the sign (0= "+"), e bits for the exponent represented in Excess~2^{e-1} and the remaining bits for the decimal part of the mantissa, normalized between 1 and 2 (1 \leq m <2).
a) Calculate the minimum value e_{min} of the exponent that allows us to write in the above notation, both the numbers r= -8147.31 and
s= 0.103 \cdot 10^{-6};
This is what I would do.
1. Calculate the order of magnitude of both r and s
2. Write a proportion knowing that 2^{10} \approx 10^3 (like say 10:3= x: 4, considering 4 the result of point 1. ).
3. Find x from the above proportion and find the highest power of 2 which includes x (like say x=15, 2^3 \leq 15 \leq 2^4, I'd take 2^4)
4. Calculate e_{min}: since it's in excess 2^{e-1}, I solve the equation 2^4=2^{e-1} \Rightarrow e=e_{min}=4+1=5, where 2^4 is the result of point 3.
Is this resoning right?
Now, when I went to calculate the order of magnitude of r and s, I got that
Ord of Magn r=10^4, better say 4.
Ord of Magn s=10^{-5} better say -5.
Which should I consider as a starting point, 10^4 \mbox{ or } 10^{5} ?
a) Calculate the minimum value e_{min} of the exponent that allows us to write in the above notation, both the numbers r= -8147.31 and
s= 0.103 \cdot 10^{-6};
This is what I would do.
1. Calculate the order of magnitude of both r and s
2. Write a proportion knowing that 2^{10} \approx 10^3 (like say 10:3= x: 4, considering 4 the result of point 1. ).
3. Find x from the above proportion and find the highest power of 2 which includes x (like say x=15, 2^3 \leq 15 \leq 2^4, I'd take 2^4)
4. Calculate e_{min}: since it's in excess 2^{e-1}, I solve the equation 2^4=2^{e-1} \Rightarrow e=e_{min}=4+1=5, where 2^4 is the result of point 3.
Is this resoning right?
Now, when I went to calculate the order of magnitude of r and s, I got that
Ord of Magn r=10^4, better say 4.
Ord of Magn s=10^{-5} better say -5.
Which should I consider as a starting point, 10^4 \mbox{ or } 10^{5} ?
Last edited: