Part I · How it works
2. How a CPU works
- 2.1What a CPU does: instructions and architecturesA CPU runs a stream of machine instructions: load, add, compare, jump, store. Which instructions exist, and how they're encoded, is its architecture: x86-64, ARM64 (aarch64) or RISC-V.
- 2.2Cores, threads and socketsA core is a complete processor. A chip (package, or socket) holds several; a server board can hold several chips.
- 2.3CPU caches: why memory layout mattersRAM is about 100 times slower than the CPU's own registers. Small, fast memories in the chip keep recent data close: L1 (tens of KiB per core, a few cycles), L2 (MiB, about a dozen cycles), L3 (shared, tens of cycles).
- 2.4Clock speed, turbo and power savingA CPU's speed changes all the time: it climbs when there's work, drops when idle, and goes above its base frequency (turbo) while power and heat allow.
- 2.5Speculative execution and CPU flawsTo stay busy, a CPU guesses: which way a branch goes, what memory will hold, and runs ahead. Wrong guesses are thrown away.