Study Guide

Number bases

CIE A-Level Computer ScienceΒ· Unit 1: Information RepresentationΒ· 15 min read

1. Place Value Notationβ˜…β˜†β˜†β˜†β˜†β± 5 min

πŸ“˜ Definition

Positional Number Base

A system of representing numbers where each digit's value is determined by both the digit itself and its position relative to the radix (decimal) point.

Example:

Base 10 uses 10 digits (0-9), base 2 uses 2 digits (0-1)

For any base , the rightmost digit before the radix point is the (units) place. Moving left, the exponent increases by 1 for each position. Moving right after the radix point, the exponent decreases by 1 for each position.

Value=βˆ‘i=0ndiΓ—bi+βˆ‘j=1mfjΓ—bβˆ’j\text{Value} = \sum_{i=0}^{n} d_i \times b^i + \sum_{j=1}^{m} f_j \times b^{-j}
πŸ“ Worked Example

Calculate the decimal value of

  1. 1

    Map each digit to its place value:

  2. 2
    (1Γ—23)+(0Γ—22)+(1Γ—21)+(1Γ—20)+(1Γ—2βˆ’1)(1 \times 2^3) + (0 \times 2^2) + (1 \times 2^1) + (1 \times 2^0) + (1 \times 2^{-1})
  3. 3

    Calculate each term:

  4. 4

    Sum all terms to get the final result:

2. Converting Whole Decimal Numbers to Other Basesβ˜…β˜…β˜†β˜†β˜†β± 5 min

To convert a whole decimal number to base , use the repeated division method: repeatedly divide the number by , collect each remainder, then read the remainders from last to first to get the converted number.

πŸ“ Worked Example

Convert 123 decimal to binary

  1. 1

    Repeatedly divide by 2 and collect remainders:

  2. 2

    120 Γ· 2 = 61 rem 1; 61 Γ· 2 = 30 rem 1; 30 Γ· 2 = 15 rem 0; 15 Γ· 2 = 7 rem 1; 7 Γ· 2 = 3 rem 1; 3 Γ· 2 = 1 rem 1; 1 Γ· 2 = 0 rem 1

  3. 3

    Read remainders from last to first:

βœ“ Quick check

Test your understanding:

  1. What is 47 decimal in hexadecimal?

    • 2B

    • 1F

    • 31

    • 2F

    Reveal answer
    2F β€”

    47 Γ· 16 = 2 remainder 15. 15 is represented as F, so the result is 2F, and 2 Γ— 16 + 15 = 47.

3. Converting Between Binary and Hexadecimalβ˜…β˜…β˜†β˜†β˜†β± 4 min

Because , there is a direct 1:1 mapping between hexadecimal digits and 4-bit binary groups (called nibbles). This makes conversion between the two bases extremely fast.

πŸ“ Worked Example

Convert to hexadecimal

  1. 1

    Add 1 leading zero to make the total number of bits divisible by 4, then group into 4-bit nibbles from the right:

  2. 2

    Map each nibble to its hex equivalent: 0011 = 3, 0101 = 5, 1011 = B

  3. 3

    Result:

πŸ“ Worked Example

Convert to binary

  1. 1

    Map each hex digit to 4 bits: 2 = 0010, A = 1010, C = 1100

  2. 2

    Concatenate the bits:

  3. 3

    Remove unnecessary leading/trailing zeros to get the simplified result:

Exam tip:

Always use this direct grouping method instead of converting via decimal, it saves significant time in exams.

4. Converting Fractional Decimal Numbers to Other Basesβ˜…β˜…β˜…β˜†β˜†β± 6 min

The whole number part of a mixed number uses the same division method as before. For the fractional part after the radix point, use the repeated multiplication method: repeatedly multiply the fractional part by , collect the whole number part of the result, then read the whole number parts from first to last. Stop when the fractional part becomes 0 or you reach the required precision.

πŸ“ Worked Example

Convert 0.625 decimal to binary

  1. 1

    Start with fractional part 0.625:

  2. 2

    0.625 Γ— 2 = 1.25 β†’ whole part = 1, new fractional part = 0.25

  3. 3

    0.25 Γ— 2 = 0.5 β†’ whole part = 0, new fractional part = 0.5

  4. 4

    0.5 Γ— 2 = 1.0 β†’ whole part = 1, new fractional part = 0 β†’ stop

  5. 5

    Read whole parts first to last:

5. Common Pitfalls

Wrong move:

Reading remainders in the order they were collected when converting whole decimal to another base

Why:

The first remainder obtained is the least significant (rightmost) digit, so order must be reversed

Correct move:

Collect remainders from last obtained to first obtained to get the correct number order

Wrong move:

Reversing the order of digits when converting decimal fractions to another base

Why:

The first whole part obtained is the most significant (leftmost) digit of the fractional part, so order stays the same

Correct move:

Write whole number parts from first obtained to last obtained for the fractional result

Wrong move:

Forgetting to add leading/trailing zeros when grouping binary digits for hex conversion

Why:

If the total number of bits is not a multiple of 4, grouping without padding produces wrong nibble values

Correct move:

Add leading zeros to the whole part and trailing zeros to the fractional part to make every group exactly 4 bits

Wrong move:

Using positive exponents for digits after the radix point

Why:

Digits after the point represent fractions of the base, so their place values use negative exponents

Correct move:

Use exponents starting at -1 for the first digit after the radix point

Wrong move:

Writing 10-15 as two digits in hexadecimal

Why:

Hexadecimal requires one single digit per place value, so 10-15 must be represented as A-F

Correct move:

Map decimal 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F, one character per digit

6. Quick Reference Cheatsheet

Conversion Type

Method

Any base β†’ Decimal

Multiply each digit by base^position, sum all terms

Whole decimal β†’ base b

Repeated division by b, read remainders last β†’ first

Fraction decimal β†’ base b

Repeated multiplication by b, read whole parts first β†’ last

Binary β†’ Hexadecimal

Group into 4-bit nibbles, map 1:1 to hex digits

Hexadecimal β†’ Binary

Map each hex digit to 4-bit binary, concatenate

7. Frequently Asked

Do I need to learn fractional number conversion?

Yes, CIE 9618 regularly assesses conversion of fractional numbers between bases, so you must master the multiplication method for fractional parts.

Why is hexadecimal used in computer science?

Hexadecimal is a compact human-readable representation of binary data: one hex digit equals 4 bits, so 1 byte is 2 hex digits, much easier to read than 8 binary digits. It is commonly used for memory addresses and color codes.

Do I need to write leading zeros for binary numbers?

You only need to add leading zeros if the question specifies a fixed bit length, e.g., 8-bit binary. Always follow the question requirements.

When this came up on past exams

AI-estimated based on syllabus patterns β€” cross-check with official past papers for accuracy. Use only as revision-focus signals.

  • 2022 Β· 1

    Decimal to binary conversion

  • 2023 Β· 1

    Binary to hexadecimal conversion

  • 2021 Β· 1

    Fractional decimal to binary conversion

Going deeper

What's Next

Number bases are the foundational building block for all information representation in computer science. Mastering conversion between bases is required to understand almost every subsequent topic, from binary arithmetic and negative number representation to memory addressing and character encoding. This topic is consistently assessed in Paper 1 of CIE 9618, often as the first question to test core foundational skills. Next, you will build on this knowledge to learn how different types of data (signed integers, floating points, text) are represented in binary.