Foundations20 min · Lesson 1 of 6
CPU Architecture & Instruction Sets
Demystifying the silicon. Learn how registers, the ALU, and clock cycles combine to execute code.
How a CPU Actually Works
At the lowest level, every program you write is translated into a series of binary instructions. The Central Processing Unit (CPU) is the engine that fetches, decodes, and executes these instructions.
The Fetch-Decode-Execute Cycle
- Fetch: The Control Unit gets the next instruction from RAM.
- Decode: The instruction is broken down into an opcode (command) and operands (data).
- Execute: The Arithmetic Logic Unit (ALU) performs the operation.
Modern CPUs handle billions of these cycles per second (GHz), using pipelines to start the next instruction before the current one finishes.
Knowledge Check
1. Which component of the CPU is responsible for performing mathematical and logical operations?