Binary numbers do not have to be whole numbers. Using fixed-point representation, a binary point divides integer bits on the left from fractional bits on the right. Each bit to the right of the point has a value of ½, ¼, ⅛, and so on — halving each time. This allows computers to store decimal fractions in binary.
What is the binary point?
Just as the decimal point in 3.14 separates the whole part (3) from the fractional part (0.14), a binary point separates the integer bits from the fractional bits in a binary number. The position of the binary point is agreed in advance by the system — that is what makes it "fixed" point.
The place values in binary extend on both sides of the binary point:
| Bit position | 8 | 4 | 2 | 1 | . | ½ | ¼ | ⅛ | 1/16 |
|---|---|---|---|---|---|---|---|---|---|
| Bit position label | 2³ | 2² | 2¹ | 2⁰ | — | 2⁻¹ | 2⁻² | 2⁻³ | 2⁻⁴ |
Each position to the right of the binary point is half the value of the position to its left — exactly mirroring how decimal fractions work, but in base 2 instead of base 10.
How do you convert a binary fraction to denary?
Method: Assign place values to each bit, then add up the values of all bits set to 1.
Example 1: Convert 0101.1010 to denary.
| Bit | 4 | 2 | 1 | — | ½ | ¼ | ⅛ | 1/16 |
|---|---|---|---|---|---|---|---|---|
| Value (if 1) | 4 | 2 | 1 | — | 0.5 | 0.25 | 0.125 | 0.0625 |
| Bit | 0 | 1 | 0 | 1 | . | 1 | 0 | 1 |
Wait — 0101.1010 has 4 bits before the point and 4 bits after:
- Integer part:
0101= 0 + 4 + 0 + 1 = 5 - Fractional part:
1010= ½ + 0 + ⅛ + 0 = 0.5 + 0.125 = 0.625
Answer: 5.625
Example 2: Convert 11.01 to denary.
11= 2 + 1 = 3.01= 0 + ¼ = 0.25
Answer: 3.25
How do you convert a denary fraction to binary?
To convert the fractional part of a denary number to binary, repeatedly multiply by 2 and record whether the result is 1 or more.
Method for the fractional part only:
- Multiply the fractional part by 2.
- If the result is ≥ 1, the next bit is 1 and subtract 1 before continuing.
- If the result is < 1, the next bit is 0.
- Repeat until the fractional part becomes 0 or you have enough bits.
Example: Convert 0.625 to binary.
| Step | Value | Multiply by 2 | Result | Bit |
|---|---|---|---|---|
| 1 | 0.625 | × 2 | 1.25 | 1 |
| 2 | 0.25 | × 2 | 0.5 | 0 |
| 3 | 0.5 | × 2 | 1.0 | 1 |
| 4 | 0.0 | — | Done | — |
Result: 0.101 in binary. Check: ½ + ⅛ = 0.5 + 0.125 = 0.625 ✓
Full conversion of 5.625:
- Integer 5 =
101in binary - Fraction 0.625 =
.101in binary - Combined: 101.101
What are the limitations of fixed-point representation?
Fixed-point representation has two important limitations:
Precision is fixed
The number of bits available for the fractional part determines how precisely a fraction can be stored. With 4 fractional bits, the smallest representable fraction is 1/16 = 0.0625. Numbers requiring more precision (e.g. 0.01) must be rounded to the nearest representable value, introducing a rounding error.
Some fractions cannot be represented exactly
Just as 1/3 cannot be expressed exactly as a decimal (0.333...), many decimal fractions cannot be expressed exactly in binary. The most notorious example is 0.1:
| Step | Value | × 2 | Bit |
|---|---|---|---|
| 1 | 0.1 | 0.2 | 0 |
| 2 | 0.2 | 0.4 | 0 |
| 3 | 0.4 | 0.8 | 0 |
| 4 | 0.8 | 1.6 | 1 |
| 5 | 0.6 | 1.2 | 1 |
| 6 | 0.2 | 0.4 | 0 |
| (repeats) |
0.1 in binary is 0.0001100110011… — a repeating pattern that never terminates. This is why adding 0.1 ten times in Python does not give exactly 1.0. This is not a bug in Python — it is an inherent limitation of binary fraction representation.
How does fixed-point compare with floating-point?
| Feature | Fixed-point | Floating-point |
|---|---|---|
| Binary point position | Fixed — agreed in advance | Variable — stored as an exponent |
| Range | Limited (fixed by format) | Very large or very small numbers possible |
| Precision | Uniform across all values | Higher for small numbers |
| Speed | Faster (simpler hardware) | Slower (more complex) |
| Use cases | Embedded systems, financial calculations, graphics | Scientific computing, general-purpose maths |
Floating-point representation (used in most modern computers for non-integer maths) is the GCSE and A-level extension of this topic. Fixed-point is conceptually simpler and forms the foundation.
Frequently asked questions
Why does Python give unexpected results when adding decimal fractions?
Because Python (like most languages) uses floating-point binary representation internally. 0.1 + 0.2 returns 0.30000000000000004 in Python — not exactly 0.3. This is because neither 0.1 nor 0.2 can be represented exactly in binary, so small rounding errors accumulate. For financial calculations requiring exact decimal arithmetic, Python's decimal module uses a different representation that avoids this problem.
How many bits do I need to represent a given precision?
With N fractional bits, the smallest representable fraction is 2^(−N). Four bits give you 1/16 precision; eight bits give 1/256 precision. To represent two decimal places exactly, you theoretically need enough bits to represent hundredths — but since most decimal fractions cannot be represented exactly in binary, precision in practice is always an approximation. You need more bits for better (but never perfect) precision with arbitrary decimals.
Is fixed-point still used today?
Yes, particularly in embedded systems and digital signal processing (DSP) chips where floating-point hardware is too expensive or power-hungry. Digital audio processing, graphics in games (particularly on older consoles), and microcontroller firmware often use fixed-point arithmetic for its speed and simplicity. Financial systems sometimes use fixed-point decimal arithmetic (not binary fixed-point) to avoid rounding errors in currency calculations.
How do I convert a mixed number like 6.75 to binary?
Convert the integer and fractional parts separately, then combine.
- Integer: 6 =
110 - Fraction: 0.75 → 0.75 × 2 = 1.5 (bit = 1, remainder 0.5) → 0.5 × 2 = 1.0 (bit = 1, done) →
.11 - Combined: 110.11
Check: 4 + 2 + 0.5 + 0.25 = 6.75 ✓
Work through binary fraction conversion questions with step-by-step hints from Professor Turing at aitutors.me.