Introduction to Boolean Logic
Welcome! In this chapter, we are going to dive into the "brain" of the computer. You might already know that computers only understand Binary (1s and 0s), but have you ever wondered how a computer actually makes decisions using just those two numbers?
The answer is Boolean Logic. By the end of these notes, you’ll understand how simple "gates" act like switches to process information, how to draw these circuits, and how to predict what a computer will do using Truth Tables. Don't worry if it sounds a bit like a puzzle at first—we'll solve it together step-by-step!
1. The Building Blocks: Logic Gates
Think of a Logic Gate as a tiny room with one or two doors (inputs) and one lightbulb (output). Depending on the gate's rule, the lightbulb will either turn on (1) or stay off (0).
The NOT Gate
The NOT gate is the "rebel" of the group. It always does the opposite of what you tell it. If you give it a 1, it gives you a 0. If you give it a 0, it gives you a 1.
Symbol Description: A triangle with a small circle (called an inversion bubble) at the tip.
Boolean Expression: \( \bar{A} \) (An overbar above the letter).
Truth Table:
Input A | Output
0 | 1
1 | 0
The AND Gate
The AND gate is very strict. The output is only 1 if both inputs are 1. If even one input is 0, the output is 0.
Analogy: To go on a school trip, you need a signed permission slip AND the money for the bus. If you are missing either one, you aren't going!
Symbol Description: Shaped like a capital letter D.
Boolean Expression: \( A \cdot B \) (A dot between the letters).
Truth Table:
A | B | Output
0 | 0 | 0
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1
The OR Gate
The OR gate is much more relaxed. The output is 1 if at least one of the inputs is 1. It only gives a 0 if both inputs are 0.
Analogy: You can get into a movie if you have a paper ticket OR an e-ticket on your phone. If you have either (or both!), you're in!
Symbol Description: A curved shape that comes to a point at the end (like a rocket ship or a shield).
Boolean Expression: \( A + B \) (A plus sign between the letters).
Truth Table:
A | B | Output
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 1
The XOR Gate (Exclusive OR)
The XOR gate is picky. It only gives a 1 if the inputs are different. If both are the same (both 0 or both 1), the output is 0.
Analogy: Think of a dinner deal where you can choose Steak OR Fish, but you can't have both. If you try to take both, the waiter says no (0)!
Symbol Description: The same as the OR gate, but with an extra curved line behind the inputs.
Boolean Expression: \( A \oplus B \) (A plus sign inside a circle).
Truth Table:
A | B | Output
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
Quick Review:
- NOT: Flips the bit.
- AND: Needs all 1s.
- OR: Needs at least one 1.
- XOR: Needs exactly one 1.
2. Understanding Boolean Expressions
In your exam, you might see letters and symbols instead of diagrams. Here is your "translation" guide:
- Dot \( \cdot \) means AND.
- Plus \( + \) means OR.
- Circle Plus \( \oplus \) means XOR.
- Overbar \( \overline{A} \) means NOT.
Example: The expression \( (A \cdot B) + \bar{C} \) means: (A AND B) OR (NOT C).
Did you know?
The name "Boolean" comes from George Boole, a mathematician from the 1800s. He invented this logic long before electronic computers even existed!
3. Truth Tables for Combined Circuits
When we combine gates, we get a Logic Circuit. To figure out what the final output is, we use a larger Truth Table. For AQA GCSE, you should be able to handle up to three inputs (A, B, and C).
Step-by-Step: Building a 3-Input Truth Table
If you have three inputs (A, B, C), there are 8 possible combinations of 1s and 0s. Here is a trick to write them out without missing any:
- Column A: Write four 0s, then four 1s.
- Column B: Write two 0s, two 1s, two 0s, two 1s.
- Column C: Write 0, 1, 0, 1, 0, 1, 0, 1.
Common Mistake:
Don't try to calculate the whole expression in your head! Add "intermediate columns" to your table for each part of the circuit. For example, if your circuit is \( (A + B) \cdot \bar{C} \), make a column for \( (A + B) \) and a column for \( \bar{C} \) before doing the final calculation.
4. Working Between Diagrams and Expressions
The exam might ask you to do two things: create an expression from a diagram, or draw a diagram from an expression.
From Diagram to Expression:
- Start from the left (the inputs).
- Label the output of the first gate you hit.
- Use that output as the input for the next gate.
- Keep going until you reach the final output.
From Expression to Diagram:
- Look for brackets first—these are your first gates.
- Draw the gates for the smaller parts of the expression.
- Connect the outputs of those gates into the final gate.
5. Summary and Key Takeaways
Key Points for Revision:
- Computers use Boolean logic to process binary data.
- You must know the 4 symbols: NOT, AND, OR, XOR.
- The Overbar is used for NOT, the Dot for AND, the Plus for OR, and the Circle-Plus for XOR.
- A Truth Table shows every possible outcome for a circuit.
- When drawing or calculating, always work systematically from the inputs toward the output.
Memory Aid:
Remember that AND looks like a D (the last letter of AND).
Remember that OR is like a pointed Oar for a boat!
Don't worry if this seems tricky at first! The more you practice drawing the tables and gates, the more it will feel like second nature. You've got this!