How the CPU Actually Works (Key Registers & Theory)
The Central Processing Unit (CPU) is the computer's engine. Every second, it repeats the Fetch-Decode-Execute cycle billions of times: fetching an instruction from memory, decoding what it means, and executing it.
• PC (Program Counter): Address of the NEXT instruction.
• MAR: Address in RAM we are reading/writing.
• MDR: Holds data/instruction fetched from or sent to RAM.
• CIR: Holds instruction currently being decoded and executed.
• ACC (Accumulator): Holds temporary calculation results.
Under The Hood: Live Register State & Full 32-Cell RAM Inspector
| Reg | Full Name | Denary | Hex | Role |
|---|---|---|---|---|
| PC | Program Counter | 00 | 0x00 | Holds address of NEXT instruction |
| MAR | Mem Address Reg | 00 | 0x00 | Holds RAM address to read/write |
| MDR | Mem Data Reg | --- | --- | Holds data/instruction fetched from RAM |
| CIR | Current Instr Reg | --- | --- | Holds active instruction while decoded & executed |
| ACC | Accumulator | 0 | 0x00 | Stores temporary calculation results |
| Addr | Contents | Type |
|---|
"The contents of the Program Counter (PC) are copied to the Memory Address Register (MAR) via the address bus."
The Three Major CPU Performance Factors — Exam Essentials
Clock Speed — The CPU Heartbeat
Clock speed is measured in Hertz (Hz or GHz) and represents the frequency of electrical pulses generated by the system clock. 1 GHz equals one billion Fetch-Decode-Execute cycles every single second. A higher clock frequency allows the CPU to process more instructions per second, leading to faster program execution.
Cache Memory — On-Chip Desk vs Off-Chip Library
Cache is high-speed Static RAM (SRAM) constructed directly on the CPU silicon die, providing sub-nanosecond access latency. Frequently used instructions and data are kept here. When data is found in cache (a Cache Hit), the processor retrieves it immediately without pausing. Main memory (RAM) is located across the motherboard bus and takes roughly 70ns. When data is missing from cache (a Cache Miss), the CPU must stall and wait for bus transfer.
Number of Cores — Parallel Processing
Each CPU core contains its own independent Arithmetic Logic Unit (ALU), Control Unit (CU), and internal registers. A quad-core processor can execute four distinct instructions simultaneously.
- Software must be written for multithreading; single-threaded programs can only run on one core while remaining cores stay completely idle.
- Thread coordination and core-to-core communication introduce management overhead.
- All cores contend for the same shared memory bus, shared cache levels, and RAM bandwidth.
Beyond GCSE — How Modern CPUs Eliminate Idle Stalls
In a classic Fetch-Decode-Execute design, functional sub-units (such as the ALU or instruction decoder) frequently sit completely idle while waiting for high-latency memory or conditional outcomes. Modern high-performance processors use advanced hardware engineering to keep execution units continuously busy:
Branch Prediction and Speculative Execution
When a program reaches an IF / ELSE condition or loop, the CPU encounters a branch. Rather than sitting idle waiting for the condition to be calculated, modern CPUs predict which path the code will take (often with over 95% accuracy) and execute instructions ahead of time along the predicted path. If the prediction is verified correct, execution proceeds without delay. If incorrect, the speculative work is discarded and the pipeline restarts on the correct path.
Instruction Pipelining
Operating like an industrial assembly line, the CPU divides instruction processing into overlapping stages. While instruction 1 is in the Execute stage, instruction 2 is simultaneously being Decoded, and instruction 3 is already being Fetched from cache. This overlap ensures every internal functional unit performs work on every single clock cycle.
Out-of-Order Execution (OoO)
When an instruction stalls awaiting data from slow system RAM, modern processors do not freeze the entire core. Hardware schedulers scan forward in the instruction queue, identify later instructions that do not depend on the missing data, and execute them out of original program order to prevent wasted clock cycles.
Primary Storage: RAM vs ROM Interactive Comparator
Primary storage consists of memory chips directly connected to the CPU via high-speed memory buses. Use the power switch above to test volatility, and try writing to both chips below.
RAM (Random Access Memory)
Direct working workspace for active CPU executionROM (Read-Only Memory)
Permanent factory-burned firmware for system startup| Feature | RAM (Random Access Memory) | ROM (Read-Only Memory) |
|---|---|---|
| Volatility | Volatile — loses all contents instantly if power is cut. | Non-volatile — data is permanently retained with zero power. |
| Read / Write | Read and Write — CPU continuously writes, edits, and reads data at nanosecond speeds. | Read-Only — Burned into semiconductor circuits at the factory. CPU can only read. |
| What It Stores | The active Operating System, running applications, and currently open files/documents. | The BIOS / UEFI firmware and the Bootstrap Loader needed to start the computer. |
| Capacity | Large: Typically 8 GB to 64 GB in modern laptops/desktops. | Small: Typically 4 MB to 16 MB (just enough for firmware). |
Why Secondary Storage is Essential
The CPU can only directly fetch instructions from Primary Storage (RAM & Cache). However, a computer with only RAM and ROM would be practically useless for two critical reasons:
1. RAM is Volatile (Data Retention)
Because RAM requires a continuous electrical charge to refresh its capacitors, all data is permanently lost when the computer powers off or sleeps. Secondary storage is non-volatile, keeping your operating system, installed software, games, photos, and saved work permanently preserved for decades.
2. Capacity & Cost Constraints
High-speed RAM is physically complex and expensive per gigabyte. A typical system has 16 GB of RAM, but a single modern game or video library can require hundreds of gigabytes. Secondary storage provides massive terabyte storage at a tiny fraction of the cost per gigabyte.
Secondary Storage Simulation: HDD vs SSD Workbench
Switch between magnetic and solid-state storage to see the difference between mechanical latency and semiconductor speeds. Test file fragmentation, defragmentation, and discover how deleted files really work!
| File Name | Sector Chain | Status |
|---|
File Read Speed: Fragmented HDD vs Defragged HDD vs Solid-State Drive (SSD)
Comparing Secondary Storage: Magnetic vs Solid-State vs Optical
Exam questions frequently ask you to recommend a storage type for a specific real-world scenario (e.g. an action camera, a backup server, or distributing software). You must evaluate across these 6 key characteristics:
| Characteristic | Magnetic (HDD / Tape) | Solid-State (SSD / USB Flash) | Optical (CD / DVD / Blu-Ray) |
|---|---|---|---|
| 1. Capacity | Very High: 1 TB to 20+ TB. Massive storage for servers and backups. | High: 256 GB to 8 TB. Plenty for OS, software, and games. | Low: CD: 700 MB, DVD: 4.7 GB, Blu-ray: 25–50 GB. |
| 2. Speed (Read/Write) | Moderate: ~150 MB/s. Slower due to physical seek time and rotation. | Very Fast: 500 MB/s to 7,000+ MB/s (NVMe). Instant access. | Very Slow: ~10–30 MB/s. Mechanical laser tracking. |
| 3. Portability | Low: Bulky, heavy, requires delicate handling and SATA/USB cables. | Excellent: Tiny, lightweight (M.2 sticks, USB flash thumb drives). | High: Flat, lightweight discs, easily posted in envelopes. |
| 4. Durability | Poor: Dropping an HDD while running causes a catastrophic head crash. | Very High: Shock-resistant. No moving parts to break if dropped. | Moderate: Easily scratched or warped by sunlight and heat. |
| 5. Reliability | High: Excellent long-term retention if kept stationary and cool. | High: Highly reliable, though cells have a finite write cycle limit. | Low–Moderate: Discs can degrade or scratch after repeated handling. |
| 6. Cost per GB | Very Cheap: Around £0.015 per GB. Best for mass data archives. | Moderate: Around £0.06 per GB. More expensive per gigabyte. | Very Cheap per Unit: Pennies per blank disc, but low capacity. |
Key Exam Traps & Core Concepts
Never Confuse the MAR and the MDR
This is one of the most frequently lost marks on GCSE Computer Science papers. Remember their exact roles:
• Holds the memory address (location) where data or an instruction is to be fetched from or written to.
• Connected to the Address Bus.
• Holds the actual data value or instruction that has been read from RAM or is waiting to be written to RAM.
• Connected to the Data Bus.
Why More Cores Does Not Guarantee Faster Performance
A common exam question asks why a quad-core CPU will not run four times faster than a single-core CPU:
• Overhead & Communication: The operating system must coordinate and synchronise threads across cores, consuming clock cycles.
• Resource Contention: All cores share the same memory bus and RAM. Accessing RAM creates a bottleneck.
The Stored Program Concept (Von Neumann)
Never Confuse RAM and ROM
Both are primary storage chips directly wired to the CPU, but their physical characteristics are opposites:
• Volatile: Needs constant electrical power; wipes completely on shutdown.
• Read & Write: CPU continuously loads and modifies active apps, OS code, and open files.
• Non-Volatile: Retains data permanently when powered off.
• Read-Only: Factory burned. Stores BIOS/UEFI firmware and the Bootstrap Loader.
Why Secondary Storage is Needed & 6 Assessment Factors
RAM is volatile (temporary) and small in capacity. Secondary storage is non-volatile and provides high-capacity, long-term file retention.
1. Capacity: HDD (Huge TBs) > SSD (High GBs/TBs) > Optical (CD 700MB, DVD 4.7GB, BD 25GB).
2. Speed: SSD (instant, 500–7000 MB/s) > HDD (150 MB/s, physical seek) > Optical (~15 MB/s).
3. Portability: SSD/USB flash (small, light) > Optical discs > HDD (heavy, bulky).
4. Durability: SSD (shockproof) > Optical (scratches easily) > HDD (fragile head crash if dropped).
5. Reliability: SSD & HDD (high when treated well) > Optical (laser dye degrades).
6. Cost per GB: Optical & HDD (pennies per GB) vs SSD (higher cost per GB).
Defragmentation (HDD) vs Why You NEVER Defrag an SSD
A frequent exam question explores how file fragmentation affects performance:
• On an SSD: Access time to any flash cell is identical (instant electrical pulse, zero seek time). Non-contiguous blocks do not slow it down. Furthermore, flash cells have a finite number of write cycles (P/E wear). Defragmenting an SSD needlessly writes gigabytes of data, wearing out the flash cells prematurely!
Exam Style Questions with Mark Schemes
Q1: Describe the role of the Program Counter (PC) and the Memory Address Register (MAR) during the fetch stage of the fetch-decode-execute cycle.
Q2: A computer manufacturer claims that an 8-core CPU will execute programs four times faster than a dual-core (2-core) CPU with the same clock speed. Explain why this claim is not true in practice.
Q3: Explain what cache memory is and why having more cache memory improves CPU performance.