A-Level Revision Guides
All subjects covered
Amazon amazon.co.uk
Fastmail -- Private Email
Privacy-first email with no ads and no tracking
fastmail.com
Dynadot -- Domain Registration ->
Register or transfer domains with free SSL and affordable pricing
dynadot.com
Zen Internet -- UK Broadband ->
Award-winning UK broadband with no data caps and great customer service
zen.co.uk
A-Level Revision Aid: This resource is designed to support your revision. Content may contain errors. If you find a discrepancy with your class teaching, your teacher is correct — please let us know at alevelrevise@scott.scottrix.co.uk.

Computer Systems and Architecture

Year 1 / ASYear 2 / A-Level AQA, OCR, WJEC/Eduqas

Exam-focused AQA 7517, OCR H446 and WJEC/Eduqas revision for computer systems and architecture: CPU components, registers, fetch-decode-execute, pipelining, memory hierarchy, virtual memory, OS functions and Amdahl's law with worked register transfers.

Fastmail

🎯 Learning Objectives

📋 Key Definitions and Core Concepts

Arithmetic Logic Unit (ALU): The CPU component that performs arithmetic and logical operations, and updates the status register flags.
Control Unit (CU): The CPU component that decodes instructions and coordinates the control signals that sequence the fetch-decode-execute cycle.
Program counter (PC): The register holding the address of the next instruction to be fetched.
Status register: The register holding condition flag bits (carry, negative, overflow, zero) set by the ALU and tested by branch instructions.
Bus: A shared set of parallel wires: the address bus carries addresses (unidirectional), the data bus carries data (bidirectional), the control bus carries commands.
Cache: Small, fast memory between the CPU and RAM holding copies of frequently-used data; a hit avoids a slow RAM access.
Virtual memory: An OS technique using an area of secondary storage as an extension of RAM, moving pages between the two via a page table.
Interrupt: A signal that causes the CPU to suspend the current program, save its state and run an interrupt service routine (e.g. I/O completion, timer).
CISC: Complex Instruction Set Computer: many complex, variable-length instructions, microcode interpretation, fewer registers.
RISC: Reduced Instruction Set Computer: simple fixed-length instructions executed in one cycle, load/store architecture, many registers, suited to pipelining.

📌 Key Points

CPU: ALU (arithmetic/logic + flags), CU (decode + control signals); registers: PC (next instruction address), ACC (ALU results), MAR (address), MDR (data), CIR (current instruction), SR (flags) (AQA 4.4.1, OCR 1.1.1)
Buses: address bus unidirectional (CPU to memory), data bus bidirectional, control bus carries commands; wider address bus = more addressable memory
FDE: fetch (PC to MAR, memory to MDR, to CIR, PC incremented), decode (CU interprets opcode), execute (ALU/data movement)
Pipelining overlaps fetch/decode/execute; hazards: data (result not ready), control (branches), structural (resource conflict)
Memory hierarchy: registers > L1 > L2 > L3 cache > RAM > SSD > HDD; cost per byte falls, size grows going down
Virtual memory: pages swapped between RAM and disk via a page table; page fault stalls the process; thrashing degrades performance
OS functions: memory management (paging, segmentation), scheduling (round robin, FCFS, SJF, SRTN, multilevel feedback), interrupt handling, resource allocation (OCR 1.2.1)
CISC vs RISC: complex microcoded instructions vs simple load/store one-cycle instructions with many registers; RISC suits pipelining
Parallel: SIMD (one instruction, multiple data), MIMD (multicore); Amdahl: speedup = 1 / ((1 - p) + p/n)

CPU components, registers and buses

The standard 6-marker here is 'describe the role of the following registers...' (AQA 4.4.1, OCR 1.1.1, WJEC 1.4). Learn this table exactly — the purposes below are the mark-scheme wording:

RegisterPurpose
Program counter (PC)Holds the address of the next instruction to be fetched
Current instruction register (CIR)Holds the instruction currently being decoded/executed
Memory address register (MAR)Holds the address of the memory location about to be read/written
Memory data register (MDR)Holds the data just read from, or about to be written to, that address
Accumulator (ACC)Holds the result of ALU operations
Status register (SR)Holds flags (carry, negative, overflow, zero) set by the ALU and tested by branches

The classic trap: PC holds the address of the next instruction (not the current one), and MAR holds an address while MDR holds the data at that address. Pairs go together in traces: MAR/MDR for memory access, PC/CIR for instruction flow.

The other components: the ALU performs arithmetic (add, subtract) and logic (AND, OR, shifts), and sets the status flags; the control unit decodes the opcode in the CIR and generates the control signals that sequence every other component; the clock synchronises them; general-purpose registers hold intermediate values (RISC designs have many, CISC few).

