Computer ScienceFoundation20 min read

Introduction to Systems

What is actually inside the box, and how it runs a program

This topic appears in:

01

Every computer is the same four things

A computer is a machine that takes in data, does something to it, and gives back a result — the input–process–output model. Storage is the fourth part, because most useful work needs to remember something between one job and the next.

That model applies to every computer, from the phone in your pocket to a weather supercomputer. What changes between them is scale, not structure.

PartWhat it doesExamples
Inputbrings data inkeyboard, mouse, scanner, sensor, microphone
Processingacts on the dataCPU, and for graphics a GPU
Outputpresents the resultmonitor, printer, speaker, actuator
Storagekeeps data for laterSSD, hard disk, USB drive, cloud
Memoryholds what is in use nowRAM, cache, registers

Storage and memory are not the same word

Memory (RAM) is fast, small and volatile — switch off the power and its contents vanish. Storage is slower, much larger and non-volatile, so it survives a power cut. This is why unsaved work is lost when a machine crashes: it was in memory, not in storage. Examiners ask this every year.

02

Inside the CPU

The central processing unit is where instructions are actually carried out. It has three parts you need by name.

The control unit (CU) directs everything: it fetches each instruction, works out what it means, and sends signals telling the other parts what to do. The arithmetic and logic unit (ALU) does the calculating — additions, subtractions, comparisons, logical operations. And the registers are a handful of tiny, extremely fast storage locations inside the CPU itself, holding the values currently being worked on.

Three registers are named in the syllabus. The program counter holds the address of the next instruction. The instruction register holds the instruction currently being decoded. The accumulator holds the result the ALU has just produced.

Step through the stages. Notice that the execute stage is the only one where anything is calculated — the other three are moving instructions and data around, which is why bus speed matters as much as clock speed.

03

The fetch–execute cycle

A processor does one thing, over and over, billions of times a second: it fetches an instruction, works out what it means, does it, and stores the result. That loop is the fetch–execute cycle, and everything a computer does is made of it.

The three buses are the wires connecting the CPU to memory, and each carries one kind of thing. The address bus carries where in memory to look, and it is one-way — memory never sends an address back. The data bus carries the value itself, and it is two-way. The control bus carries the instruction to read or to write.

FETCH → DECODE → EXECUTE → STORE → (repeat)the program counter increments during fetch, which is what makes the next loop pick up the following instruction

What makes one processor faster than another

Three things, and questions ask about all of them. Clock speed — how many cycles per second, measured in GHz. Number of cores — how many cycles can happen at the same time. Cache size — how much frequently-used data sits inside the CPU, saving the slow trip to RAM. A four-core 2 GHz chip usually beats a single-core 3 GHz one, which is why clock speed alone is a poor comparison.

04

The memory hierarchy

Storage is a trade-off between speed, size and cost, and no single technology wins on all three. So computers use several, arranged in a pyramid: the fastest is smallest and most expensive, the slowest is largest and cheapest.

Data is moved up the pyramid when it is needed and down when it is not. That movement is invisible to the user and is most of what makes a modern machine feel fast.

LevelSpeedTypical sizeVolatile?
Registersfastesta few bytesyes
Cachevery fasta few MByes
RAMfast4–32 GByes
SSDmoderate256 GB – 2 TBno
Hard diskslow1–8 TBno
Cloud / tapeslowesteffectively unlimitedno
Worked example

A computer has 8 GB of RAM and a 512 GB SSD. Explain why adding more RAM might speed it up more than replacing the SSD with a faster one.

  1. Programs and data must be in RAM to be worked on.The CPU cannot execute an instruction that is still on the disk.
  2. If RAM fills up, the operating system moves less-used pages out to the SSD — a process called paging or swapping.This is what keeps a machine running when it runs out of memory, at a heavy cost.
  3. The SSD is thousands of times slower than RAM, so every swap costs a long wait.The gap between RAM and any disk is far larger than the gap between two disks.
  4. More RAM means less swapping, removing the delay entirely rather than shortening it.A faster SSD only makes an expensive operation slightly less expensive; more RAM avoids it.

More RAM removes the need to swap; a faster SSD only makes swapping less slow.

