1.1

Topic 1

Number systems

  • IGCSE Computer science 0478
  • 4 min read
  • Syllabus 2026, 2027 and 2028

Objectives

  1. 1

    Understand how and why computers use binary to represent all forms of data

  2. 2

    • aUnderstand the denary, binary and hexadecimal number systems
    • bConvert between (i) positive denary and positive binary (ii) positive denary and positive hexadecimal (iii) positive hexadecimal and positive binary
  3. 3

    Understand how and why hexadecimal is used as a beneficial method of data representation

  4. 4

    • aAdd two positive 8-bit binary integers
    • bUnderstand the concept of overflow and why it occurs in binary addition
  5. 5

    Perform a logical binary shift on a positive 8-bit binary integer and understand the effect this has on the positive binary integer

  6. 6

    Use the two’s complement number system to represent positive and negative 8-bit binary integers

Cambridge IGCSE Computer Science 0478 syllabus 2026-2028, 1.1 Number systems (copied for internal use as permitted by Cambridge)

Detailed · Deep study

1Why computers use binary

A computer's processor and memory are built from billions of tiny switches (transistors) arranged as logic gates and stored in registers. Each switch has only two states – on or off – which are represented by 1 and 0. So any data a computer processes – numbers, characters, sounds, images, instructions – must first be converted into binary.

2Denary, binary and hexadecimal

SystemBaseDigitsPlace values (right to left)
denary100–91, 10, 100, 1000, …
binary20, 11, 2, 4, 8, 16, 32, 64, 128, …
hexadecimal160–9, A–F1, 16, 256, 4096
Fig. 1Binary to denary: add the place values of the 1s.

Worked example

Denary to binary

Convert 200 to 8-bit binary.

  1. 1

    Subtract the largest place value that fits, working left to right.

    , ,

  2. 2

    Put 1 under 128, 64 and 8; 0 elsewhere.

Answer11001000

Fig. 2Each group of four bits is one hex digit.
DenaryBinaryHexadecimal
000000
910019
101010A
111011B
121100C
131101D
141110E
151111F

Worked example

Denary to hexadecimal

Convert 173 to hexadecimal.

  1. 1

    Divide by 16.

  2. 2

    10 → A, 13 → D.

AnswerAD

Worked example

Hexadecimal to binary

Convert 3F to binary.

  1. 1

    Each digit to 4 bits.

    3 → 0011, F → 1111

Answer00111111

3Why hexadecimal is used

Hexadecimal is a shorter way of writing binary: one hex digit replaces four bits, so it is easier for humans to read, write and remember, with fewer errors. The computer still stores binary.

Use of hexadecimalExample
colour codes in HTML/CSS#FF8000 (red FF, green 80, blue 00)
MAC addresses00:1A:2B:3C:4D:5E
memory dumps and debuggingshowing the contents of memory locations
error codese.g. 0x0000007B
IPv6 addresses2001:0db8:…

4Binary addition and overflow

Fig. 3Column addition with carries.
SumResultCarry
0 + 000
0 + 110
1 + 101
1 + 1 + 111

Add two 8-bit numbers column by column from the right, carrying 1 to the next column when needed. A device has a predefined limit for what it can store (8 bits: 0–255; 16 bits: 0–65 535). If the result is larger, the final carry has nowhere to go: an overflow error occurs and the stored answer is wrong.

5Logical binary shifts

Fig. 4Left and right shifts.
  • A logical left shift of places multiplies a positive number by ; a logical right shift divides by .
  • Bits shifted off the end of the register are lost; zeros are shifted in at the other end.
  • If a 1 is lost from the left (most significant bit), the multiplication is no longer correct; if a 1 is lost from the right, the division is not exact.

Worked example

Shift

Perform a logical left shift of two places on 00110101. What is the effect?

  1. 1

    Move every bit two places left; fill with zeros.

    11010100

  2. 2

    Check.

    53 → 212 = 53 × 4

Answer11010100; the value is multiplied by 4

6Two's complement

Fig. 5Negating a number.

In 8-bit two's complement the most significant bit has place value −128, so a 1 in that position means the number is negative. The range is −128 to +127.

  • Negative denary → two's complement: write the positive value in binary, flip every bit (0↔1), then add 1.
  • Two's complement → denary: add the place values, counting the MSB as −128.

Worked example

Convert to denary

Convert the two's complement number 10011010 to denary.

  1. 1

    Place values.

Answer−102

7Exam focus

Key words: binary; denary; hexadecimal; nibble; place value; MSB; LSB; overflow; logical shift; two's complement.

Quick self-check

Answer in your head first, then reveal.

  1. 174 (1).

  2. 00101101 (1).

  3. Shorter than binary / easier to read (1); fewer mistakes when writing or remembering (1).

  4. 1 00010011 (1); overflow – result 275 is greater than 255 (1).

  5. Divides by 8 (bits lost from the right) (1).

  6. 45 = 00101101 (1); flip 11010010, add 1: 11010011 (1).

Finished this subtopic? Track it on your subject page.