Topic 2 · Computer Organisation
Computer Science · Cheatsheet

Topic 2 · Computer Organisation

Chapter 3 · Inside the CPU

📋 Reference · always available
CPU
Central Processing Unit. The chip that runs every instruction. Brain of every computer.
Three CPU parts
Control Unit (manager, fetches + decodes) + ALU (worker, does maths/logic) + Registers (tiny notebooks, hold current values).
Fetch–Decode–Execute
Eternal loop. FETCH instruction from RAM (using PC) → DECODE (CU) → EXECUTE (ALU/etc) → PC advances → repeat.
Program Counter (PC)
Special register holding the ADDRESS of the next instruction. JUMP instructions overwrite it.
Instruction Set (ISA)
The fixed list of operations a CPU understands (LOAD, ADD, JUMP). x86 (Intel/AMD), ARM (phones/Apple).
Clock speed (GHz)
Cycles per second. 3 GHz = 3 billion. Higher = more work + more heat + more power.
Cores
Multiple complete CPUs on one chip. Each runs independently. 4-core 3 GHz can do up to 12 GHz of total work — IF the program is parallel.
Memory hierarchy
Register (~1 ns) → L1 (~1 ns) → L2 (~3 ns) → L3 (~12 ns) → RAM (~100 ns) → SSD (~100 μs) → HDD (~10 ms). Each step ~10× larger + slower.
Cache hit / miss
HIT: data is in cache, ~1 ns. MISS: data not in cache, ~100 ns + CPU stall = ~300 wasted cycles.
Locality of reference
Why caches work. Temporal: recent addresses likely reused. Spatial: nearby addresses likely accessed next.
RAM vs storage
RAM = working memory, fast, VOLATILE (lost on power off). Storage (SSD/HDD) = permanent, slow, non-volatile.
Exam trap
CU ≠ ALU. CU manages, ALU computes. RAM ≠ Cache. Cache is smaller, on-CPU, ~100× faster.