Brief Introduction
When you enter 5 + 3 into a calculator, the answer seems obvious: 8.
Yet to the CPU, "5 + 3" is not an abstract human thought—it is a sequence of encoded instructions, binary operands, and electronic micro-operations.
Our journey: Program → Memory → Instruction → Fetch → Decode → Execute → Result
1. What Is the CPU and What Does It Do?
The CPU (Central Processing Unit) is the primary computational brain of the computer, responsible for interpreting and executing software instructions:
2. Programs, Instructions, and Machine Code
While programs reside permanently on non-volatile SSD storage, execution transfers them through memory stages up to the processor registers:
CPUs do not execute Python or Java source code directly. Compilers translate high-level language statements into native machine instructions (ISA: x86-64 or ARM).
3. The Program Counter (PC)
How does the CPU know where the next instruction lives in memory? It tracks execution using a dedicated register named the Program Counter (PC):
4. The Classic Instruction Cycle: Fetch → Decode → Execute
The CPU uses the PC address to fetch the instruction from cache/RAM and loads it into the Instruction Register (IR).
The Control Unit decodes the binary opcode: identifying what operation to run and which operand registers are involved.
The ALU or target execution engine performs the requested computation and writes the result to destination registers.
5. Concrete Walkthrough: Executing 5 + 3
6. The Control Unit — The Traffic Police
The ALU can compute, but it cannot decide on its own when to add or when to subtract. The Control Unit generates the control signals that synchronize data flow across the entire processor.
7. Pipelining — Accelerating Modern Processors
A modern CPU does not idle waiting for an instruction to finish all stages. Like an industrial assembly line, it overlaps stages across consecutive instructions:
8. Branching, Loops, and Function Calls
When an if/else condition or while loop executes, branch instructions update the Program Counter to jump forward or backward to target memory addresses.
9. The Internal Architecture of the CPU
🧠 Key Takeaways
- The CPU is the central processing engine that executes program instructions.
- The Program Counter (PC) tracks the memory address of the next instruction.
- Fetch → Decode → Execute defines the universal instruction execution loop.
- The Control Unit orchestrates timings and signals across all internal units.
- Registers and the ALU work in concert to deliver lightning-fast computation.
- Pipelining overlaps execution phases to achieve higher instruction throughput per clock cycle.
Lesson 09 — How Data Moves Inside a Computer: Bus Architecture
In the next lesson, we examine:
And understand how the CPU, RAM, and motherboard interconnects communicate at immense bandwidths.