~/talk

Megahertz, Gigahertz, Registers and Instructions: How does a CPU actually work?

links:none on file
slides:none on file

Modern CPUs implement a modified Harvard/von Neumann model: tiny fast registers feed an ALU and control unit, programs are sequences of instructions (x86/ARM differences come from instruction sets), and a hardware stack supports call/return. Example assembly shows simple add requires multiple moves; pipelining and speculative execution hide the 5‑stage fetch/decode/execute/writeback sequence. Clock example: 3 GHz = 0.33 ns; caches cost roughly L1 ≈ 4 cycles, L2 ≈ 12, L3 ≈ 36 and main memory ~RAM ≈ 200 cycles. Context switch costs ~50 ns to kernel mode and ~3000 ns between threads, so avoid over‑threading and unnecessary allocations.

AI-written summary · about

  1. 0:00Introduction
  2. 1:38Starting from scratch
  3. 3:21Instruction storage
  4. 7:05Instruction sets
  5. 7:29Basic math
  6. 11:17Registers
  7. 16:19Stack Pointer
  8. 18:24Adding Registers
  9. 21:11Comparing Registers
  10. 24:30Do More Math
  11. 28:35Passing variables
  12. 31:10Instruction cycle
  13. 34:32System clock
  14. 38:20The problem
  15. 42:36Memory
  16. 49:06Thread Execution
  17. 55:59Instruction set
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.