What is CPU
Part of the Fundamentals section of Coddy's Assembly journey — lesson 1 of 45.
The CPU (Central Processing Unit) is the brain of the computer. But unlike a human brain, it is actually very simple. It does only one thing: it reads instructions from memory and executes them, one by one, very fast. When you write Assembly code, you're giving direct instructions to the CPU.
Unlike high-level languages like Python or JavaScript that hide hardware details, Assembly language allows you to control exactly what the CPU does, step by step.
Think of the CPU as a very fast worker who:
- Cannot think or make decisions on its own
- Follows simple commands like "add these two numbers" or "move this value there"
- Does millions of these simple commands every second
Inside the CPU there are tiny storage boxes called registers. A register holds a single number. The CPU can access registers extremely fast — much faster than accessing main memory (RAM).
The CPU also has a special register called the Program Counter (PC). The PC holds the memory address of the next instruction to execute. After each instruction, the PC automatically moves to the next address.
Key facts about a CPU:
| Fact | Explanation |
|---|---|
| It executes one instruction at a time | No multitasking at the hardware level |
| It only understands numbers | Everything (instructions, data, addresses) is a number |
| It has no memory of its own (except registers) | Everything must be stored in RAM |
| It is incredibly fast | Modern CPUs execute billions of instructions per second |
Try it yourself
This lesson doesn't include a code challenge.
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1The Machine
What is CPUMemoryRegisters vs MemoryHow instructions workTwo-File PatternThe x86-64 Architecture