Java Reference
In-Depth Information
According to this rule, the representation 0.1925 x 10 2 is the normalized form of 19.25 . The floating-point
number 19.25 (base 10 ) can be written as 10011.01 in binary form (base 2 ). The floating-point number 19.25 can be
rewritten in many different binary forms. Some of the alternate binary representations of decimal 19.25 are as follows:
10011.01 x 2 0
1001.101 x 2 1
100.1101 x 2 2
1.001101 x 2 4
100110.1 x 2 -1
1001101 x 2 -2
Note that in binary form the base is 2. When the binary point is shifted to the left by one digit, the exponent is
incremented by one. When the binary point is shifted to the right by one digit, the exponent is decremented by one.
A floating-point number in a binary form is normalized if its significand satisfies the following condition:
1 <= significand < 2
If the significand of a binary floating-point number is of the form 1.bbbbbbb... , where b is a bit (0 or 1), the
binary floating-point number is said to be in normalized form. Therefore, 1.001101 x 2 4 is the normalized form of
binary floating-point number 10011.01 . In other words, a normalized binary floating-point number starts with a bit 1,
immediately followed by a binary point.
The floating-point numbers, which are not normalized, are called denormalized floating-point numbers.
A denormalized floating-point number is also called denormal or subnormal. All floating-point numbers cannot be
represented in a normalized form. There could be two reasons for this.
The number does not contain any bit as 1. An example of this is 0.0. Since 0.0 does not have
any bit set as 1, it cannot be represented in the normalized form.
Computers use a fixed number of bits to store the sign, significand, and exponent of a binary
floating-point number. If the exponent of a binary floating-point number is the minimum
exponent allowed by the computer storage format and the significand is less than 1, such
a binary floating-point number cannot be normalized before storing it in computer. For
example, suppose that -126 is the minimum exponent value that can be stored in a given
storage format for a binary floating-point number. If the binary floating-point number is
0.01101 x 2 -126 , this number cannot be normalized. The normalized form of this number will
be 1.101 x 2 -128 . However, the given storage format allows minimum exponent as -126 (I have
assumed number -126 for this example). Therefore, the exponent -128 ( -128 < -126 ) cannot
be stored in the given storage format and that is why 0.01101 x 2 -126 cannot be stored in the
normalized form.
Why do we need to normalize a binary floating-point number before storing it in memory? The following are the
advantages of doing this:
The normalized representation is unique.
Because the binary point in a binary floating-point number can be placed anywhere in the
number, you must store the position of binary point along with the number. By normalizing
the number, you always place the binary point after the first 1 bit, and therefore, you need not
store the position of the binary point. This saves memory and time to store one extra piece of
information.
Two normalized binary floating-point numbers can be compared easily by comparing their
signs, significands, and exponents.
 
Search WWH ::




Custom Search