The Academy

Loading the search index…

Searches the academy on this device only.

How computers process information

Find out why computers use only 0 and 1, how text, pictures and sound become numbers, and how a processor follows instructions. You will understand why a computer is very fast but also very literal.

25 minbeginnerPractical task needs a laptop or desktop

Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).

By the end of this lesson you will be able to

  • Explain why computers store everything as 0s and 1s.
  • Describe what a bit and a byte are, and say how many bytes are in a kilobyte, megabyte and gigabyte.
  • Explain in simple terms how text, pictures and sound can be stored as numbers.
  • Describe the fetch, decode and do cycle that a processor repeats billions of times a second.
  • Say why a computer is fast but does exactly what it is told, even when that is not what you meant.

In the last lesson you met the four jobs of a computer. Now we look at what is really being handled: a computer has no idea what a letter, a photograph or a song is. It only works with numbers, and those numbers are held as tiny on and off signals. Once you see how a message becomes numbers, file sizes, storage space and many error messages start to make sense.

Why only 0 and 1?

Think of a light switch. It has two positions: off or on. It is very easy to build a switch that is reliably one or the other, and very hard to build one that has ten clearly different positions. Inside a computer there are billions of microscopic electronic switches. Each one is either off (written 0) or on (written 1).

One switch holds one tiny piece of information, called a Bit. Writing numbers with only the symbols 0 and 1 is called Binary. It is just another way of writing numbers, the way Roman numerals are another way of writing numbers. A single switch is not much use, but a row of them can stand for a lot.

Eight bits in a row make one Byte. A byte can be set up in 256 different ways (from 00000000 to 11111111), which is enough to give a different number to every letter, digit and common symbol on a keyboard. The byte is the basic unit for measuring how much information there is.

Diagram

One byte is a row of eight on/off switches, and that pattern stands for a number.

0128off
164on
032off
016off
08off
04off
02off
11on
One byte is a row of eight on/off switches, and that pattern stands for a number.
Read this figure as text

The pattern 01000001 split into eight bits, each labelled with its place value, showing that it stands for the number 65.

The eight bits 0, 1, 0, 0, 0, 0, 0, 1 make one byte. Reading from the left, each place is worth 128, 64, 32, 16, 8, 4, 2 and 1. Only the 64 place and the 1 place are switched on, so the byte stands for 64 plus 1, which is 65. Under the common text table, 65 is the capital letter A.

Measuring amounts of information

Bytes are tiny, so larger units are used, in the same way we say kilometres instead of thousands of metres. A kilobyte (KB) is about a thousand bytes, a megabyte (MB) is about a thousand kilobytes, and a Gigabyte (GB) is about a thousand megabytes. A terabyte (TB) is about a thousand gigabytes.

Diagram

Typical sizes of everyday files, on a scale where each step is far bigger than the last.

Text message
about 0.2 KB
Page of text
about 5 KB
Phone photo
about 4 MB
Song
about 5 MB
Film
about 2 GB

Bar lengths use a logarithmic scale: each step along the bar is a multiple, not an equal amount.

Typical sizes only. Scale is logarithmic, so each bar is far longer than the one above it.

Typical sizes of everyday files, on a scale where each step is far bigger than the last.
Read this figure as text

A bar chart on a logarithmic scale comparing a text message, a page of text, a photo, a song and a film.

Bars on a log scale, so each bar is much longer than the one above it. A short text message is about 0.0002 megabytes. A page of plain text is about 0.005 megabytes. A phone photo is about 4 megabytes. A song is about 5 megabytes. A film in standard quality is about 2000 megabytes. These are typical sizes; real files vary.

Text, pictures and sound are all numbers

Because a computer only handles numbers, people agreed on tables that say what each number means. For text, the table is a Character encoding. In the common table, 72 means H and 105 means i, so the word “Hi” is stored as the two numbers 72 and 105. If everyone uses the same table, a message typed on one computer can be shown correctly on any other. When programs use different tables, you may see odd symbols instead of letters.

A picture is a grid of tiny coloured dots called pixels. Each pixel's colour is stored as a few numbers: how much red, green and blue light to mix, each from 0 to 255. Red 255, green 0 and blue 0 gives bright red. A photo from a phone has millions of pixels, which is why it takes millions of bytes.

