- #1

arhzz

- 266

- 52

- Homework Statement
- 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.

- Relevant Equations
- -

Hello! (Note : I put the prefix as comp sci, since at my uni this is a computer science class but I am in EE so it could be put under both prefixes. If anyone feels its more appropriate as Engineering feel free to change)

So here is my attempt at the solution

The formula that we are given is ## (-1)^s*M*2^E ## where M is the mantissa and E is the exponent and s Sign

Since its single precision the mantissa should be 23 bits The smallest number the mantissa can have is 1, (followed by 23 0's) . So the value that follows this, is the smallest value that can be addead to the mantissa, hence we can find our epsilon as follows

## \epsilon = \frac{1}{2^{23}} = 2^{-23} = 1,19 * 10^{-7} ## (roughly)

I think this part should be correct;

Now for the second part I tried it like this.

b) The biggest value the mantissa can have is M = 1,(followed by 23 1's) and the biggest value the exponent have is 127 hence ## 2^{127}##

So now I can plug in the formula ## (-1)^s * M * 2^E = 1,89*10^{38} ## where S is either 0 or 1 for positive or negative

Now the answer should be ##3,40*10^{38} ## and I really dont see how they get to that solution. The power of 38 is correct which confuses me, because that would implie that the formula I am using is correct no?

Thanks for the help!

So here is my attempt at the solution

The formula that we are given is ## (-1)^s*M*2^E ## where M is the mantissa and E is the exponent and s Sign

Since its single precision the mantissa should be 23 bits The smallest number the mantissa can have is 1, (followed by 23 0's) . So the value that follows this, is the smallest value that can be addead to the mantissa, hence we can find our epsilon as follows

## \epsilon = \frac{1}{2^{23}} = 2^{-23} = 1,19 * 10^{-7} ## (roughly)

I think this part should be correct;

Now for the second part I tried it like this.

b) The biggest value the mantissa can have is M = 1,(followed by 23 1's) and the biggest value the exponent have is 127 hence ## 2^{127}##

So now I can plug in the formula ## (-1)^s * M * 2^E = 1,89*10^{38} ## where S is either 0 or 1 for positive or negative

Now the answer should be ##3,40*10^{38} ## and I really dont see how they get to that solution. The power of 38 is correct which confuses me, because that would implie that the formula I am using is correct no?

Thanks for the help!

Last edited by a moderator: