Inside the machine: CPU, memory and storage
The processor, memory and storage each have a different job. See how they work together, using a kitchen as the picture.
If you opened up a laptop, you would see a few important parts. Each has its own job, and they work together like a team. The easiest way to remember them is to picture a kitchen.
The kitchen picture
The processor is the chef
The processor, or CPU (central processing unit), is the part that does the work. It follows the instructions, one tiny step at a time, and does the sums.
How fast? Its speed is measured in gigahertz (GHz). A processor of 3 GHz "ticks" about 3 billion times every second, and each tick can carry out a step.
Many processors have several cores, which are like having several chefs, each working on a different job at the same time.
Memory is the counter
Memory, often called RAM, is where the computer keeps what it is working on right now. It is like the kitchen counter: it is small, but everything on it is within easy reach, so the chef can work quickly.
The catch: when the power goes off, the counter is wiped clean. Memory forgets everything.
Storage is the pantry
Storage (an SSD or a hard drive) is where files and programs are kept for the long term. It is like the pantry or the fridge: much bigger than the counter, but slower to fetch from. And it keeps everything even when the power is off.
When you open a game, the computer copies it from the pantry (storage) to the counter (memory). Then the chef (processor) can work on it quickly.
| Part | Kitchen | Speed | Size | Keeps data with no power? |
|---|---|---|---|---|
| Processor (CPU) | Chef | Very fast | Tiny | No |
| Memory (RAM) | Counter | Fast | Medium | No |
| Storage (SSD) | Pantry | Slower | Large | Yes |
What happens when you run a program?
Inside, the processor repeats three steps, over and over, billions of times a second. It is called the fetch-decode-execute cycle:
- Fetch. Grab the next instruction from memory.
- Decode. Work out what the instruction is asking for.
- Execute. Do it, for example by adding two numbers, and then go back to step 1.
That is it. All the things a computer does are this tiny loop, repeated. The magic is in the speed and in the instructions.
Other parts
- Input and output devices. Keyboard, screen, speaker, camera, and the touchscreen on a phone.
- The operating system. A special program (such as Windows, macOS, Android or iOS) that manages everything, shares the processor and memory between programs, and lets you click on things.
- The graphics processor (GPU). A helper chip with thousands of small cores. Where a CPU is a few clever chefs, a GPU is a huge crowd of simple helpers who all do the same simple job at the same time. That is perfect for drawing pictures, and, as we will see later, for training AI.
Why does a computer slow down?
When memory (the counter) gets full, the computer has to move things back and forth to storage (the pantry). That takes far longer. It is like a chef who keeps running to the pantry because the counter is full.
A typical laptop might have a processor ticking at 3 billion times a second, 8 to 32 gigabytes of memory, and hundreds of gigabytes or a terabyte of storage.
Words to know
- CPU
- The central processing unit, the part that follows instructions and does the sums.
- Core
- One worker inside a processor. Many processors have several.
- RAM
- Memory that holds what the computer is working on now. It is cleared when the power goes off.
- Storage
- Where files and programs are kept for the long term, such as an SSD.
- GPU
- A chip with thousands of small cores, good at lots of simple jobs at once.
- Operating system
- The main program that manages the computer and everything running on it.
Check yourself
In the kitchen picture, which part is the chef, the counter and the pantry?
Show the answer
The processor is the chef, memory is the counter, and storage is the pantry.
Which keeps your files when the power is off: memory or storage?
Show the answer
Storage. Memory forgets everything when the power goes off.
What are the three steps the processor repeats?
Show the answer
Fetch an instruction, decode it, and execute it.
Why is a GPU useful for AI?
Show the answer
It has thousands of small cores that can do lots of simple calculations at the same time, which suits training AI.