Sound is stored by measuring the strength of the sound wave many thousands of times each second and writing each measurement as a number. Play the numbers back in order through a speaker, and you hear the sound again. Video is simply many pictures plus sound.

Diagram

Three kinds of information and the numbers a computer might store for each.

TextTable of characters
  • H is stored as 72
  • i is stored as 105
  • Everyone uses the same table

Letters become numbers.

PictureGrid of pixels
  • Each pixel has 3 numbers
  • Red, green, blue, 0 to 255
  • Red is 255, 0, 0

Colours become numbers.

SoundMeasured many times a second
  • Wave strength is measured
  • Each measure is a number
  • Played back in order

Sound becomes numbers.

Three kinds of information and the numbers a computer might store for each.
Read this figure as text

Three columns showing how text, a picture and sound are each turned into numbers.

Text: the word Hi becomes the numbers 72 and 105, using an agreed table of characters. Picture: each pixel becomes three numbers for red, green and blue, each from 0 to 255; bright red is 255, 0, 0 and white is 255, 255, 255. Sound: the strength of the sound wave is measured thousands of times a second, and each measurement is a number, for example 0, 12, 40, 55, 40, 12. In every case the computer keeps only numbers, and software turns them back into letters, a picture or sound.

Instructions and programs

Data is only half the story. The computer also needs to be told what to do with it. An Instruction is one small, exact step, such as “add these two numbers” or “copy this number to that place”. A Program is a long list of such instructions, written by a person called a programmer. A word processor, a game and a web browser are all programs.

Programs are stored as numbers too, so they live in storage next to your documents. When you open a program, its instructions are copied into memory, ready for the processor to read.

How the processor works: fetch, decode, do

The processor is a very hard-working but very simple worker. It repeats the same three-part cycle over and over. First it fetches the next instruction from memory. Then it decodes it, which means working out which small job the instruction asks for. Then it does (executes) that job, for example adding two numbers. Then it goes straight back to fetch the next one.

Diagram

The cycle a processor repeats for every instruction.

Billions oftimes a second1Fetch2Decode3Do
  1. FetchGet the next instruction from memory
  2. DecodeWork out what it asks for
  3. DoCarry it out, then fetch again
The cycle a processor repeats for every instruction.
Read this figure as text

A circular diagram of three steps, fetch, decode and do, repeating.

A cycle with three steps that repeats forever while the computer is on. Step 1, Fetch: get the next instruction from memory. Step 2, Decode: work out what the instruction asks for. Step 3, Do: carry it out, for example add two numbers. Then the cycle returns to Fetch for the next instruction. The centre label says this repeats billions of times each second.

How fast is that? A processor's internal clock ticks at a steady rate, measured in gigahertz. A clock speed of 3 GHz means about three billion ticks every second. A processor can do roughly one small step per tick, or more on modern designs. That is why a computer can add up a million numbers in the time it takes you to blink.

Fast, but very literal

A computer is like an extremely quick helper who takes every instruction exactly as written. Imagine telling a robot, “Make a cup of tea”, but forgetting to say that the kettle needs water. The robot will switch on an empty kettle and wait. It does not guess what you meant.

This is why a tiny typing slip in a file name stops a file from being found, and why programs can fail because of one wrong character. When something goes wrong, the computer is almost never being awkward. It is doing exactly what it was told, and what it was told was not quite what was intended.

Diagram

What a computer is good at, and what it needs from people.

Computers are good at
  • Repeating steps without tiring
  • Arithmetic at huge speed
  • Storing and finding lots of data

Fast and exact.

Computers need people for
  • Deciding what is worth doing
  • Spotting a wrong instruction
  • Knowing what you really meant

Literal, not wise.

What a computer is good at, and what it needs from people.
Read this figure as text

Two columns: what computers do well, and what they cannot do without help.

Computers do well at: repeating the same steps millions of times without getting tired, doing arithmetic extremely quickly, and storing and finding huge amounts of information. Computers need people for: deciding what is worth doing, noticing when an instruction is wrong or incomplete, and understanding what you really meant instead of what you typed.

