Welcome to the World of Logic!

Ever wondered how a computer actually "thinks"? It doesn't use words or feelings; it uses Logic Gates. These are the tiny building blocks found inside a computer's processor. They take electrical signals (on or off) and make decisions based on them. By the end of these notes, you’ll understand how these simple "decision-makers" combine to run everything from your microwave to your smartphone!

1. The Basics: 1s, 0s, and Truth Tables

In computer science, we use Binary. This means everything is either:

  • 1 (True / On / High Voltage)
  • 0 (False / Off / Low Voltage)

To show how a logic gate works, we use a Truth Table. This is just a simple chart that lists every possible input and shows what the resulting output will be. Think of it like a "rule book" for the gate.

2. The Six Essential Gates

The AQA syllabus requires you to know six specific gates. Let's break them down one by one.

The NOT Gate (The Inverter)

The NOT gate is the simplest. It only has one input and it simply flips it to the opposite. If you give it a 1, it gives back a 0.

Analogy: A "contrary" friend who always says the opposite of whatever you say!

Boolean Expression: \( Q = \overline{A} \)

Quick Review: Input 0 \(\rightarrow\) Output 1 | Input 1 \(\rightarrow\) Output 0

The AND Gate (All or Nothing)

The AND gate only gives an output of 1 if ALL its inputs are 1.

Analogy: To go on a school trip, you need a signed permission slip AND the money for the bus. If you're missing either one, you can't go.

Boolean Expression: \( Q = A \cdot B \)

The OR Gate (Any Will Do)

The OR gate gives an output of 1 if at least one input is 1.

Analogy: You can enter the cinema if you have a paper ticket OR a digital ticket on your phone. If you have both, that's fine too!

Boolean Expression: \( Q = A + B \)

The XOR Gate (Exclusive OR)

The XOR gate is picky. It gives a 1 only if the inputs are different. It’s like the OR gate, but it "excludes" the case where both are 1.

Analogy: Ordering a "fixed price" meal where you can have soup OR salad as a starter, but definitely not both.

Boolean Expression: \( Q = A \oplus B \)

The NAND Gate (Not AND)

Think of this as an AND gate with a NOT gate stuck on the end. It does the exact opposite of an AND gate. It outputs a 1 unless both inputs are 1.

Boolean Expression: \( Q = \overline{A \cdot B} \)

The NOR Gate (Not OR)

This is an OR gate with a NOT gate on the end. It only outputs a 1 if both inputs are 0.

Boolean Expression: \( Q = \overline{A + B} \)

Key Takeaway: If you can remember AND and OR, you already know NAND and NOR—just flip the final answer!

3. Logic Circuit Diagrams

In your exam, you’ll see these gates drawn as symbols (the ANSI/IEEE standard). You need to be able to "trace" signals through them.

How to complete a Truth Table for a circuit:

  1. Start at the left with the inputs (usually A and B).
  2. Move through the gates one at a time.
  3. Write down the intermediate result after each gate.
  4. The final column is your output (usually Q).

Common Mistake to Avoid: Don't try to calculate the whole circuit in your head! Write the results of each individual gate above the wires in the diagram to stay organized.

4. Boolean Algebra

Sometimes it's easier to write logic as a mathematical equation. This is called Boolean Algebra.

The Symbols You Need:

  • \( \cdot \) means AND
  • \( + \) means OR
  • \( \oplus \) means XOR
  • A bar over a letter (\( \overline{A} \)) means NOT

Example: If you see \( Q = (A \cdot B) + C \), it means "A AND B, then OR the result with C."

5. Simplifying Logic with Identities

Computer scientists like efficiency. Why use three gates when one will do? We use identities to simplify expressions.

Common Identities to Remember:

  • \( A \cdot 0 = 0 \) (Anything AND 0 is always 0)
  • \( A \cdot 1 = A \) (Anything AND 1 stays the same)
  • \( A + 0 = A \) (Anything OR 0 stays the same)
  • \( A + 1 = 1 \) (Anything OR 1 is always 1)
  • \( A + A = A \) and \( A \cdot A = A \)

Memory Aid: Think of 1 as "True" and 0 as "False." If you say "True OR Anything," the whole statement is True! That's why \( A + 1 = 1 \).

6. De Morgan’s Laws

This is often the part students find trickiest, but there is a simple trick to it! De Morgan’s Laws help you break a "NOT" bar that covers multiple variables.

The Rules:

  1. \( \overline{A \cdot B} = \overline{A} + \overline{B} \)
  2. \( \overline{A + B} = \overline{A} \cdot \overline{B} \)

The "Break the Bar" Trick:
1. Break the bar in the middle.
2. Change the sign (AND becomes OR, or OR becomes AND).
It’s that simple!

Key Takeaway: To simplify a complex expression, always look for De Morgan's Law opportunities first, then use your basic identities.

Quick Summary Review

Gates: NOT (flip), AND (both), OR (either), XOR (different), NAND (not both), NOR (neither).
Math: \( \cdot \) is AND, \( + \) is OR.
Simplifying: Use identities and "Break the bar, change the sign" for De Morgan's.
Don't worry if this seems tricky at first! Logic is like a puzzle. Once you learn how the pieces fit together, it becomes much easier to see the patterns.