Sub topic 8
Normalized Binary Scientific Notation
Prerequisites
Assume you know decimal and binary place values, powers of two, and basic binary addition. You should also know that a binary point works like a decimal point: digits to its right represent negative powers of two.
The Working Form
Normalized binary scientific notation writes a nonzero binary number as
\[ \pm 1.f \times 2^e \]
Here, 1.f is the significand. The first digit is always 1, and f contains the remaining fractional bits. The exponent e records how far the binary point moved.
Normalization means moving the binary point until exactly one nonzero digit remains to its left. In binary, that digit must be 1.
For example:
\[ 1101.012 = 1.101012 \times 2^3 \]
The binary point moved three positions left, so the exponent is 3.
For a number smaller than one, the exponent is negative:
\[ 0.0011012 = 1.1012 \times 2^{-3} \]
The binary point moved three positions right, so the exponent is -3.
Converting a Binary Number
Use these steps:
- Find the first
1in the binary number. - Move the binary point to immediately after that
1. - Count the positions moved.
- Use a positive exponent for a leftward move and a negative exponent for a rightward move.
- Keep the remaining bits as the fractional part of the significand.
Consider 101101.11₂:
\[ 101101.112 = 1.01101112 \times 2^5 \]
The original point was after six digits. The normalized point is after the first digit, so it moved five places left.
To decode the form, reverse the process. For example:
\[ 1.0112 \times 2^4 = 101102 = 22_{10} \]
The exponent moves the binary point four places right.
def normalize_binary(bits, point):
"""bits contains only 0 and 1; point is the index of the binary point."""
first_one = bits.find("1")
if first_one == -1:
return "0.0 x 2^0"
exponent = point - first_one - 1
significand = bits[first_one] + "." + bits[first_one + 1:]
return f"{significand} x 2^{exponent}"
print(normalize_binary("10110111", 6)) # 1.0110111 x 2^5Why Normalization Matters
Normalization gives one standard representation for each nonzero value. It also allows a floating-point format to omit the leading 1. If the stored fraction is 01101, the format can interpret it as 1.01101. This hidden bit provides one extra bit of precision.
A normalized value has the structure shown below.
| Form | Meaning |
|---|---|
| `1.f × 2^e` | Normalized nonzero binary number |
| `1.101 × 2^3` | Binary point moves three places right when decoded |
| `1.101 × 2^-3` | Binary point moves three places left when decoded |
Common Errors
- Using the number of binary digits as the exponent instead of the number of point movements.
- Giving a positive exponent when the point moved right.
- Dropping significant trailing bits while moving the point.
- Treating
0as a normal number. Zero has no first1, so it needs a special representation in floating-point formats.
Exercise
Normalize 0.0001011₂ and state the exponent.
Show answer
1.011₂ × 2^-4. The binary point moves four places right.