Sub topic 8
Normalized binary scientific notation
This chapter assumes you can convert between decimal and binary, including fractions such as 0.101b. It also assumes you can move a binary point by multiplying or dividing by powers of two. Floating-point formats store numbers in normalized form, so you need to produce and read that form before you can encode IEEE 754 fields.
Why scientific notation at all
Decimal scientific notation writes 6020 as 6.02 × 10³ and 0.000602 as 6.02 × 10⁻⁴. The digits stay the same and an exponent says where the point goes. Binary does the same thing with powers of two:
- 110.1b = 1.101b × 2²
- 0.0101b = 1.01b × 2⁻²
Moving the binary point left by k places multiplies the exponent by 2ᵏ, so you add k to the exponent. Moving it right by k places means you subtract k.
The normalized form
A nonzero binary number is normalized when it is written as
± 1.f × 2ᵉ
- The significand (also called the mantissa) is the part 1.f. It has exactly one nonzero digit before the binary point.
- In binary the only nonzero digit is 1, so the leading digit is always 1.
- f is the fraction: the bits after the binary point.
- e is the exponent, an ordinary signed integer.
The significand therefore always lies in the range 1 ≤ m < 2. The largest value is just under 2, for example 1.1111b. Normalization gives every nonzero number one unique representation. Without it, 6.5 could be written as 110.1 × 2⁰, 11.01 × 2¹, 1.101 × 2² or 0.1101 × 2³, and hardware could not compare or store these forms consistently.
| Form | Binary significand | Exponent | Normalized? |
|---|---|---|---|
| 110.1 × 2⁰ | 110.1 | 0 | No, three digits before the point |
| 11.01 × 2¹ | 11.01 | 1 | No, two digits before the point |
| 1.101 × 2² | 1.101 | 2 | Yes |
| 0.1101 × 2³ | 0.1101 | 3 | Not in the 1.f convention |
Normalizing by hand
Use this procedure for any positive number:
- Convert the integer part and the fraction part to binary separately.
- Write them together with the binary point between them.
- Find the leftmost 1.
- Move the binary point to just after that 1. Count the places moved.
- Moving left by k gives exponent +k. Moving right by k gives exponent −k.
- The bits after the new point form the fraction f. Drop trailing zeros if you like.
- Record the sign separately. Normalize the absolute value.
Example 1: a number greater than 1
Normalize 10.75.
- 10 = 1010b and 0.75 = 0.11b, so 10.75 = 1010.11b.
- The leftmost 1 is in the 8s place. The point must move 3 places left.
- 10.75 = 1.01011b × 2³.
Check: 1.01011b = 1 + 1/4 + 1/16 + 1/32 = 1.34375, and 1.34375 × 8 = 10.75.
Example 2: a number less than 1
Normalize 0.34375.
- 0.34375 = 0.01011b, because 1/4 + 1/16 + 1/32 = 0.34375.
- The leftmost 1 is the second place after the point. The point moves 2 places right.
- 0.34375 = 1.011b × 2⁻².
Check: 1.375 × 0.25 = 0.34375.
Example 3: a fraction that never ends
Normalize 0.1.
- 0.1 in binary is 0.0001100110011…b, and the group 0011 repeats forever.
- The leftmost 1 is the fourth place after the point, so the exponent is −4.
- 0.1 = 1.100110011…b × 2⁻⁴ = 1.6 × 2⁻⁴.
The significand 1.6 has an infinite binary expansion, so a format with a finite number of fraction bits must round it. The pitfalls chapter returns to this.
The hidden bit
Every normalized significand starts with 1, so storing that bit wastes space. Formats such as IEEE 754 store only f and let the hardware supply the leading 1. This is the hidden bit (or implicit leading bit). A format with 23 stored fraction bits then has 24 bits of precision. Remember this count, because many GATE questions depend on whether the hidden bit is included.
A program to check your work
Python's math.frexp returns a fraction in [0.5, 1) and an exponent. Doubling the fraction and subtracting 1 from the exponent gives the 1.f convention.
import math
def normalize(x):
"""Return (significand, exponent) with 1 <= |significand| < 2."""
if x == 0:
raise ValueError("zero has no normalized form")
m, e = math.frexp(abs(x))
return math.copysign(m * 2, x), e - 1
print(normalize(10.75)) # (1.34375, 3)
print(normalize(0.15625)) # (1.25, -3)
print(normalize(-6.5)) # (-1.625, 2)The second line agrees with the hand method: 0.15625 = 0.00101b, and moving the point 3 places right gives 1.01b × 2⁻³, where 1.01b = 1.25.
Edge cases and common errors
- Zero cannot be normalized. No leftmost 1 exists. Floating-point formats reserve a special bit pattern for zero.
- Very small numbers. Normalization demands an exponent that may be below what the format can store. Such numbers need a different, unnormalized treatment. This is covered with denormalized numbers.
- Counting the shift the wrong way. A common slip is to give 0.01011b a positive exponent. A number below 1 has a negative exponent, because the point moves right.
- Normalizing before converting the sign. In sign-and-magnitude style formats the sign is a separate bit. Normalize |x|, then set the sign bit. Do not apply 2's complement to the significand.
- Off-by-one in shifts. For 1010.11b the point moves past three digits (the 0, 1 and 0 that follow the leading 1), so the exponent is 3, not 4. The exponent equals the number of integer bits minus 1.
- Mixing conventions. IEEE 754 uses 1.f. Some textbook and GATE questions define a custom format with the significand as 0.1f, meaning the value is 0.1f × 2ᵉ. The same number then has an exponent one larger. For 6.5, the 1.f form gives 1.101 × 2², and the 0.1f form gives 0.1101 × 2³. Always read the definition given in the question.
- Forgetting the hidden bit. If a question says the mantissa field has 23 bits and the leading 1 is implicit, the precision is 24 bits. If the leading bit is stored explicitly, the precision is 23 bits.
Normalized numbers and range
Fixing the form 1.f × 2ᵉ makes the value of a stored number depend on two independent choices. The number of fraction bits sets the precision, meaning how many significant bits you keep. The allowed range of e sets the magnitude. With p bits of precision, the gap between neighbouring numbers is 2ᵉ × 2^−(p−1), so the gap grows with the exponent. The spacing between floating-point numbers is not uniform, which is the main contrast with fixed-point numbers.
Summary of the working rules
- Normalized means ± 1.f × 2ᵉ with 1 ≤ significand < 2.
- The exponent is the signed count of places the point moved: left is positive, right is negative.
- The leading 1 can be left unstored, which is the hidden bit.
- Zero has no normalized form.
- Confirm the convention (1.f or 0.1f) and whether the leading bit counts toward precision.
Exercise
Write -20.5 in normalized binary scientific notation. Give the sign, the exponent and the fraction bits f.
Show answer
20.5 = 10100.1b. The leftmost 1 has 4 bits after it in the integer part, so the point moves 4 places left. 20.5 = 1.01001b × 2⁴. The sign is negative (sign bit 1), the exponent is 4, and f = 01001. Check: 1.28125 × 16 = 20.5.
Exercise
Normalize 0.1875 first as 1.f × 2ᵉ and then in the convention 0.1f × 2ᵉ.
Show answer
0.1875 = 0.0011b, since 1/8 + 1/16 = 0.1875. In the 1.f convention the point moves 3 places right, giving 1.1b × 2⁻³ (check: 1.5 × 0.125 = 0.1875). In the 0.1f convention, write it as 0.11b × 2⁻² (check: 0.75 × 0.25 = 0.1875). The 0.1f exponent is always one larger than the 1.f exponent.