Before you leave this chapter

  1. Input → Process → Output, with Storage alongside.
  2. CPU = control unit + ALU + registers. The CU directs, the ALU calculates.
  3. Fetch, decode, execute, store — repeated for every instruction a computer runs.
  4. Address bus carries where (one-way); data bus carries what (two-way); control bus carries read or write.
  5. Memory is volatile and fast; storage is non-volatile and slow. That difference is why unsaved work is lost.

Practice questions

6 questions · 20 marks · full working on every one

Try each one on paper first, then open the working. The marks are shown where they are actually awarded, because that is where they are actually lost.

Short questions

3 · 6 marks

Two marks each, in the style of the short-question section of the paper. Answer in two or three lines.

SQ1[2 marks]
Differentiate between RAM and secondary storage.
Model answer

RAM is volatile, fast and comparatively small; it holds the programs and data currently in use and loses everything when the power goes. Secondary storage such as an SSD is non-volatile, slower and much larger; it keeps data permanently.

Examiner tip. The word "volatile" is the mark. Answering only "RAM is faster" scores half.

SQ2[2 marks]
Name the two main components of the CPU and state the function of each.
Model answer

The control unit, which fetches and decodes instructions and sends control signals to the rest of the system; and the arithmetic and logic unit, which performs calculations and logical comparisons.

Examiner tip. One mark per component, and each needs its function. Naming both without their jobs usually scores one.

SQ3[2 marks]
What is held in the program counter, and why must it change during every cycle?
Model answer

It holds the address of the next instruction to be fetched. It increments during the fetch stage so that the following cycle picks up the next instruction rather than repeating the current one.

Examiner tip. Say what would happen otherwise — the same instruction would run for ever. That consequence is often the second mark.

Solved numericals

2 · 8 marks

Full working, one step per line, with the marks shown where they are awarded.

N1[4 marks]
Describe the four stages of the fetch–execute cycle.
Full working
  1. Fetch: the address in the program counter is placed on the address bus and the instruction is brought back along the data bus into the instruction registermention of a bus expected[1]
  2. Decode: the control unit interprets the instruction to determine the operation and its operands[1]
  3. Execute: the ALU carries out the operation[1]
  4. Store: the result is written back to a register or to memory, and the cycle repeatsthe repetition should be stated[1]

Fetch, decode, execute, store — repeated for every instruction.

Examiner tip. Four stages, four marks. Give them in order with one sentence each rather than writing a paragraph about the first and running out of time.

N2[4 marks]
Explain the purpose of the address bus, the data bus and the control bus, and state which of them is unidirectional.
Full working
  1. The address bus carries the memory address being accessed[1]
  2. The data bus carries the actual data or instruction[1]
  3. The control bus carries signals such as read and write[1]
  4. The address bus is unidirectional — addresses only ever travel from the CPU to memory, whereas data travels both waysthe reason is required[1]

Address = where (one-way), data = what (two-way), control = read or write.

Examiner tip. The "which is one-way" part is nearly always asked. Memory never needs to tell the CPU an address, which is the reason.

Long questions

1 · 6 marks

Theory and numerical together, as they appear in the long-question section.

LQ1[6 marks]
A student is choosing between two laptops. Laptop A has a 3.2 GHz single-core processor, 4 GB RAM and a 1 TB hard disk. Laptop B has a 2.4 GHz quad-core processor, 16 GB RAM and a 512 GB SSD.
  1. Explain which laptop is likely to feel faster in everyday use.
  2. Explain one advantage Laptop A still has.
  3. Explain why clock speed alone is a poor way to compare processors.
Mark scheme
  1. Laptop B[1]
  2. Four cores can execute four instruction streams at once, so it handles several programs far better than one faster core[1]
  3. 16 GB of RAM means far less swapping to disk, and the SSD has no moving parts so it reads much faster than a hard diskeither point accepted[1]
  4. Laptop A has 1 TB of storage against 512 GB, so it holds roughly twice as many filescapacity is the only advantage here[1]
  5. Clock speed measures cycles per second on ONE core, so it says nothing about how many cores there are[1]
  6. It also ignores cache size and the amount of RAM, both of which decide how often the CPU has to wait for data[1]

(a) Laptop B — more cores, far more RAM, and an SSD (b) twice the storage capacity (c) clock speed ignores cores, cache and RAM

Examiner tip. Comparison questions want a decision and reasons tied to the figures given. Quoting the actual numbers from the question is what separates a full answer from a general one.