Which part of the processor does the math?
Lesson 5.4 · The Math Department
Sarah · Rob · Mark
A chip diagram with one block labeled ALU.
Sarah wants to know where in the laptop’s processor Jenny’s adder actually lives.
Rob finds a diagram of a chip: a lot of blocks with labels. One of them says ALU. Mark guesses it does everything.
Rob says it does the math and the comparing, and nothing else. Everything else on the chip is there to feed it.
The short answer
The ALU: the arithmetic logic unit, built from adders and gates exactly like Jenny’s. It adds, subtracts, compares and does logic, and it’s only one small block on the chip. The rest of the processor is about keeping it busy, which is what Module 6 is about.
Try it yourself
Sort each job: is it the ALU’s, or somebody else’s?
1 of 5
Add two numbers
Put it in
What you just did has a name
The ALU
The ALU, or arithmetic logic unit, is the part of a processor that does arithmetic (adding, subtracting) and logic (AND, OR, NOT, comparing two numbers).
It’s built from adders and gates like the ones in this module. It doesn’t decide what to calculate.
Another part, the control unit, hands it numbers and tells it which operation to do.
A few more things
Comparing is subtracting
To check whether 7 is bigger than 5, an ALU can subtract and look at whether the answer came out negative. That’s how gates make the decisions from Module 4.
Multiplying is repeated adding
Early ALUs multiplied by adding and shifting, over and over. Modern chips have dedicated multipliers, but it’s the same idea, built bigger.
More than one
A modern processor has several ALUs per core so it can do more than one calculation at a time. Module 7 gets into cores.
Go deeper
The longer version, if you want it.
Flags
Every time the ALU finishes, it also sets a few one-bit flags: was the answer zero, was it negative, did it overflow. Those flags are how the rest of the processor finds out what happened.
When a program says “if the score is zero, end the game,” the processor has the ALU subtract or compare, then checks the zero flag, then jumps to the right instruction. Module 6 shows that jump in action.
Quick check
A game checks whether your health is below 10. Which part of the processor works that out?
Let’s take it slower
Picture a restaurant kitchen. There’s a cook who only chops and measures, very fast. A manager reads the orders and hands the cook what to chop. Waiters carry food in and out. The cook is the ALU. The manager is the control unit. The waiters are the rest of the computer, bringing numbers in and taking answers out.
More examples
Your calculator app
Every tap of the equals sign is a trip to the ALU, plus a lot of work to show the answer nicely.
A spreadsheet total
A column of a thousand numbers is a thousand trips through the adder, done before you lift your finger.
Back to the question
So which part does the math?
Show the answer
The ALU: the arithmetic logic unit, built from adders and gates exactly like Jenny’s. It adds, subtracts, compares and does logic, and it’s only one small block on the chip. The rest of the processor is about keeping it busy, which is what Module 6 is about.
One last question
Sarah asks what the ALU is. Who nailed it?
Talk Card
Talk Card · 5.4
The ALU is the processor’s math department. It adds, subtracts, compares and does logic, using adders and gates. Another part tells it what to work on.
How Computers Work · pettigrewlab.com/learn


