Computer Architechture: Size of Mantissa

  • Thread starter Thread starter wclawson
  • Start date Start date
  • Tags Tags
    Computer
AI Thread Summary
The discussion focuses on floating-point representation, specifically determining the size of the mantissa given the ratio Xmax/Xmin=2^4096. Participants clarify that with a 32-bit floating-point number, 12 bits are allocated for the exponent, leaving 19 bits for the mantissa, which does not include the leading one in the normalized form. It is noted that using a mantissa of 0.xxx instead of 1.xxx reduces the number of representable values by half but does not affect the range of values. The maximum number that can be represented is discussed, emphasizing the importance of binary representation over decimal. The conversation concludes with a reference to the IEEE 754 standard for further reading on floating-point formats.
wclawson
Messages
17
Reaction score
0

Homework Statement


Floating Point representation:
Given Xmax/Xmin=2^4076, what is the size of the mantissa? How many numbers can exist?
If mantissa is 0.xxx instead of 1.xxx, how many numbers can exist?

Homework Equations



(-1)S x 1.M x BE

The Attempt at a Solution



I'm not sure, but is this the correct method to use?
{(-1)-S'(1.M')(BE'-E'')+(-1)-S''(1.M'')}BE''
 
Physics news on Phys.org
wclawson said:

Homework Statement


Floating Point representation:
Given Xmax/Xmin=2^4076, what is the size of the mantissa? How many numbers can exist?
If mantissa is 0.xxx instead of 1.xxx, how many numbers can exist?

Homework Equations



(-1)S x 1.M x BE

The Attempt at a Solution



I'm not sure, but is this the correct method to use?
{(-1)-S'(1.M')(BE'-E'')+(-1)-S''(1.M'')}BE''

Do you have a typo in your given information about Xmax/Xmin? The exponent should be 4096, I believe. 4096 = 212, which means 12 bits for the exponent of your floating point number.

You didn't mention how many bits there are overall in your floating point number, but the typical sizes are 32 bits, 64 bits, and sometimes 80 bits. If 1 bit is used for the sign, and 12 bits for the exponent, how many bits are left for the mantissa?

If the mantissa is assumed to be 1.xxx rather than 0.xxx, how many bits do you save by doing this?
 
Mark44 said:
Do you have a typo in your given information about Xmax/Xmin? The exponent should be 4096, I believe. 4096 = 212, which means 12 bits for the exponent of your floating point number.

You didn't mention how many bits there are overall in your floating point number, but the typical sizes are 32 bits, 64 bits, and sometimes 80 bits. If 1 bit is used for the sign, and 12 bits for the exponent, how many bits are left for the mantissa?

If the mantissa is assumed to be 1.xxx rather than 0.xxx, how many bits do you save by doing this?

Yes, thank you for noticing my mistake it should be 4096.

So a FP number with 32 bits would have 32-12-1=19 bits, but does that include the 1 preceding the M (1.M)?

By having 0.xx instead of .xx, does that mean that only half the amount of numbers represented with 1.xx can be used? What is it's effect of number range?
 
wclawson said:
Yes, thank you for noticing my mistake it should be 4096.

So a FP number with 32 bits would have 32-12-1=19 bits, but does that include the 1 preceding the M (1.M)?
No, it doesn't. That bit is assumed to be 1, and this gives you an extra bit for the mantissa.
wclawson said:
By having 0.xx instead of .xx, does that mean that only half the amount of numbers represented with 1.xx can be used? What is it's effect of number range?
Yes. There's no effect on the range, as xmin and xmax are still the same. It gives you a little more precision though.
 
Mark44 said:
No, it doesn't. That bit is assumed to be 1, and this gives you an extra bit for the mantissa.
Yes. There's no effect on the range, as xmin and xmax are still the same. It gives you a little more precision though.

Ok, I see. Let me make sure I have this straight.

Since there are 12 bits for E, that means the bias is 2047.
Therefore the largest number possible to display is 22047 times 1.9999... (from the mantissa), right?
 
wclawson said:
Ok, I see. Let me make sure I have this straight.

Since there are 12 bits for E, that means the bias is 2047.
I think this is right.
wclawson said:
Therefore the largest number possible to display is 22047 times 1.9999... (from the mantissa), right?
It wouldn't be 1.9999... The representation is binary, not decimal. It would be 1.1111...111, with 20 1's after the binary point. (Remember, that leading one to the left of the binary point is assumed.)
 
Mark44 said:
I think this is right.
It wouldn't be 1.9999... The representation is binary, not decimal. It would be 1.1111...111, with 20 1's after the binary point. (Remember, that leading one to the left of the binary point is assumed.)

Sorry, I should have said 1.9, written in base 10. For finding the max number, this rounds to 2 and is multiplied by the largest exponent (22047)?

Thanks, you have been a huge help.
 
Last edited:
Sure, you're welcome!

Here's a link to some related material on the IEEE 754 standard for floating point matters. This particular page is about 32-bit floats, similar to but not identical to what you're doing. http://en.wikipedia.org/wiki/Binary32
 
Back
Top