1 / 22
Computer Science · Grade 6 · Chapter 2

Logic Gates Refresher

From microscopic transistors to complex digital circuits: how computers make instant decisions.

Lesson Overview

Learning Objectives

Hardware Connection

What Is Inside a Microprocessor?

Transistors (Micro Switches)

A modern CPU contains billions of microscopic electronic switches called transistors. They turn on (1) or off (0).

Logic Gates (Building Blocks)

Transistors are wired together to form logic gates that perform fundamental logical operations in hardware.

Real-World Case Study

The Automated High-Security Vault

A bank vault door will unlock ONLY IF a valid Keycard is swiped AND a Fingerprint matches, OR if the Manager Emergency Key is turned.

Smartboard Challenge: How many inputs does this system have? Which logic gates would build this security circuit?
Hardware Fundamentals

Binary Voltage Signals

Computers do not understand numbers or letters — they only process electrical signals.

LOW Voltage = 0 (False)

0 Volts represents Off, False, No Signal, or Inactive Sensor.

HIGH Voltage = 1 (True)

5 Volts (or 3.3V) represents On, True, Active Signal, or Triggered Sensor.

Core Gate #1

The AND Gate (All or Nothing)

Output is 1 (True) ONLY IF ALL inputs are 1.

Rule & Analogy

Like a bank vault requiring BOTH keycard AND pin code. If either is missing (0), output stays 0.

Input AInput BOutput (A AND B)
000
010
100
111
Core Gate #2

The OR Gate (Inclusive OR)

Output is 1 (True) if AT LEAST ONE input is 1.

Rule & Analogy

Like a house burglar alarm: triggers if the Front Door sensor opens OR the Back Window sensor opens.

Input AInput BOutput (A OR B)
000
011
101
111
Core Gate #3

The NOT Gate (The Inverter)

Takes a single input and flips it to the opposite value.

Rule & Analogy

If input is 1, output is 0. If input is 0, output is 1. Used to flip logic conditions in hardware.

Input AOutput (NOT A)
01
10
Inverted Logic

NAND and NOR Gates

Adding an inverter (NOT) to the output of AND and OR creates universal logic gates.

NAND = NOT AND

NAND Gate

Output is 0 ONLY when both inputs are 1. Used in flash memory chips (NAND SSDs)!

NOR = NOT OR

NOR Gate

Output is 1 ONLY when both inputs are 0. Used in control systems.

Specialized Gate

The XOR Gate (Exclusive OR)

Output is 1 IF AND ONLY IF inputs are DIFFERENT from each other.

Rule & Analogy

Like a hallway light controlled by two stair switches: flipping either switch changes the light state!

Input AInput BOutput (A XOR B)
000
011
101
110
Master Table

Comparing Gate Outputs side-by-side

ABANDORXORNANDNOR
0000011
0101110
1001110
1111000
Combined Circuits

Building Multi-Gate Logic

Combining gates allows computers to calculate addition, subtraction, and branch decisions.

STAGE 1

Inputs A & B

A = 1, B = 1 enter an AND Gate.

STAGE 2

Intermediate Output X

AND Gate outputs X = 1.

STAGE 3

NOT Gate Inverter

X = 1 enters a NOT Gate.

STAGE 4

Final Output Z

Z = 0 (NAND behavior!).

Engineering Application

Car Seatbelt Warning Circuit

System Rule:

The alarm buzzer sounds IF the Engine is ON (1) AND the Seatbelt is NOT buckled (0).

// Signal flow in hardware logic: Seatbelt_Sensor = 0 (unbuckled) Inverted_Seatbelt = NOT(Seatbelt_Sensor) = 1 Engine_State = 1 (running) Buzzer_Output = Engine_State AND Inverted_Seatbelt = 1 (BUZZ!)
Myth Buster

Misconception: OR vs XOR

❌ Common Confusion

Assuming standard OR means "one or the other, but not both" in computer science.

✅ Precise Computer Logic

Standard OR outputs 1 when both inputs are 1. Only XOR outputs 0 when both are 1!

Smartboard Challenge

Predict Output: Circuit Puzzle #1

Input A: 1 | Input B: 0

1. Inputs A and B pass into an OR Gate → Output X.

2. Output X and Input C (0) pass into an AND Gate → Final Output Z.

Solve on smartboard: What is value X? What is final Output Z?
Smartboard Challenge

Spot the Broken Logic Circuit

A smart green-house system is supposed to open the window if Temperature > 30°C (1) AND Humidity > 80% (1).

The engineer used an OR Gate by accident!

Group Discussion: What goes wrong in the greenhouse because of this logic gate bug?
Guided Practice

Designing a Smart Streetlight

Design a circuit logic that turns on streetlights when it is DARK (Night = 1) AND Motion is detected (Motion = 1), OR if Manual Override Switch is ON (1).

Formula: Streetlight = (Night AND Motion) OR Override
Interactive Quiz · Question 1

What does an AND gate output when Input A = 1 and Input B = 0?

A0
B1
C2
DUndefined
Click to reveal answer
Interactive Quiz · Question 2

Which logic gate outputs 0 ONLY when both inputs are 1?

AAND Gate
BOR Gate
CNAND Gate
DNOR Gate
Click to reveal answer
Interactive Quiz · Question 3

If Input A = 1 and Input B = 1, what is the output of an XOR gate?

A0
B1
Click to reveal answer
Lesson Recap

Summary of Key Takeaways

Exit Ticket

Before You Leave

Complete this truth table puzzle in your notebook:

If A = 0 and B = 1, find the output of:

1. A OR B = ___

2. NOT (A AND B) = ___

Next Chapter: Introduction to Scratch Programming Environment!