Show understanding of how factors contribute to the performance of the computer system

4.1 Central Processing Unit (CPU) Architecture

What is a CPU?

Think of the CPU as the brain of a computer. It reads instructions (the program), processes data, and sends results to other parts of the system. The main parts are:

  • ALU (Arithmetic Logic Unit) – does maths and logic.
  • 🧠 Control Unit – tells the ALU what to do.
  • 📦 Registers – tiny, super‑fast storage for current data.
  • 🗂️ Cache – keeps frequently used data close at hand.

Key Performance Factors

The speed of a computer depends on several intertwined factors. Below is a quick guide to the most important ones:

Factor How It Helps Example
Clock Speed ($f_{\text{clock}}$) Higher frequency means more cycles per second. 2 GHz = 2 × 10⁹ cycles/second.
Instruction‑Per‑Cycle (IPC) Number of instructions finished each cycle. A 4‑IPC CPU can finish 4 ops per cycle.
Cache Size & Hierarchy Reduces memory access time. L1 cache (small, fast), L2/L3 (larger, slower).
Pipeline Depth More stages = higher throughput but more stalls. A 5‑stage pipeline can fetch, decode, execute, memory, write‑back.
Parallelism (SIMD, Multi‑Core) Runs many instructions at once. A 4‑core CPU can handle 4 threads simultaneously.

CPU Pipeline Explained

Imagine a factory line where each worker does a specific task. The CPU pipeline works the same way:

  1. 📥 Fetch – read the instruction from memory.
  2. 🔍 Decode – figure out what the instruction does.
  3. ⚙️ Execute – ALU performs the operation.
  4. 💾 Memory – read/write data if needed.
  5. 📤 Write‑Back – store the result in a register.

Each stage works on a different instruction each cycle, so after the first cycle, the CPU can finish one instruction per cycle (ideal IPC = 1). Real CPUs use techniques like out‑of‑order execution to push IPC above 1.

Exam Tip: Performance Formula

Remember the classic performance equation:

$$\text{Performance} = \frac{\text{Instructions}}{\text{Clock Cycles} \times \text{Clock Time}} = \frac{IPC \times f_{\text{clock}}}{1}$$

Instructions – total number of instructions executed.
Clock Cycles – how many cycles were needed.
Clock Time – duration of one cycle (inverse of clock speed).
Tip: When comparing two CPUs, look at both clock speed and IPC – a higher clock speed alone isn’t enough if IPC is low.

Quick Flashcard

What is the role of cache?
Cache stores a small amount of data that the CPU uses most often, reducing the time it takes to fetch data from main memory. This speeds up overall performance, especially for repeated operations.

Revision

Log in to practice.

2 views 0 suggestions