# Binary representation of real numbers

> CIE A-Level Computer Science · 9618
> Source: https://www.owlsprep.com/study/cie-9618-u1-binary-representation-of-real-numbers/

This sub-topic covers how non-integer (real) numbers are stored in binary, including fixed-point and floating-point formats, normalisation, and the key trade-off between range and precision of stored values.

**Prerequisites:** [Signed and unsigned binary integers](https://www.owlsprep.com/study/cie-9618-u1-binary-integers/); [Two's complement representation](https://www.owlsprep.com/study/cie-9618-u1-signed-binary/)

## Learning objectives

- Distinguish between fixed-point and floating-point binary representations
- Convert decimal real numbers to normalised floating-point binary
- Convert normalised floating-point binary back to decimal
- Explain the trade-off between range and precision based on bit allocation

## Fixed-Point Binary Representation

Fixed-point binary assigns a fixed number of bits to the integer part and a fixed number of bits to the fractional part of a real number. The binary point separates the two parts, just like a decimal point in base 10, with each position right of the point holding a negative power of 2 weight.

**Binary Point** — A separator that divides the integer part (left) from the fractional part (right) of a binary real number. Weights for positions right of the point are $2^{-1}, 2^{-2}, 2^{-3}...$

*Example:* For 0.101, the value is $0 \times 2^0 + 1 \times 2^{-1} + 0 \times 2^{-2} + 1 \times 2^{-3} = 0.625$

**Worked example:** Convert decimal 6.625 to 8-bit fixed-point binary, with 5 integer bits and 3 fractional bits

1. Split the number into integer (6) and fractional (0.625) parts, convert each separately
2. Convert integer 6 to 5-bit binary:
3. $$6 = 110 = 00110$$
4. Convert 0.625 by repeated multiplication by 2, taking the integer part of each result:
5. $$0.625 \times 2 = 1.25 \rightarrow 1 \\ 0.25 \times 2 = 0.5 \rightarrow 0 \\ 0.5 \times 2 = 1.0 \rightarrow 1$$
6. Combine the parts, with the binary point after the 5th bit: $00110.101$
7. Final 8-bit representation (removing the point for storage): 00110101

> **Exam tip:** Always confirm how many bits are assigned to each part in the question, do not mix up integer and fractional bit counts.

## Floating-Point Binary and Normalisation

Floating-point binary is similar to scientific notation in base 10. It splits a real number into two parts: the mantissa (which stores significant digits) and the exponent (which stores the position of the binary point). This allows for a much larger range of values than fixed-point for the same total number of bits.

**Normalised Floating-Point** — A standardised format for floating-point binary that removes redundant leading bits to maximise precision, and ensures one unique representation per value. For two's complement mantissas, the first two bits must be different.

**Worked example:** Normalise 001010 101 (6-bit mantissa, 3-bit exponent, both two's complement)

1. Original mantissa: 001010. First two bits are both 0, so it is not normalised.
2. Shift mantissa left by 1 place, which moves the binary point right by 1. We decrease the exponent by 1 to compensate.
3. Shifted mantissa: 010100. Original exponent 101 = -1 in 3-bit two's complement.
4. New exponent: -1 - 1 = -2 = 110 in 3-bit two's complement.
5. Check: first two bits of mantissa 01 are different, so correctly normalised.
6. Final normalised value: mantissa 010100, exponent 110

> **mnemonic**
>
> 01 positive, 10 negative: that's the normalisation rule for two's complement mantissas.

## Conversion Between Decimal and Normalised Floating-Point

To convert a decimal real number to normalised floating-point, you first convert it to plain binary, adjust it to normalised form, then split it into mantissa and exponent to match the required bit lengths. To convert back, reverse the process.

**Worked example:** Convert 10.25 to normalised floating-point with 8-bit mantissa and 4-bit exponent (both two's complement)

1. Convert 10.25 to plain binary: $1010.01$
2. Rewrite in normalised form: move binary point after the first bit: $1.01001 \times 2^3$
3. Fill 8-bit two's complement mantissa with significant bits: 0 1 0 1 0 0 1 0 → 01010010
4. Write exponent 3 as 4-bit two's complement: 0011
5. Check normalisation: first two bits 0 and 1 are different, so valid. Final result: 01010010 0011

**Check your understanding**

Test your conversion understanding:

1. What is the decimal value of normalised 100100 010 (6-bit mantissa, 3-bit exponent, both two's complement)?

   - -1.75
   - -2.25
   - 3.5
   - -0.75

   *Why:* Correct: Mantissa 100100 = -0.875, exponent 010 = 2, so $-0.875 \times 2^2 = -1.75$

## Range and Precision Trade-off

The number of bits allocated to the mantissa and exponent directly impacts two key properties of any floating-point system: the range of values that can be stored, and the precision of those stored values.

**Range and Precision** — Range is the span from the smallest (most negative) to largest (most positive) value that can be stored. Precision is how closely the stored binary value matches the original real value, determined by the number of significant bits available.

**Worked example:** Compare two 16-bit floating-point systems: System A (10-bit mantissa, 6-bit exponent) and System B (12-bit mantissa, 4-bit exponent). Which has larger range? Which has higher precision?

1. Range is determined by the length of the exponent. System A has a longer exponent, so it can store a larger range of values.
2. Precision is determined by the length of the mantissa. System B has a longer mantissa, so it can store values with higher precision and smaller rounding errors.

> **tip**
>
> Exam questions almost always ask this trade-off: remember more exponent = more range, more mantissa = more precision.

## Common pitfalls

- **Wrong:** Treating the exponent as an unsigned value when it is stored as two's complement
  - Why it fails: Most CIE questions use two's complement for both mantissa and exponent, so unsigned exponent gives an incorrect final result
  - Correct: Always confirm if the exponent is signed or unsigned, and convert it to the correct signed decimal before calculating the final value
- **Wrong:** Adjusting the exponent in the wrong direction when normalising
  - Why it fails: Shifting the mantissa left by 1 moves the binary point right by 1, so the exponent must decrease, not increase
  - Correct: After normalising, convert your final value back to decimal to confirm it matches the original number
- **Wrong:** Incorrect normalisation for negative two's complement mantissas, accepting leading 11 as valid
  - Why it fails: Students expect leading 1 for negative values, but normalisation requires the first two bits to be different
  - Correct: Follow the mnemonic: 01 for positive, 10 for negative, all other starting pairs are unnormalised
- **Wrong:** Swapping range and precision when describing the effect of changing bit allocation
  - Why it fails: Students often confuse which bit length affects which property
  - Correct: Use the memory hook: Exponent = Extent (Range), Mantissa = Measurement (Precision)
- **Wrong:** Forgetting to apply the negative sign of the mantissa when converting back to decimal
  - Why it fails: Students often convert only the magnitude of the mantissa and drop the sign for negative values
  - Correct: Always check the leading bit of the mantissa first, and apply the correct sign to the final result

## Cheatsheet

| Concept | Key Rule |
| --- | --- |
| Fixed-point | Fixed bits for integer/fractional parts, limited fixed range |
| Floating-point | Split into mantissa (significant digits) and exponent |
| Normalisation (two's complement) | Positive = 01..., Negative = 10..., maximises precision |
| More exponent bits | Increases range of storable values |
| More mantissa bits | Increases precision of stored values |
| Decimal → float steps | Convert to binary, normalise, split into mantissa + exponent |

## What's next

Binary representation of real numbers is a core foundational topic for CIE 9618 Paper 1, regularly tested with conversion questions and short explanations of the range-precision trade-off. Mastery of normalisation and conversion rules is critical to scoring full marks on these common questions. This topic also underpins further study of computer arithmetic, data storage, and digital media representation, where real number values are commonly processed and stored in floating-point formats. Next, you will expand your knowledge of information representation to cover other common data types used in computer systems.

- [Character encoding](https://www.owlsprep.com/study/cie-9618-u1-character-encoding/)
- [Binary representation of images](https://www.owlsprep.com/study/cie-9618-u1-binary-representation-of-images/)
- [Binary representation of sound](https://www.owlsprep.com/study/cie-9618-u1-binary-representation-of-sound/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/cie-9618-u1-binary-representation-of-real-numbers/
