Week 5First TermMonday 5 October 2026 to Friday 9 October 2026

Number Systems and Data Representation

Understanding Number Systems; Binary Number System; Converting Decimal to Binary; Octal Number System; Hexadecimal Number System; ASCII and Character Codes; Unicode; Representing Images; Representing Sound; Representing Video; Measuring File Sizes; Practical Exercises; How Computers Represent Data; Number Conversions with Worked Examples; Representing Characters, Images, Pixels and Colour Depth

Print lesson pack
On this page18 sections
  1. 01Learning Objectives
  2. 02Understanding Number Systems
  3. 03Binary Number System
  4. 04Converting Decimal to Binary
  5. 05Octal Number System
  6. 06Hexadecimal Number System
  7. 07ASCII and Character Codes
  8. 08Unicode
  9. 09Representing Images
  10. 10Representing Sound
  11. 11Representing Video
  12. 12Measuring File Sizes
  13. 13Practical Exercises
  14. 14How Computers Represent Data
  15. 15Number Conversions with Worked Examples
  16. 16Representing Characters, Images, Pixels and Colour Depth
  17. 17Practical Work
  18. 18Scenario-Based Questions

Learning Objectives

  • Explain place value in the decimal, binary, octal and hexadecimal systems.
  • Convert numbers between decimal, binary and hexadecimal.
  • Explain how characters, images and sound are represented.
  • Use the units that measure file sizes.

Understanding Number Systems

A number system is a way of writing numbers using a fixed set of symbols called digits and a base (the radix). The base tells how many digits the system uses and what each position is worth. The four common systems are binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Number systems matter because computer hardware can only recognise two states, on and off; every value it stores must first be turned into patterns of 0s and 1s, so binary is the native language of computing and the other systems are shorthand ways of writing it.

The table below introduces the four systems.

Binary Number System

Binary uses only the digits 0 and 1, and each position is worth a power of 2, working from the right, namely 1, 2, 4, 8, 16, 32, 64, 128. To convert binary to decimal, add the place values that carry a 1, so binary 1101 = 8 + 4 + 1 = 13, binary 10110 = 16 + 4 + 2 = 22, and binary 1100100 = 64 + 32 + 4 = 100.

Converting Decimal to Binary

To convert decimal to binary, divide the number repeatedly by 2, write down the remainder each time and stop when the quotient becomes 0, then read the remainders from bottom to top. For decimal 25, 25/2 = 12 r 1, 12/2 = 6 r 0, 6/2 = 3 r 0, 3/2 = 1 r 1, 1/2 = 0 r 1, giving binary 11001. For 100 the remainders give 1100100. Check your answer by adding the place values back, for example 16 + 8 + 1 = 25.

Octal Number System

Octal uses the digits 0 to 7, and each position is worth a power of 8, namely 1, 8, 64, 512. To convert octal to decimal, multiply each digit by its place value, for example octal 52 = (5 x 8) + 2 = 42. Because 8 equals 2 to the power of 3, each octal digit represents exactly three binary bits, so binary converts to octal by grouping the bits in threes from the right, so binary 110101 gives 110 and 101, which are 6 and 5, so it is octal 65. To convert decimal to octal, divide by 8 and read the remainders bottom to top, so decimal 63 becomes octal 77.

Hexadecimal Number System

Hexadecimal uses the digits 0 to 9 and the letters A to F, where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Each position is worth a power of 16, namely 1, 16, 256, 4096. To convert to decimal, multiply each symbol by its place value, for example 2A = (2 x 16) + 10 = 42, and FF = (15 x 16) + 15 = 255. Because 16 equals 2 to the power of 4, binary converts to hex by grouping bits in fours from the right, so binary 110101 gives 0011 and 0101, which is hex 35. To convert decimal to hex, divide by 16, so decimal 200 becomes C8, because 200/16 = 12 r 8 and the digit 12 is C.

Hexadecimal is used everywhere because it is compact; one byte, eight bits, is exactly two hex digits, so memory addresses and error codes are far shorter than in binary. Web colour codes such as #FF5733 and debugger memory dumps are also hexadecimal.

ASCII and Character Codes

A computer does not store letters directly; it stores numbers. ASCII, the American Standard Code for Information Interchange, assigns a number to each character. Standard ASCII uses 7 bits and can represent 128 characters, including English letters, digits, punctuation and control codes. Extended ASCII uses 8 bits, one byte, reaching 256 characters. The letter A is decimal 65 (binary 01000001), lowercase a is 97, and the digit 0 is 48. The gap between an uppercase letter and its lowercase form is always 32, which makes case conversion easy.

Unicode

ASCII can only cover English and a few symbols, so Unicode gives a unique number to every character in every writing system, over 140,000 characters today, including Yoruba, Hausa, Igbo, Arabic, Chinese and emoji. Unicode is backwards compatible with ASCII; the first 128 code points are identical. Common forms are UTF-8, which uses 1 to 4 bytes per character, and UTF-16 and UTF-32.

Representing Images

An image is stored as a grid of dots called pixels. Resolution is the number of pixels, written as width x height, so a 1024 x 768 image has 786,432 pixels. Colour depth is the number of bits per pixel; 1 bit gives black and white, 8 bits give 256 colours, and 24 bits give millions. File size = pixels x colour depth, so a 1024 x 768 image at 24 bits is 786,432 x 24 = 18,874,368 bits, about 2,359,296 bytes, roughly 2.4 MB. Higher resolution or colour depth means a sharper but larger image.

Representing Sound

Sound is captured by sampling the wave many times per second. Sampling rate is the number of samples per second (a music CD uses 44,100), bit depth is the bits per sample (16 on a CD), and channels is the number of sound tracks. File size = sampling rate x bit depth x channels x time. One minute of stereo CD audio is 44,100 x 16 x 2 x 60 = 84,672,000 bits, about 10 MB. Higher values give better quality but bigger files.

Representing Video

Video stores a sequence of frames and displays a new one at every frame rate, usually 24 to 30 per second. File size before compression = resolution x colour depth x frame rate x duration. A short video is therefore much larger than a photo because it is hundreds of pictures per second, which is why compression is essential.

Measuring File Sizes

Digital data is measured in bits and bytes. A bit is a single 0 or 1, and a byte is 8 bits, enough for one character. Because computers count in binary, larger units multiply by 1024 (2 to the power of 10), not by 1000, so 1 Kilobyte (KB) = 1024 bytes, 1 Megabyte (MB) = 1024 KB, 1 Gigabyte (GB) = 1024 MB, 1 Terabyte (TB) = 1024 GB and 1 Petabyte (PB) = 1024 TB. Some manufacturers use 1000 when labelling devices, which is why a new drive can show less space than advertised.

Practical Exercises

Test yourself with these problems before the Week 10 assessment.

Convert these binary numbers to decimal, 1010, 11011 and 100000.

Convert these decimal numbers to binary, 18, 37 and 121.

Convert octal 63 and octal 106 to decimal.

Convert decimal 49 and decimal 130 to hexadecimal.

Give the decimal codes for the letters A, a and the digit 0 in ASCII.

State whether each unit equals 1000 or 1024 times the previous unit.

Calculate the size in bytes of an 800 x 600 photo at 24-bit colour.

Estimate the size in megabytes of a 3-minute song with 44,100 samples per second, 16-bit and stereo.

How Computers Represent Data

A computer represents all data using a fixed-length binary pattern. The smallest unit is the bit, which holds a single 0 or 1. Eight bits grouped together form one byte, and a byte is the basic unit used to represent one character such as the letter A. Larger quantities are measured in kilobytes, megabytes, gigabytes and terabytes.

Fixed-length representation means the group of bits set aside for a value keeps a constant size. For example, one byte always holds eight bits, even if the number stored needs only three. This arrangement makes hardware simpler and faster, because the processor always knows where one unit begins and the next ends.

The choice of a fixed pattern also explains why computers use base 2. A transistor has two stable states, on and off, which map naturally to 1 and 0. By grouping many such switches, a computer stores any amount of data, from a single keystroke to a full-length video.

A bit is the smallest unit and holds one 0 or 1.

A byte is eight bits and represents one character.

Storage units grow by multiples of 1024 from the byte upward.

Fixed-length groups keep the processor simple and predictable.

Number Conversions with Worked Examples

Converting between number systems follows two systematic methods. To convert any base to decimal, multiply each digit by its positional value and add the results. To convert from decimal to any base, divide repeatedly by the target base and read the remainders from bottom to top.

Example one: convert binary 11010 to decimal. The place values from the right are powers of 2: 1, 2, 4, 8 and 16. The calculation is (1 times 16) + (1 times 8) + (0 times 4) + (1 times 2) + (0 times 1) = 26 in decimal.

Example two: convert decimal 255 to hexadecimal. Dividing by 16 gives 15 remainder 15, and 15 in hexadecimal is the letter F, so the answer is hex FF. Example three: convert octal 245 to decimal. The place values are 64, 8 and 1, giving (2 times 64) + (4 times 8) + (5 times 1) = 165 in decimal.

Use positional multiplication to convert any base to decimal.

Use repeated division with remainder recording to convert decimal to another base.

Group binary bits in threes for octal and fours for hexadecimal.

Representing Characters, Images, Pixels and Colour Depth

Beyond ASCII and Unicode, computers also encode images as binary data. A digital image is built from a grid of small dots called pixels. Each pixel stores a colour value, and the set of all pixel values together forms the complete picture.

Colour depth is measured in bits per pixel. A 1-bit image shows only black and white. An 8-bit image can display 256 colours. A 24-bit image uses 8 bits for each of the red, green and blue channels, giving over 16 million colours. Web designers meet this idea when they write hex colour codes such as FF0000 for pure red.

Unicode assigns a unique code point to every character across the world writing systems, including Latin, Arabic, Chinese and emoji. Where ASCII supports only 128 characters in 7 bits, Unicode currently maps well over a million code points. A Nigerian user typing in English or Hausa sees the same text reliably on a phone, a computer and a website because all three devices agree on the Unicode standard.

Pixels are the tiny picture elements that make up a digital image.

Colour depth decides how many colours each pixel can show.

24-bit colour supports over 16 million colours for realistic photos.

Unicode covers all world scripts, while ASCII covers English and basic symbols only.

Number systemBaseDigits usedUsed by computers?
Binary20 and 1Yes - the native language of computers
Octal80 to 7Compact grouping of binary
Decimal100 to 9For humans, not computers
Hexadecimal160 to 9, A to FCompact grouping of binary
TermMeaning
Number systemA way of writing numbers using a fixed set of digits and a base
Base (radix)The number of unique digits a system uses and the value of each position
BinaryBase 2 system using only 0 and 1, the native language of computers
OctalBase 8 system using digits 0 to 7
DecimalBase 10 system using digits 0 to 9, used by humans
HexadecimalBase 16 system using 0 to 9 and A to F
BitThe smallest unit of data, a single 0 or 1
Byte8 bits, enough to store one character
ASCIIA 7-bit or 8-bit code that numbers characters
UnicodeA code that numbers characters from every writing system
UTF-8A Unicode form using 1 to 4 bytes per character
PixelA single dot in a digital image
ResolutionThe number of pixels across and down an image
Colour depthThe number of bits used to store each pixel
Sampling rateThe number of sound samples captured per second
Bit depthThe number of bits used for each sound sample
Frame rateThe number of video frames displayed per second
Kilobyte1024 bytes
Megabyte1024 kilobytes
Gigabyte1024 megabytes
Terabyte1024 gigabytes
Petabyte1024 terabytes

Practical Work

  1. Convert the decimal number 45 to binary and to hexadecimal.
  2. Write the ASCII code for the letter A in binary.
  3. Explain how a colour image is stored using pixels.
  4. Arrange bit, byte, kilobyte, megabyte and gigabyte in order.

Scenario-Based Questions

  1. A student is asked to convert the binary number 1101 to decimal. Show the conversion step by step and give the answer.
  2. A web designer writes a colour as #FF5733 instead of a long run of binary digits. Explain why hexadecimal is more compact than binary for such codes, and calculate the decimal value of the first pair, FF, to show that two hex digits represent one byte (8 bits).
  3. A student types the letter A on a keyboard. Explain how the computer stores this character internally using ASCII, giving the decimal code, and explain why ASCII alone cannot represent Yoruba text.
  4. A camera captures an image at 1920 x 1080 resolution with 24-bit colour depth. Calculate the uncompressed file size in bytes and convert it to megabytes.
  5. A music streaming service records a song at 44,100 samples per second, 16-bit depth and stereo. Explain what each of these three values means and estimate the size of a three-minute recording before compression.
  6. A programmer says the hexadecimal value 2A equals decimal 42. Show the conversion to verify this claim, and explain why a computer scientist would prefer to write 2A instead of 00101010.
  7. A student confuses kilobytes (KB) with kilobits (Kb). Explain the difference between a bit and a byte, state whether KB equals 1000 or 1024 bytes, and explain why a new hard drive advertised as 1 TB may show less usable space than expected.