Skip to the content.

Study Plan 8

with notes

🧠 Logic Gates - Study Plan & Notes


✅ Study Plan

Day 1: Basics of Logic Gates

  • Understand what logic gates are
  • Learn AND, OR, NOT gates
  • Review Boolean expressions
  • Complete Hack #1 (Authorization)

Day 2: Advanced Gates

  • Learn NAND, NOR gates
  • Understand why they’re universal
  • Learn XOR and XNOR
  • Complete Hack #2 (Security system)

Day 3: Logic Applications + Simplification

  • Practice Boolean simplification using De Morgan’s Theorems
  • Review real-world examples
  • Complete Hack #3 (Traffic Light Controller)

Day 4: Creative Thinking + Homework

  • Create your own logic gate application (Extra Credit)
  • Submit MCQ and logic circuit task

📘 Logic Gates Overview

Definition
Logic gates are devices that use Boolean logic to produce output based on binary input (0 or 1).


🔌 Types of Gates

1. AND Gate ( && )

  • Output is 1 only if both inputs are 1
  • Boolean: A ⋅ B
  • Example Use: Keycard AND PIN for access
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

2. OR Gate ( || )

  • Output is 1 if at least one input is 1
  • Boolean: A + B
  • Example Use: Motion sensor OR button to open door
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1

3. NOT Gate ( !A )

  • Inverts the input
  • Boolean: Ā
  • Example Use: Thermostat off when temp exceeds limit
A NOT A
0 1
1 0

4. NAND & NOR

  • NAND: ¬(A ⋅ B), Universal Gate
  • NOR: ¬(A + B), Universal Gate
A B NAND NOR
0 0 1 1
0 1 1 0
1 0 1 0
1 1 0 0

Use: Found in self-driving car decision logic


5. XOR Gate ( )

  • Outputs 1 if inputs are different
  • Boolean: A ⊕ B
  • Example Use: Data comparison in memory
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

6. XNOR Gate ( )

  • Outputs 1 if inputs are the same
  • Boolean: A ⊙ B = ĀB + A B̄ = ¬(A ⊕ B)
  • Example Use: Pattern recognition
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1

🧮 Boolean Algebra & De Morgan’s Laws

  • ¬(A ⋅ B) = ¬A + ¬B
  • ¬(A + B) = ¬A ⋅ ¬B

Used to simplify logic circuits and reduce cost/complexity.


🛠 Popcorn Hacks

Hack #1: Secure Entry System (AND Gate)

```python def secure_entry_system(keycard, pin): return keycard & pin