How Computers Make Decisions
Mastering Boolean Logic: The simple rules behind every processor.
The "Can I Play?" Rule
Computers don't "think" like humans. They follow strict True/False rules, just like strict parents.
Rule 1: The Strict Parent (AND)
"You can only play if you have finished homework AND tidied your room."
Homework + Room = No Play
Rule 2: The Relaxed Parent (OR)
"You can play if it is the weekend OR if it is a holiday."
Holiday = Play
We call this Boolean Logic. Let's see how it looks inside a chip.
1. The Three Logic Gates
Tap cards to flipComputers use digital switches called "gates". There are three you must know for the exam.
AND
Tap for definition
AND Gate
Output is 1 only if BOTH inputs are 1.
Also called: Conjunction
OR
Tap for definition
OR Gate
Output is 1 if EITHER (or both) inputs are 1.
Also called: Disjunction
NOT
Tap for definition
NOT Gate
Output is the INVERSE (opposite) of the input.
Warning: Don't forget the circle!
Logic Lab
Output (Q)
Try it: Turn both switches ON to light the bulb.
2. Mastering Truth Tables
A truth table lists every possible combination of inputs to show what the logic gate will do. You need to know how to fill these in for the exam.
The AND Rule
The output is 1 only if input A AND input B are both 1. Otherwise, it is 0.
00, 01, 10, 11. This is the standard order.
| Input A | Input B | Output Q |
|---|---|---|
| 0 | 0 | ? |
| 0 | 1 | ? |
| 1 | 0 | ? |
| 1 | 1 | ? |
Click the '?' cells to fill in the table.
Extension: Logic Scenarios
In exams, you often have to combine gates. Let's look at the "Garden Floodlight" scenario.
"The light (Q) turns on if the Switch is ON (C) AND motion is detected (A) at Night (NOT B)."