Buses carry everything between them. Three buses, three examinable facts: the address bus is unidirectional (CPU to memory) and its width determines the addressable memory — 32 address lines address 2^32 bytes = 4 GiB; the data bus is bidirectional and its width determines how much data moves per transfer — 64 lines move 8 bytes at a time; the control bus carries command and timing signals (read, write, clock, interrupt request). Exam question pattern: 'Explain how the width of the address bus affects performance.' Answer: each additional line doubles the addressable space (2^w), not the speed directly — but more addressable memory allows more RAM and less swapping, which improves performance indirectly. State that distinction and you separate yourself from candidates who say 'wider bus = faster'.

Fetch-decode-execute and pipelining

The FDE cycle (OCR 1.1.1, AQA 4.4.1) repeats for every instruction. Learn the register transfers in order — this exact sequence is the mark scheme:

1. FETCH
   MAR <- [PC]              // address of next instruction to MAR
   PC <- [PC] + 1           // PC incremented ready for the next fetch
   MDR <- [[MAR]]           // instruction at that address read into MDR
   CIR <- [MDR]             // instruction copied to CIR

2. DECODE
   // CU splits CIR into opcode and operand
   // CU generates the control signals for the opcode

3. EXECUTE
   // ALU performs arithmetic/logic, or data is loaded/stored
   // status flags updated; result left in ACC or destination

Double-bracket notation: MAR <- [PC] copies the contents of PC into MAR; MDR <- [[MAR]] copies the contents of the memory location whose address is in MAR — the nested brackets mean 'dereference the address'. Exam trap: PC is incremented during fetch, before decode, so it already points at the next instruction while the current one executes; branch instructions then overwrite PC during execute, which is how jumps work.

Worked micro-trace for ADD #5 (immediate operand 5): fetch — MAR gets PC, PC increments, CIR gets ADD #5; decode — CU recognises an immediate add; execute — ACC <- ACC + 5, flags updated. For LOAD 200 (direct addressing): fetch as above; decode; execute — MAR <- 200, MDR <- [[MAR]], ACC <- [MDR]. Note the operand flows through MAR/MDR in execute — a second memory access after the fetch — which is exactly the detail that separates full marks from half marks on 'describe the execute stage'.

Pipelining overlaps the three stages: while one instruction executes, the next is decoded and a third fetched — so an ideal pipeline completes about one instruction per cycle instead of three cycles per instruction. Hazards break the flow, and exams ask you to name and exemplify all three:

