Pregunta

From Significand entry in Wikipedia :

When working in binary, the significand is characterized by its width in binary digits (bits). Because the most significant bit is always 1 for a normalized number, this bit is not typically stored and is called the "hidden bit". Depending on the context, the hidden bit may or may not be counted towards the width of the significand. For example, the same IEEE 754 double precision format is commonly described as having either a 53-bit significand, including the hidden bit, or a 52-bit significand, not including the hidden bit. The notion of a hidden bit only applies to binary representations. IEEE 754 defines the precision, p, to be the number of digits in the significand, including any implicit leading bit (e.g. precision, p, of double precision format is 53).

Why the most significant bit is always 1 for a normalized number ? Can some one please explain with an example ?

¿Fue útil?

Solución

This is not entirely true, there is no leading 1 for special values like 0, NaN, Infinity and denormal values.

But yes, when it is a "sane" number then you can always rewrite it so that the mantissa starts with 1. Simply by incrementing the exponent. The equivalent exists in decimal as well, you can always write a number so that it starts with a single non-zero digit if the value is not zero:

  0.5 = 5.0 E-01
  0.05 = 5.0 E-02
  50 = 5.0 E+01
  500 = 5.0 E+02
  etcetera.

With the distinction that this single digit will be 1 in binary. So it doesn't have to be stored, in can be inferred. Which buys one extra bit of precision. Attractive enough to complicate the floating point processor logic to restore that 1 in calculations.

Otros consejos

The only digits in binary are 0 and 1, and leading zeros are not significant (e.g. 1101 is the same as 00001101, the extra zeros add nothing). Therefore the most significant digit must be a 1, as that is the only other possibility.

Since you know the most significant bit must be 1, you can omit it without any loss of information. This is useful as it allows you to get an extra bit of precision.

The exception to this is the number 0, but this is handled in floating point (along with other special cases like NaN and +/- infinity) by setting the biased exponent to 0.

Leading zeroes carry no useful information in any representation of a number so they do not need to be stored. In a binary representation the left-most significant digit will always, therefore, be a 1 and need not be stored either, it can be assumed to be present.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top