Computer ScienceExam code: 0984

Computer Architecture

Hardware

Three characteristics of a CPU set how quickly it can process work: , cache size, and number of .

Clock speed

Clock speed is the number of fetch-decode-execute cycles the CPU can complete in one second, measured in hertz (Hz).

  • 1 Hz = 1 cycle per second.
  • 1 GHz (gigahertz) = 1 billion cycles per second.
  • A typical modern CPU runs at 2 to 5 GHz.

Common exam question

What a clock speed in gigahertz means

Question: State what is meant by clock speed, or by a clock speed or processor of a given number of gigahertz (1–2 marks).

Asked in 3 of the 17 papers. Clock speed is the number of fetch-decode-execute cycles (or instructions) the CPU can carry out in one second, so a figure in gigahertz is billions of cycles per second: a 4 GHz processor runs 4 billion cycles, or executes 4 billion instructions, every second. When the definition is worth two marks the number and the unit are the two points: one for the correct billions figure, the other for saying they are cycles, or clock pulses, per second. Give both even for one mark; a bare "it is how fast the processor works" names neither.

A higher clock speed means the CPU completes more cycles per second, so it processes more instructions per second. Doubling the clock speed roughly doubles the rate of instructions (assuming nothing else becomes a bottleneck).

Why not just push the clock speed to 100 GHz? Higher clock speeds:

  • Use more electrical power
  • Generate more heat
  • Require more advanced cooling
  • Hit physical limits in the silicon

So modern CPUs balance clock speed against power and heat, often around 3 to 5 GHz.

Cache size

Cache is a small, high-speed memory built into (or sitting beside) the CPU. It holds copies of frequently-used instructions and data so the CPU can grab them without making a slow trip out to main memory (RAM).

  • The CPU can access cache much faster than RAM.
  • A larger cache holds more frequently-used data, so more requests can be served by the cache and fewer slow trips to RAM are needed.
  • Typical sizes: from a few kilobytes (L1 cache, the fastest level) up to tens of megabytes (L3 cache, the slowest of the cache levels but still faster than RAM).

A larger cache size means better performance, because the CPU spends less time waiting for data to arrive from main memory.

Number of cores

A core is a complete processing unit within a CPU chip, with its own Control Unit, ALU, registers and accumulator. A modern chip usually has multiple that can each fetch, decode and execute instructions at the same time.

  • A single-core CPU handles one instruction stream at a time.
  • A dual-core CPU has 2 cores and can handle 2 instruction streams in parallel.
  • A quad-core CPU has 4 cores; an 8-core CPU has 8; modern server CPUs may have 64 or more cores.
Three CPU chips compared by core count. A single-core chip has one processing area, a dual-core chip is divided into two equal cores side by side, and a quad-core chip is divided into four cores, each able to fetch, decode and execute instructions at the same time
Source: What is Clock Speed by Save My Exams

For tasks that can be split across cores (video encoding, scientific computation, running many apps at once), more cores means more work done per second.

Side-by-side summary

CharacteristicIf increasedWhy performance improves
Clock speedMore cycles per secondMore instructions executed per second
Cache sizeMore frequently-used data stays close to CPUFewer slow trips to main memory
Number of coresMore instruction streams run at onceParallel work finishes in less wall-clock time

Common exam question

Explaining how a CPU change affects performance

Question: Explain the effect on performance of a higher clock speed, more cores or a larger cache, or explain the purpose of cache (2 marks).

Asked in 5 of the 17 papers. Two marks, the effect and the reason: write "performance improves because…" then the reason. Higher clock speed: more fetch-decode-execute cycles, and so more instructions, each second. More cores: each core runs a cycle simultaneously, so more instructions are processed each second. Larger cache: more frequently used data and instructions are accessed quickly from the cache rather than from the slower RAM. The purpose-of-cache question credits the same ideas, storage for frequently used data and instructions that is faster to access than RAM, plus its levels, L1 to L3.

Check what changed: when the CPU stays dual-core and only the clock speed rises, the marks are for cycles per second, not cores. The one-mark purpose of a core: to perform the fetch-decode-execute cycle, or to process an instruction.

Trade-offs and the headline number

Manufacturers usually advertise the clock speed first, but cache and cores often matter just as much. A 4 GHz quad-core with a large cache will usually outperform a 5 GHz single-core with a tiny cache on real-world workloads. When comparing two CPUs, you need to look at all three characteristics.

Quick check

5 short questions on this note. See what has stuck, and where to look if something hasn't.

About 2 minutes

Build on this topic