Exam question pattern: 'Explain what a data hazard is and how a pipelined processor deals with it.' Full-credit: define the dependency (consecutive instructions, second needs the first's result before it is written back), give the two-instruction example, then state stall-and-forward as the fix.

Memory hierarchy, cache and virtual memory

Memory is arranged by the trade-off speed versus cost versus size — fastest and smallest at the top:

LevelTypical access timeTypical size
Registers< 1 nsbytes (tens of registers)
L1 cache~1 nstens of KiB
L2/L3 cache~4–20 nshundreds of KiB – tens of MiB
RAM (main memory)~100 nsGiB
SSD~100 microsecondshundreds of GiB
HDD~10 msTerabytes

Cache holds copies of recently and frequently used data. On a hit, the CPU reads from cache — no wait. On a miss, the data is fetched from RAM (a stall of ~100 cycles) and cached for reuse. Why cache improves performance: programs exhibit locality of reference — temporal locality (recently used data is used again: loop counters, accumulators) and spatial locality (nearby addresses are used together: sequential instructions, array traversal) — so a small cache captures a large fraction of accesses. Quote both locality terms; they are the explanation marks. Cache policies worth one line each: cache replacement replaces the least recently used line; write policies decide when cached writes reach RAM (write-through immediately, write-back lazily with a dirty bit).

Virtual memory extends RAM using secondary storage: memory is divided into fixed-size pages; a page table maps virtual addresses to physical frames; pages not currently in RAM live on disk. When a process accesses a page that is not in RAM — a page fault — the OS suspends the process, loads the page from disk, updates the page table and resumes. If pages are replaced too aggressively (RAM too small for the working set), the system thrashes: constantly swapping pages in and out and doing almost no useful work — the classic evaluation point. Exam question pattern: 'Explain how virtual memory allows a program larger than physical RAM to run, and why excessive reliance on it degrades performance.' Answer: pages of the program are swapped between RAM and disk via the page table on demand (page faults), so the program's full address space need not be resident; disk access is orders of magnitude slower than RAM, so heavy swapping (thrashing) dominates execution time.

Also know why the OS needs memory management at all: multiple programs run concurrently, so memory must be partitioned and protected — one process must not read or write another's memory; paging provides that isolation via the page table (each process has its own mapping), which is the link between the hardware and the OS section below.

Operating system functions: memory management, scheduling, interrupts

The OS is the layer between hardware and applications, and its examinable functions fall into four groups (OCR 1.2.1, WJEC 1.5, AQA 4.4.4).

Memory management: allocates and deallocates memory to processes; implements paging (fixed-size pages, any page fits any frame — no external fragmentation, small internal fragmentation in the last page) and segmentation (variable-sized logical units such as code, stack, heap — matches program structure but suffers external fragmentation); manages the page table and virtual memory; enforces protection between processes. The paging-vs-segmentation comparison is the standard question: paging divides memory into fixed-size blocks chosen for hardware convenience; segmentation divides into variable-size logical units chosen for the program's structure; both need the OS to translate addresses, and both enable sharing and protection.

Scheduling decides which ready process gets the CPU next. Know the algorithms, their fairness and their failure modes:

AlgorithmMethodKey property
Round robinEach process gets a fixed time slice, then rejoins the queueFair response time; slice too small = overhead, too large = poor responsiveness
First come, first servedRuns each process to completion in arrival orderSimple; short jobs stuck behind long ones (convoy effect)
Shortest job firstRuns the process with the smallest predicted durationBest average waiting time; needs prediction; long jobs can starve
Shortest remaining timePreemptive SJF — preempts if a shorter job arrivesEven better waiting time; more context switches; starvation risk
Multilevel feedback queuesMultiple queues with priorities; processes move between them on behaviourBalances interactive responsiveness with throughput

Exam pattern: 'A short interactive task arrives while a long batch job is running. Explain which scheduling algorithm gives the best response time.' Answer: round robin (or multilevel feedback) — the batch job is preempted at its time-slice boundary so the interactive task runs soon; FCFS would make it wait for the whole batch; SJF favours the short task once both are queued but cannot preempt a running job unless implemented as SRTN. Also know preemptive vs non-preemptive: preemptive schedulers can interrupt a running process (timer interrupt); non-preemptive wait for it to yield — and preemption is what makes multitasking possible.

Interrupt handling: an interrupt is a signal (I/O completion, timer tick, hardware fault, program error) that suspends the current process. The sequence to reproduce: (1) the processor finishes the current instruction; (2) it saves the current context (PC, status register, registers) on the stack; (3) it loads the interrupt service routine (ISR) address from the interrupt vector table and runs it; (4) on completion the saved context is restored and the interrupted program resumes transparently. Interrupts are what allow the CPU to multiplex between programs and to react to devices without busy-waiting — the exam point: polling wastes cycles checking devices repeatedly, whereas interrupts let the device signal the CPU only when needed.

Processor types, parallelism and performance

CISC vs RISC (OCR 1.1.2) — the comparison to reproduce in full:

FeatureCISCRISC
InstructionsMany, complex, variable lengthFew, simple, fixed length
ExecutionMultiple cycles; interpreted by microcodeOne cycle per instruction
Memory accessMany addressing modes; instructions can access memory directlyLoad/store architecture — only load/store touch memory
RegistersFewerMany
PipeliningHarder — variable instruction lengthDesigned for it — uniform stages
CompilerSimpler to target; hardware does moreMust do more work; hardware simpler

Evaluation line to add: modern x86 processors are externally CISC but internally translate to RISC-like micro-operations, so the distinction is about design philosophy, not clean categories; ARM processors (phones, Raspberry Pi) are RISC, chosen for power efficiency — one instruction per cycle and simpler decode burn less energy.

Parallel architectures: SIMD (single instruction, multiple data) applies one instruction to many data items at once — graphics pipelines and vector units; MIMD (multiple instruction, multiple data) is multiple independent cores running different instruction streams — general multicore. Also know the GPU as a co-processor: thousands of simple cores specialised for the massively parallel arithmetic of graphics and machine learning, while the CPU handles general sequential control flow; co-processors (maths, floating-point units) offload specific workloads from the main CPU.

Amdahl's law quantifies the limit of parallelism: if a fraction p of a program can be parallelised and the rest (1 − p) is serial, the speedup on n cores is:

speedup = 1 / ( (1 - p) + p / n )

Worked calculations to memorise (these are the exact exam patterns):

The conclusion to quote: beyond a few cores, returns diminish sharply and the serial fraction — not the core count — sets the maximum speedup. Exam question pattern: 'Explain why adding more cores eventually stops improving performance.' Answer: only the parallelisable fraction speeds up; the serial portion runs at the same speed regardless, so as n grows the p/n term vanishes and speedup approaches 1/(1-p), a hard ceiling set by the code's serial fraction. Add the counterpoint for evaluation: better single-core performance (clock speed, IPC, cache) helps serial code, whereas more cores only helps parallel code — which is why optimisation priorities depend on the workload.

💡 Worked Example

Exam-style: A program is 20% serial and 80% parallelisable. (a) Calculate the maximum speedup when run on 4 cores. [2 marks] (b) Calculate the maximum speedup with an unlimited number of cores. [1 mark] (c) Explain why adding more cores does not give a proportional speedup. [3 marks]
Mark-scheme logic: (a) Speedup = 1 / ((1 - 0.8) + 0.8/4) = 1 / (0.2 + 0.2) = 1 / 0.4 = 2.5 (1 mark for formula, 1 for 2.5x). (b) 1 / 0.2 = 5 (1 mark). (c) Only the parallelisable fraction benefits from extra cores (1). As n increases the term p/n approaches 0, so speedup approaches 1/(1-p) = 5x — a hard ceiling set by the serial fraction (1). The serial 20% runs on one core at unparallelisable speed no matter how many cores exist, so beyond a few cores additional processors add almost nothing (1).

❓ Practice Questions & Mark Schemes

State the purpose of the PC, MAR, MDR and ACC registers in the CPU. [4 marks]
Answer: PC: holds the address of the next instruction to be fetched (1). MAR: holds the address of the memory location about to be read or written (1). MDR: holds the data just read from, or about to be written to, the address in the MAR (1). ACC: holds the result of arithmetic and logic operations performed by the ALU (1). Trap to avoid: the PC holds the next instruction's address, not the current one.
Explain the difference between a cache hit and a cache miss, and why cache improves performance. [4 marks]
Answer: A hit means the data the CPU needs is already in cache, so it is read quickly (1); a miss means it is not, so the data must be fetched from RAM — a stall of tens to hundreds of cycles — and then cached (1). Cache improves performance because of locality of reference (1): temporal locality (recently-used data is reused, e.g. loop variables) and spatial locality (nearby addresses are used together, e.g. sequential instructions and array traversal), so a small cache serves a large proportion of accesses (1).
Describe the fetch stage of the fetch-decode-execute cycle, naming the registers involved. [4 marks]
Answer: The contents of the PC are copied to the MAR: MAR <- [PC] (1). The PC is incremented: PC <- [PC] + 1, ready for the next fetch (1). The instruction at the address in the MAR is read from memory into the MDR: MDR <- [[MAR]] (1). The instruction is copied from the MDR to the CIR: CIR <- [MDR] (1). Double brackets mean the contents of the memory location whose address is in the MAR.
Compare round robin and first-come-first-served scheduling for a system running one long batch job with frequent short interactive tasks. [4 marks]
Answer: Round robin gives each process a fixed time slice then preempts it (1), so short interactive tasks run within one slice of arriving — good response time (1). FCFS runs each job to completion in arrival order (1), so interactive tasks arriving behind the long batch job wait for it to finish — the convoy effect, poor responsiveness (1). Recommendation: round robin (or multilevel feedback queues), because preemptive time-slicing balances response time; slice length must be chosen to balance context-switch overhead against responsiveness.
Explain what happens when a process accesses a page that is not currently in RAM. [4 marks]
Answer: A page fault occurs (1). The OS suspends the process, saves its state, and locates the page on secondary storage (1). It loads the page into a free frame (or evicts another page, e.g. least recently used, to make room), and updates the page table mapping (1). The process is resumed and re-executes the access, which now succeeds — but disk access is orders of magnitude slower than RAM, so frequent faults cause thrashing and performance collapses (1).
Compare CISC and RISC processor design. [4 marks]
Answer: CISC has many complex, variable-length instructions, often interpreted by microcode and taking multiple cycles; RISC has few simple, fixed-length instructions executing in one cycle (1). CISC allows instructions to access memory directly with many addressing modes; RISC is load/store — only load and store instructions touch memory (1). RISC provides many general-purpose registers; CISC fewer (1). Evaluation: RISC's uniform instructions suit pipelining and give better power efficiency (ARM processors), while CISC makes compilers simpler; modern x86 externally CISC internally translates to RISC-like micro-operations (1).

🎬 Video Resources

📄 Past Papers & Exam Resources

🔗 Further Reading & Resources

🧠 Flashcards (Spaced Repetition)

📝 Exam Questions by Topic

🎯 Target Tests (Auto-Graded)

🎓 Smart Lesson (Guided)