Year 8 · Computer Systems · Part B: Inside the machine

Inside the computer

In one line

The CPU does the work, RAM holds what it's using now, and storage keeps everything long-term. The CPU repeats one loop: fetch, decode, execute.

1

Name the parts of the CPU in the von Neumann design, and say what each of the three buses carries.

2

Step through fetch–decode–execute, saying what the PC, MAR, MDR, CIR and ACC hold at each moment.

3

Work out how long one clock tick lasts, and explain why more cores or more cache isn't always faster.

4

Compare RAM, ROM, virtual memory and the three kinds of storage (magnetic, optical, solid state), and choose storage for a job.

5

Explain what an embedded system is, and spot them around you.

CPUThe processor. Runs instructions, one tiny step at a time.
RegisterA tiny, super-fast store inside the CPU.
BusA set of parallel wires carrying addresses, data or signals.
RAMMain memory. Fast, holds what's in use now.
VolatileForgets everything when the power goes off.
CacheSmall, very fast memory on the CPU chip.
Clock speedTicks per second, in GHz.
Embedded systemA small computer inside a device, doing one job.

The big picture: a kitchen

Every computer, from a phone to a games console, has the same few parts. A kitchen is a good picture of how they work together.

KitchenComputerWhy
The chefCPUDoes the actual work, one step at a time.
The worktopRAMSmall, fast, holds what's in use now. Cleared at closing time.
CupboardsStorage (SSD, hard drive)Big, slower, keeps everything when switched off.
The recipeA programThe list of steps.
Inputkeyboard, mouse,mic, sensors CPUthe chef: does thework, one stepat a time Outputscreen, speaker,printer, motor RAMthe worktop:what's in use now Storagethe cupboards:kept when off Programthe recipe: kept instorage, run in RAM load / save The CPU only works with RAM. Anything in storage is copied into RAM first.
Blue line: the CPU and RAM talk all the time. Storage is further away: things are loaded from it into RAM, and saved back.
★Remember

The CPU can't work straight from storage. Things are copied into RAM first, like taking food out of the cupboard before you cook with it.

?Why?

Why not one big, fast memory for everything? Fast memory is expensive and forgets when the power goes off. Big storage is cheap and remembers, but it is slow. So computers use both: a little fast memory near the chef, lots of slow storage further away. Step 10 shows the full ladder.

The stored-program idea (von Neumann)

The first electronic computers were rewired by hand for each new job. ENIAC (1945) took days of plugging cables to change its program. Then came a much better idea.

  1. 1945: John von Neumann wrote up a design for a machine called EDVAC. It became the plan for almost every computer since.

  2. The idea: instructions and data are both binary numbers.

  3. So both can be stored in the same memory. To change the job, you just load a new program. No rewiring.

  4. The CPU fetches instructions from memory one at a time and carries them out.

  5. 21 June 1948: the "Manchester Baby" at the University of Manchester ran the world's first stored program.

CPU (one chip) Control Unitfetches, decodes,sends signals ALUmaths: + − × ÷logic: AND, OR, > Registers (tiny, fastest) PC MAR MDR CIR ACC Cachecopies of busy RAM Clock Each core has its own CU, ALU and registers. Address bus Data bus Control bus one way only both ways both ways Main memory (RAM) addressholds Input / output controllers keyboard, screen, network, storage drives Instructions and data share one memory and one set of buses. That's von Neumann.
Blue tags in memory = instructions. Green tags = data. They sit side by side in the same memory: the stored-program idea.

The three buses

A bus is a set of parallel wires. Each wire carries one bit at a time. A 64-bit data bus has 64 wires, so it moves 64 bits at once.

BusCarriesDirectionKitchen picture
Address busWhich memory location to use (the address)One way: CPU → memoryThe shelf number you shout
Data busThe instruction or data itselfBoth waysThe jar passed back and forth
Control busSignals: read, write, clock ticks, "I'm busy"Both ways"Fetch!" or "Put this away!"
?Why?

Why is the address bus one way? Only the CPU decides which address to use. Memory never asks the CPU for an address. It only answers.

Why does bus width matter? An address bus with n wires can name 2n addresses. 32 wires → 232 ≈ 4.3 billion addresses, about 4 GB. That's why old 32-bit computers could not use more than 4 GB of RAM.

!Watch out

The von Neumann bottleneck. Instructions and data travel on the same buses, one thing at a time. The CPU is often faster than memory, so it sits waiting. Cache (Step 7) is the main fix.

e.g.Bonus: Harvard design

Some small chips keep instructions and data in separate memories, with separate buses. This is called Harvard architecture. The chip on an Arduino Uno works this way. It can fetch the next instruction while it reads data.

★Exams

AQA 8525 and OCR J277 both name the von Neumann architecture. AQA lists the parts to know as ALU, CU, clock, register and bus.

The parts of the CPU, and its registers

Inside the CPU there are a manager, a calculator, a few tiny boxes for numbers, a little fast memory and a drumbeat.

  1. Control Unit (CU): the manager. Fetches each instruction, works out what it means (decodes it), and sends signals on the control bus to tell the other parts what to do.

  2. ALU (Arithmetic Logic Unit): the calculator. Does maths (+, −) and logic (comparisons like > and =, and AND, OR, NOT). It is built from logic gates (Year 9).

  3. Registers: tiny, super-fast stores. Each holds one value, usually 32 or 64 bits. They are the fastest memory in the whole computer.

  4. Cache: small, very fast memory on the chip. It keeps copies of things from RAM that are used often.

  5. Clock: a steady pulse. Each tick lets the CPU take one step. Everything moves in time with it.

Registers to know

RegisterFull nameHoldsExample
PCProgram CounterThe address of the next instruction2
MARMemory Address RegisterThe address about to be read or written5
MDRMemory Data RegisterThe data just read, or about to be written14
CIRCurrent Instruction RegisterThe instruction being decoded and run nowADD 6
ACCAccumulatorThe result of the latest calculation42
Each house number is an address. What's inside is the data. PC = 2next instruction's house MAR = 5which house to visit MDR = 14what was inside
Memory is a long street of numbered houses. The address is the house number. The data is what's inside. The MAR holds a house number; the MDR holds what's inside.
!Watch out

The MAR only ever holds an address. The MDR holds whatever came from (or goes to) that address: it can be an instruction or a number.

★Exams

