After this chapter you will be able to
- convert a clock speed into cycle time and instructions per second
- explain cores, threads and simultaneous multithreading
- calculate performance using clock speed, IPC and Amdahl’s law
- trace the instruction cycle and calculate pipeline speed-up
- compare RISC with CISC and x86 with ARM
- decode a CPU name and read a CPU spec sheet
Units used in this chapter. Clock speeds: 1 GHz = 10⁹ cycles per second. Memory addresses follow the exam convention, where 1 GB = 2³⁰ bytes, so 2³² bytes = 4 GB. MIPS means million instructions per second.
46.1 What the Clock Counts
The clock is an electrical signal that switches at a steady rate, like a metronome for the processor. Each tick is one clock cycle. The CPU performs its steps in time with these ticks.
- Clock speed is measured in hertz: 1 GHz = 1,000,000,000 cycles per second.
- Cycle time = 1 ÷ clock frequency.
Worked example — a 3.5 GHz processor
Cycle time = 1 ÷ (3.5 × 10⁹) s = 0.2857 × 10⁻⁹ s ≈ 0.286 ns.
| Clock speed | Cycle time |
|---|---|
| 1 GHz | 1 ns |
| 2 GHz | 0.5 ns |
| 3 GHz | 0.33 ns |
| 4 GHz | 0.25 ns |
| 5 GHz | 0.2 ns |
Clock speed rose quickly through the 1990s and early 2000s, reaching a few GHz. Heat and power limits then pushed designers to add cores and improve the work done per cycle, rather than raise the clock further.
⚠ COMMON CONFUSION — GHz counts cycles, not work. A 2 GHz processor that completes 3 instructions per cycle does 6 billion instructions per second. A 3 GHz processor that completes 1 instruction per cycle does only 3 billion. The 2 GHz chip is faster.
⚡ QUICK FACT — Gordon Moore observed in 1965 that the number of transistors on a chip was doubling every year. In 1975 he revised the pace to about every two years. This observation is known as Moore’s Law.
46.2 Cores, Threads and SMT
- A core is a complete processing unit with its own ALU, control unit, registers and usually its own L1 and L2 cache (Chapters 4 and 6).
- A thread is an independent stream of instructions that the operating system can schedule onto a processing unit.
- SMT (Simultaneous Multi-Threading) lets one core keep the state of two threads and run them by sharing the core’s execution units. Intel calls its version Hyper-Threading. The gain is usually well short of a doubling.
The operating system sees each thread as a logical processor.
| Processor | Cores | Threads | Logical processors seen by the OS |
|---|---|---|---|
| Quad-core, no SMT | 4 | 4 | 4 |
| Quad-core with SMT | 4 | 8 | 8 |
| Six-core with SMT | 6 | 12 | 12 |
★ EXAM POINT — Threads = logical processors seen by the operating system. Hyper-Threading is Intel’s name for SMT.
Extra cores and threads help only when the work can be split. The next section shows why.