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 = Play
Homework + Room = No Play

Rule 2: The Relaxed Parent (OR)

"You can play if it is the weekend OR if it is a holiday."

Weekend = Play
Holiday = Play

We call this Boolean Logic. Let's see how it looks inside a chip.

1. The Three Logic Gates

Tap cards to flip

Computers 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

Choose Gate:
Input A 0
Input B 0
AND Gate
0

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.

Exam Tip: Notice how the inputs count up in binary?
00, 01, 10, 11. This is the standard order.
Input A Input B Output Q
00?
01?
10?
11?

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.

Problem

"The light (Q) turns on if the Switch is ON (C) AND motion is detected (A) at Night (NOT B)."

Input B (Daytime) Input A (Motion) Input C (Switch) Q
1. NOT B converts "Daytime" into "Nighttime".
2. First AND checks: Is it Night AND Motion?
3. Second AND checks: Is step 2 true AND Switch ON?

Final Challenge

1. Which symbol represents a NOT gate?

2. If Input A = 1 and Input B = 0, which gate outputs 1?

3. How many rows does a Truth Table need for 3 inputs?