Hello! Consider this homework problem
Consider the IEEE-754 format for Single Precision numbers. Provide your results in both IEEE-754 format (binary) and in decimal system.
a) Determine the smallest number ε such that 2 + ε > 2.
b) Determine the largest representable (positive or negative) number maxreal.
c) Determine the smallest representable (positive or negative) number minreal.
So what is actually confusing me is if a) is connected with b) and c). To elaborate, here is my attempt at solving these;
a) Since this is single precision the mantissa is 23 bits. Now to find epsilon we simply divide the smallest number the mantissa can have with 2^-23. The smallest number the mantissa can have is 1,000000000.0000
so I get for epsilon = 2^-23 = 1,19 * 10^-7 (roughly)
b) So for the maxreal (positive i tried the following) the leading bit (we called it so in class) s = 0 since we are positive,
for the exponent we have e = 127 and the biggest number we can represent with the mantissa M = 1,11111111111..111
so we use this formula -1^(s)*M*2^e so after plugging all of that in I get maxreal =1,89*10^38
for the negative it should simply be that s changes to 1 and the sign is now negative instead of positive;
Now I have not been able to verify if these are correct or not,and it seems to me that a) is not connected to b) and c) since they are simply applying the formulas we were given. Could anyone verify if this what I have written makes any sense?
Thanks!
Consider the IEEE-754 format for Single Precision numbers. Provide your results in both IEEE-754 format (binary) and in decimal system.
a) Determine the smallest number ε such that 2 + ε > 2.
b) Determine the largest representable (positive or negative) number maxreal.
c) Determine the smallest representable (positive or negative) number minreal.
So what is actually confusing me is if a) is connected with b) and c). To elaborate, here is my attempt at solving these;
a) Since this is single precision the mantissa is 23 bits. Now to find epsilon we simply divide the smallest number the mantissa can have with 2^-23. The smallest number the mantissa can have is 1,000000000.0000
so I get for epsilon = 2^-23 = 1,19 * 10^-7 (roughly)
b) So for the maxreal (positive i tried the following) the leading bit (we called it so in class) s = 0 since we are positive,
for the exponent we have e = 127 and the biggest number we can represent with the mantissa M = 1,11111111111..111
so we use this formula -1^(s)*M*2^e so after plugging all of that in I get maxreal =1,89*10^38
for the negative it should simply be that s changes to 1 and the sign is now negative instead of positive;
Now I have not been able to verify if these are correct or not,and it seems to me that a) is not connected to b) and c) since they are simply applying the formulas we were given. Could anyone verify if this what I have written makes any sense?
Thanks!