OCR J277 names four registers: PC, MAR, MDR and accumulator. AQA 8525 only asks about "registers" in general. The CIR is on neither GCSE list (it's A-level), but it makes the cycle easier to follow, so we use it here.

The fetch–decode–execute cycle

The CPU only ever does one thing, over and over: fetch an instruction, work out what it means, do it. Then fetch the next one.

1 FetchPC → MAR → RAMinstruction → MDRMDR → CIRPC + 1 2 DecodeControl Unit readsthe CIR: what to do(opcode) and to what(operand) 3 ExecuteALU calculates, ordata moves to orfrom RAM. Resultgoes in the ACC repeat, billions of times a second
Colours stay the same everywhere on this page: blue = fetch, orange = decode, green = execute.

One line at a time

  1. Fetch 1. The PC holds the address of the next instruction, e.g. 20.

  2. Fetch 2. Copy 20 into the MAR. (This happens inside the CPU.)

  3. Fetch 3. The MAR sends 20 to RAM along the address bus. The control bus sends a read signal.

  4. Fetch 4. RAM sends back what's at address 20, along the data bus, into the MDR.

  5. Fetch 5. The PC goes up by 1 (to 21), ready for next time.

  6. Fetch 6. The instruction is copied from the MDR into the CIR.

  7. Decode. The Control Unit splits the instruction into an opcode (what to do, like ADD) and an operand (what to do it to, like address 6).

  8. Execute. Do it. The ALU may calculate, data may move, the result goes to the ACC or to memory. Then back to Fetch 1.

▶

Watch the buses: one instruction, step by step

The ACC already holds 14. Now the CPU runs ADD 6, which is stored at address 1. Watch which register changes and which bus carries what.

address busdata buscontrol bus

★Remember

This loop runs billions of times a second. Every app, game and web page is just this loop, run on different instructions.

★Exams

AQA and OCR both call it the fetch–execute cycle. Decode is part of it. Use the board's name in exam answers.

Be the CPU

Now you run a whole program. Before each step, predict what changes. The trace table at the bottom records every register, like an exam trace question.

▶

Run LOAD, ADD, STORE yourself

AddressRAM holds

Trace table

#StageWhat happenedPCMARMDRCIRACC
?Why?

Why does LOAD 5 put 14 in the ACC, not 5? The operand 5 is an address, a house number. The CPU goes to house 5 and takes what's inside. This is the most common mistake in exam trace questions.

e.g.Example

Each instruction took 4 fetch steps, 1 decode, and 3 execute steps. The fetch part is always the same. Only execute changes, depending on the opcode.

Clock speed: how fast the drum beats

The clock sends a pulse, on and off, again and again. Each pulse is one tick (or cycle). The CPU takes a step on each tick. Clock speed is how many ticks happen every second.

one tick (one cycle) onoff tick 1tick 2tick 3tick 4tick 5 At 4 GHz: 4,000,000,000 ticks every second. One tick lasts 1 ÷ 4,000,000,000 s = 0.25 nanoseconds. A nanosecond (ns) is one billionth of a second.
UnitMeansTicks per second
1 Hz (hertz)once a second1
1 kHz (kilohertz)a thousand1,000
1 MHz (megahertz)a million1,000,000
1 GHz (gigahertz)a billion1,000,000,000

By hand: 3.5 GHz

  1. Change GHz into ticks per second. Giga = 1,000,000,000. So 3.5 GHz = 3.5 × 1,000,000,000 = 3,500,000,000 ticks per second.

  2. One tick is 1 ÷ that. 1 ÷ 3,500,000,000 = 0.000 000 000 286 seconds. Far too many zeros to read.

  3. Change to nanoseconds. 1 second = 1,000,000,000 ns, so multiply by a billion: 0.000 000 000 286 × 1,000,000,000 = 0.286 ns.

  4. Shortcut. The billions cancel out. Time in ns = 1 ÷ GHz. So 1 ÷ 3.5 = 0.286 ns. Same answer, one step.

  5. Sense check. More GHz → more ticks → each tick is shorter. 3.5 GHz is faster than 1 GHz, and 0.286 ns is shorter than 1 ns. ✓

Clock speed1 GHz2 GHz2.5 GHz3.5 GHz4 GHz5 GHz
One tick1 ns0.5 ns0.4 ns0.286 ns0.25 ns0.2 ns
?Why?

Why not just make it 100 GHz? Every tick switches billions of transistors, and each switch makes a little heat. Faster ticks → more heat. Above about 5 GHz, chips get too hot to cool with a normal fan. Also, in 0.2 ns an electrical signal only travels a few centimetres, so the chip can't be very big.

!Watch out

Overclocking means running a CPU faster than its maker set. It can work, but it makes more heat, uses more power and can make the computer crash.

e.g.Beyond GCSE

One instruction usually takes several ticks. Modern CPUs overlap instructions like a production line (pipelining), so they finish about one or more per tick on average.

Cores and cache: what else makes it faster

Three things set how fast a CPU is: clock speed, the number of cores, and the size of the cache.

One CPU chip with 4 cores L3 cache: shared by all cores RAM about 100× slower than L1 cache
L1 is the smallest and fastest, inside each core. L2 is bigger and a bit slower. L3 is bigger again and shared. RAM is a long trip off the chip.
  1. Clock speed: cycles per second. 3.5 GHz = 3.5 billion ticks a second.

  2. Cores: each core is a full processor with its own CU, ALU and registers. 4 cores can do 4 things at once, if the program can be split up.

  3. Cache size: more cache = fewer slow trips to RAM. The CPU checks L1, then L2, then L3, and only then goes out to RAM.

▶

Cache hit or miss?

The CPU asks for addresses one by one. If a copy is already in the cache: hit, 1 ns. If not: miss, a 100 ns trip to RAM, and a copy is put in the cache (pushing out the one used longest ago).

Requests:
Cache size:
Or ask for any address yourself

Why more isn't always faster

More of…Helps when…Doesn't help when…
CoresThe job splits into parts that run at the same time (video export, many browser tabs).Each step needs the answer of the one before. Then only one core can work; the others wait.
CacheThe program uses the same data again and again (loops).Data is used once and never again. Also, a bigger cache takes a little longer to search.
Clock speedEverything else keeps up.The CPU is waiting for RAM or storage. Ticking faster while waiting is still waiting. It also makes more heat.

By hand: 4 cores on a 10-second job

  1. A job takes 10 seconds on 1 core. 60% of it can be split up. 40% must run in order.

  2. The part that must run in order: 40% of 10 s = 4 s. Extra cores can't touch it.

  3. The part that splits: 60% of 10 s = 6 s. Shared by 4 cores: 6 ÷ 4 = 1.5 s.

  4. Total: 4 + 1.5 = 5.5 s. Not 10 ÷ 4 = 2.5 s. Four times the cores gave less than twice the speed.

!Watch out

Doubling the cores never quite doubles the speed. Not every job can be split.

Primary storage: RAM, ROM and virtual memory

Primary storage is memory the CPU can reach directly: RAM and ROM. (Cache and registers count too.) Storage drives are secondary: the CPU can't reach them directly.

RAM (Random Access Memory)ROM (Read Only Memory)
HoldsPrograms and data in use now, including the operating systemStart-up instructions (the BIOS or UEFI firmware)
Power offVolatile: everything lostNon-volatile: kept
Changeable?Yes, all the timeNormally no
Size8–32 GB in a typical PCTiny: a few MB
?Why?

Why is ROM needed? When you switch on, RAM is empty. Something must already be there to start the computer. That lives in ROM.

What happens when you press the power button

  1. Power on. RAM is empty. The CPU is built to start at one fixed address, which is in ROM.

  2. The ROM program (BIOS or UEFI) checks the hardware: is there RAM? a keyboard? a drive? This is the power-on self-test.

  3. It finds the storage drive and starts loading the operating system from storage into RAM.

  4. The operating system takes over. From now on, everything runs from RAM.

e.g.Example

Modern "ROM" chips are usually flash memory, so the maker can send a firmware update. It's still non-volatile, and normal programs can't write to it.

Virtual memory

When RAM is full, the computer borrows part of the storage drive and pretends it is extra RAM. It moves the parts of programs that haven't been used lately out to the drive, to make room.

RAM (8 GB) OS Browser Game Music full! SSD: the page file (virtual memory) Music Spreadsheet ① page out ② page in Reading the SSD is roughly 1,000 times slower than reading RAM.
  1. Page out. Music hasn't been used for a while. Its part of RAM is copied to the page file on the drive.

  2. Page in. You click on the spreadsheet. It's copied from the drive into the space Music left.

  3. Switch back to Music, and it has to be swapped in again. Each swap means waiting for the drive.

!Watch out

Virtual memory stops programs crashing when RAM is full. It does not make the computer faster: it is much slower than real RAM. If it swaps all the time, the computer crawls. This is called thrashing. Adding more RAM is the real fix.

★Exams

OCR J277 asks for "the need for virtual memory" by name. Both boards expect RAM vs ROM and the word volatile.

Secondary storage: how a bit is kept

Secondary storage keeps programs and files when the power is off (non-volatile). It is much bigger than RAM, and much slower. There are three ways to hold a bit: magnetism, light and trapped electric charge.

Magnetic: hard disk drive (HDD)

read/write head on an arm, floating nanometres above the disk → pointing one way = 1 · ← the other way = 0 Writing: the head's magnet flips a region. Reading: it senses each region. The platter spins at 5,400–7,200 rpm. The head must wait for the right spot.

Optical: CD, DVD, Blu-ray

pitpitpit landlandlandland laser + light sensor (spins under the disc) Change between pit and land = 1. No change = 0.

Solid state: SSD, USB stick, SD card, phone storage

The insulator holds the electrons in for years, even with the power off.
TypeHow a bit is storedExamplesGoodBad
MagneticTiny magnetised areas on a spinning diskHard disk (HDD), magnetic tapeCheap, hugeMoving parts, slower, hates knocks
Solid stateCharge trapped in flash memorySSD, USB stick, phones, SD cardsFast, silent, tough, lightCosts more per GB; each cell wears out after many writes
OpticalPits read by a laserCD (700 MB), DVD (4.7 GB), Blu-ray (25 GB a layer)Cheap to make and postSmall, slow, scratches
?Why?

Why does Blu-ray hold more than DVD? It uses a blue-violet laser. Blue light has a shorter wavelength than the red laser in a DVD player, so it can read smaller pits, packed closer together.

e.g.Example

SSDs spread writes evenly across all their cells (wear levelling), so no cell wears out early. A normal user won't wear one out for many years.

The memory hierarchy, and choosing storage

Put every kind of memory in one picture and a pattern appears: the faster it is, the smaller and dearer per byte it is.

faster, dearer per byte ↓ wider = bigger and cheaper per byte
LevelTypical sizeTime to readIf a register took 1 second…
Registersa few hundred bytesunder 1 ns1 second
L1 cache32–64 KB per coreabout 1 ns3 seconds
L3 cache8–64 MBabout 10–20 nsabout a minute
RAM8–32 GBabout 80 nsabout 4 minutes
SSD0.25–4 TBabout 0.1 ms (100,000 ns)about 4 days
Hard disk1–20 TBabout 10 msabout a year

Choosing secondary storage

Ask about…MeansRough figures (2025)
CapacityHow much it holdsHDD up to ~20 TB · SSD up to ~4 TB · Blu-ray 25–100 GB
SpeedHow fast it reads and writesSSD 500–7,000 MB/s · HDD 100–250 MB/s · Blu-ray ~36 MB/s
CostPrice per gigabyteHDD ~2p/GB · SSD ~6p/GB · USB stick ~8p/GB
DurabilitySurvives drops, heat, magnets, scratchesSolid state best · HDD worst (moving parts)
PortabilitySmall and light enough to carrySD card, USB stick, phone
ReliabilityKeeps working, data doesn't go badKeep a backup of everything, whatever you choose
▶

Storage picker

Pick a job. It sets how much each thing matters (0 = not at all, 3 = a lot). Each storage type gets a score: importance × rating, added up. You can change the importances yourself.

★Remember

Choose by: capacity, speed, portability, durability, reliability, cost. In exam answers, always say which of these matters for the job, and why.

Embedded systems

An embedded system is a small computer inside a device, doing one job: a microwave, a car's brakes, a micro:bit. Most computers in the world are embedded.

Inputs (sensors)water level sensortemperature sensordoor switchdial and buttons MicrocontrollerCPU + RAM + flashon one small chipone program, keptin flash (ROM):one job, for ever Outputs (actuators)drum motorwater heaterwater valvedisplay, buzzer It reads the sensors, decides, and drives the outputs, in a loop, many times a second.
General-purpose computerEmbedded system
JobsAnything: install new appsOne job, set by the maker
ProgramLoaded from storage into RAMFixed in flash/ROM (updated rarely)
Size and powerBig, uses lots of powerTiny, low power, often runs on a battery
CostHundreds of poundsOften under £1 for the chip
ExamplesLaptop, desktop, smartphoneMicrowave, washing machine, car ABS brakes, traffic lights, fitness tracker, micro:bit
?Why?

Why not put a full PC in a microwave? A microwave needs a timer, a keypad and a magnet switch. A tiny chip does that for pennies, uses almost no power, starts instantly and never needs updates. A PC would cost more, use more power and could crash.

e.g.Build one

The temperature logger build (Arduino in Tinkercad) is an embedded system you can make: a sensor in, a chip deciding, an LED out. It lives in Topic 18: Data, spreadsheets and AI. In Year 9 the BBC micro:bit is the class's own embedded system.

★Exams

Both boards ask for a definition and examples. A good answer: "a computer system built into a larger device, with one dedicated function".

Common mix-ups

The mistakes nearly everyone makes the first time. Read the left side, then the right.

People think

"My phone has 128 GB of memory" means 128 GB of RAM.

Actually

That's storage (flash). The phone's RAM is more like 4–12 GB. Different jobs, different parts.

People think

The MAR holds the data from memory.

Actually

The MAR holds the address. The MDR holds the data. A for Address, D for Data.

People think

More GHz always means a faster computer.

Actually

Cores, cache size and how much each tick achieves matter too. A CPU waiting for RAM is slow at any GHz.

People think

8 cores are twice as fast as 4.

Actually

Only the parts of a job that can be split speed up. Many jobs barely change.

People think

Virtual memory is extra RAM that speeds things up.

Actually

It's storage pretending to be RAM. It stops crashes but is much slower.

People think

An SSD is "memory", so it's volatile like RAM.

Actually

Flash memory is non-volatile: the trapped charge stays when the power goes.

People think

The CPU runs programs straight off the hard disk.

Actually

Programs are loaded into RAM first. The CPU only fetches from main memory.

People think

LOAD 5 puts the number 5 into the accumulator.

Actually

5 is an address. LOAD 5 copies whatever is stored at address 5.

Check yourself

Quick questions first. Then endless practice: a wrong answer shows you the working, step by step.

[ {"q":"Which register holds the address of the next instruction?","o":["MDR","PC","ACC"],"a":1,"w":"The Program Counter points to the next instruction. It goes up by 1 during each fetch."}, {"q":"RAM is volatile. That means…","o":["It loses everything when power is off","It is very fast","It can catch fire"],"a":0,"w":"Volatile = forgets without power."}, {"q":"Best storage for a laptop that's carried around?","o":["Hard disk","SSD","DVD"],"a":1,"w":"No moving parts, so it survives knocks. It's also light and fast."}, {"q":"Which bus only carries information one way, from the CPU to memory?","o":["Data bus","Address bus","Control bus"],"a":1,"w":"Only the CPU chooses addresses. Memory answers on the data bus."}, {"q":"During fetch, what goes into the MDR?","o":["The address of the instruction","The instruction stored at that address","The result of the calculation"],"a":1,"w":"The MAR holds the address. RAM sends back what's at that address, into the MDR."}, {"q":"A CPU runs at 2 GHz. How long is one tick?","o":["2 ns","0.5 ns","0.2 ns"],"a":1,"w":"1 ÷ 2 = 0.5 nanoseconds. More GHz = shorter ticks."}, {"q":"Why is ROM needed in a computer?","o":["To hold the start-up instructions, because RAM is empty at switch-on","To make games run faster","To store your photos"],"a":0,"w":"ROM is non-volatile, so the start-up program is still there when the power comes on."}, {"q":"Which is an embedded system?","o":["A laptop","The computer in a washing machine","A games console you install games on"],"a":1,"w":"It does one fixed job inside a bigger device."} ]