Common mistakes

  • ✖ Instead of: Thinking a computer understands words, pictures or music.

    ✔ Do this: It stores and moves numbers. Software turns the numbers back into letters, pictures and sound for you.

  • ✖ Instead of: Mixing up bits and bytes, for example thinking 8 MB and 8 Mb are the same.

    ✔ Do this: A capital B means bytes and a small b means bits. One byte is eight bits, so 8 Mb is only 1 MB. File sizes use bytes; internet speeds are often quoted in bits.

  • ✖ Instead of: Believing a computer will work out what you meant when you make a typing slip.

    ✔ Do this: It does exactly what it was told. Check spelling, spaces and capital letters in file names and settings.

If something goes wrong

I cannot work out a letter's number from the table in the practical.
Start from A=65 and count forwards one for each letter: A=65, B=66, C=67, D=68. For K count ten steps on from A, giving 75.
My file manager shows sizes in different units, so I cannot compare them.
Convert to the same unit first. About a thousand KB make one MB, and about a thousand MB make one GB. Remember the sizes are rounded.
I cannot find where the size is shown in Files or File Explorer.
Use the list or Details view, which shows a Size column. You can also right-click the file and choose Properties (on Ubuntu) or Properties (on Windows) to see the size.

Key terms

Binary
A way of writing information using only two symbols, 0 and 1, matching a switch that is off or on.
Character encoding
An agreed table that says which number stands for which letter or symbol.
Pixel
One tiny dot of colour on a screen. A picture is a grid of thousands or millions of them.
Program
A list of instructions that tells a computer how to do a job.
Instruction
One small, exact step that a processor can carry out, such as adding two numbers.
Clock speed
How many tiny steps per second a processor's internal clock ticks, measured in gigahertz (GHz).

Practise it for real

Reading is not the same as being able to do it. Complete these on your own computer, then tick only what you have actually done. These ticks are your own honest record: nothing checks them for you.

Guided exercise

Turn your name into numbers

Use this short table of capital letters: A=65, B=66, C=67 and so on, adding one for each later letter (so K=75 and Z=90). On paper, write the number for each letter of your first name, in order. Then write the number sequence for a friend's name. Swap your lists and decode each other's. This is exactly the job that a character encoding does inside the computer.

You have succeeded when:
Independent challengeNeeds a laptop or desktop

Challenge: compare real file sizes

On your own computer, open the Files app on Ubuntu or File Explorer on Windows. Find three files of different kinds, for example a text document, a photo and a song, and look at the size shown for each (in Files, use the list view; in File Explorer, use the Details view or right-click the file and choose Properties). Write down each size and the unit. Put the three files in order from smallest to largest and say why you think the biggest one is so large.

You have succeeded when:

Knowledge check

7 questions. You need 80% to pass. Mistakes here are part of learning, and you can retry as often as you like.

  1. Question 1.Why do computers store information as 0s and 1s?
  2. Question 2.A byte is made of eight bits.
  3. Question 3.Put these units in order from smallest to largest.
    1. Gigabyte
    2. Megabyte
    3. Byte
    4. Kilobyte
  4. Question 4.Match each kind of information to how a computer stores it.
  5. Question 5.Which list gives the repeating cycle of the processor in the right order?
  6. Question 6.Wanjiru saved a file called Budget2026.xlsx. Later she types Budget 2026.xlsx, with a space, into a search box and the computer finds nothing.What is the best explanation?
  7. Question 7.A processor with a higher clock speed always makes a computer feel faster, whatever else is in it.

Summary

  • Computers use switches that are off or on, written as 0 and 1 (binary). One is a bit; eight bits make a byte.
  • Kilobytes, megabytes and gigabytes are each about a thousand times bigger than the one before.
  • Text, pictures and sound are stored as numbers, using agreed tables and measurements.
  • A program is a list of instructions. The processor fetches, decodes and does them, billions of times a second.
  • Computers are fast and exact, but literal: they do what they are told, not what you meant.

Checklist: can you do these?

Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).

Related lessons

References and further reading

Official sources for details that can change between versions.

On this page