🔄 A Quick Recap
In Lesson 3, we followed what happens when you click something.
We saw how the CPU grabs the instructions from storage, puts them into RAM, and then reads them one by one to do the job — like opening a game, showing a picture, or playing a video.
But what’s really inside the CPU that lets it do all of this?
Let’s break it down.
Tiny piece by tiny piece.
🧱 A CPU Is Made of Tiny Parts
The CPU looks like a small square “chip.”
But inside, it’s packed with millions (even billions) of tiny switches called transistors.
Remember switches from before?
They’re like tiny gates that say YES or NO, or 1 or 0.
And if you put a lot of these together in clever ways, you can make the CPU think!
Let’s look at the tiny parts inside:
📦 1. The ALU – Where Math Happens
ALU stands for Arithmetic Logic Unit. (Big words — but don’t worry!)
Let’s call it the math room.
This is the part where the CPU:
-
Adds and subtracts numbers
-
Compares things
-
Says things like: “Is this number bigger than that one?”
-
Decides: “Yes or no?”
💡 It uses simple switches (AND, OR, NOT) to do all this!
Even if it’s math like 495 + 33, the ALU does it one bit (one 0 or 1) at a time.
Slow?
Nope — it’s super fast!
📜 2. The Registers – Tiny Sticky Notes
The CPU needs a place to quickly remember numbers it’s working with.
That’s what registers are.
Think of them as:
🟦 Tiny sticky notes inside the CPU.
Each register can hold:
-
A number
-
A memory address (like “go look here in RAM”)
-
Or even a special instruction
Registers are faster than RAM but much smaller.
Only a few fit inside the CPU.
🗺️ 3. The Control Unit – The Team Leader
Who tells the CPU what to do next?
That’s the job of the Control Unit.
It:
-
Reads instructions
-
Tells the ALU: “Time to add!”
-
Tells the Registers: “Store that number!”
-
Tells RAM: “Bring in this data!”
The Control Unit is like a traffic cop 🚦 — waving hands and directing everyone.
🧭 4. The Clock – Tick, Tick, Tick…
Every time the CPU does something, it follows a beat — a tick.
This tick is made by the clock.
🕒 The clock goes:
-
Tick: Get instruction
-
Tick: Do the math
-
Tick: Show the answer
The more ticks per second, the faster your CPU.
We call these ticks clock cycles, and fast CPUs can tick billions of times every second!
That’s called gigahertz — like 3.2 GHz = 3.2 billion ticks per second.
🧮 5. The Decoder – Turning Code into Action
When you open an app, the CPU sees instructions — made of 0s and 1s.
But how does it know what to do?
It uses the Decoder.
The Decoder takes the 0s and 1s and says:
-
“Oh! That means ADD these numbers.”
-
“Ah! That means MOVE this data.”
-
“Okay! That means JUMP to another part of the code.”
It’s like the CPU’s translator.
🧪 A Real Example: Adding Two Numbers
Let’s say your program says:
“Add 5 + 3”
Here’s what happens:
-
The CPU gets the instruction: “Add 5 + 3”
-
The Decoder reads the code (0s and 1s)
-
The Control Unit says: “Hey ALU — it’s time to add!”
-
The Registers hold the numbers (5 and 3)
-
The ALU adds them = 8
-
The CPU stores 8 in another Register or sends it to RAM
All of this happens in just a few ticks.
And your screen shows the result — maybe “8” or maybe your game character jumps forward!
🔁 It Does This Over and Over
The CPU doesn’t stop.
It keeps:
-
Getting instructions
-
Decoding them
-
Doing the job
-
Storing or showing the result
-
Repeating
It does this millions of times per second.
🖼️ Picture Time: Let’s Imagine the CPU
Here’s a pretend diagram in your mind:
-
📥 Input (You click something)
-
🔄 Decoder (Understands the command)
-
🎛️ Control Unit (Tells everyone what to do)
-
🧮 ALU (Does the math or logic)
-
🗂️ Registers (Hold the numbers)
-
📤 Output (Screen shows the result)
Each part works with the others — like a tiny team inside your computer.