Logic Gates

Logic Gates

Overview

Logic gates are the fundamental building blocks of digital circuits, taking one or more input signals, performing logical operations, and generating output signals. In this lesson, we will learn about the types of basic logic gates, truth table construction, Boolean algebra laws, and methods for simplifying logic expressions.

Difficulty: โญ (Beginner)


Table of Contents

  1. Logic Gate Basics
  2. Basic Gates (AND, OR, NOT)
  3. Universal Gates (NAND, NOR)
  4. XOR and XNOR Gates
  5. Truth Table Construction
  6. Boolean Algebra Basics
  7. Boolean Algebra Laws
  8. Logic Expression Simplification
  9. Practice Problems

1. Logic Gate Basics

Digital Signals

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Digital Signals                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  Analog vs Digital:                                         โ”‚
โ”‚                                                             โ”‚
โ”‚  Analog: Continuous values   Digital: Discrete values       โ”‚
โ”‚                                                             โ”‚
โ”‚     โ”‚ /\    /\               โ”‚ โ”Œโ”€โ”€โ”  โ”Œโ”€โ”€โ”                  โ”‚
โ”‚     โ”‚/  \  /  \              โ”‚ โ”‚  โ”‚  โ”‚  โ”‚                  โ”‚
โ”‚  โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€\/โ”€โ”€โ”€โ”€\โ”€โ”€        โ”€โ”€โ”€โ”ผโ”€โ”˜  โ””โ”€โ”€โ”˜  โ””โ”€โ”€                โ”‚
โ”‚     โ”‚                        โ”‚                             โ”‚
โ”‚                                                             โ”‚
โ”‚  In digital logic:                                          โ”‚
โ”‚  - HIGH (1, True):  High voltage (e.g., 5V, 3.3V)          โ”‚
โ”‚  - LOW (0, False):  Low voltage (e.g., 0V)                 โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

What is a Logic Gate?

Logic Gate:
Electronic circuit that performs logical operations on input signals to generate output

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                             โ”‚
โ”‚    Input A โ”€โ”€โ”€โ”€โ”€โ”                                           โ”‚
โ”‚                 โ”‚                                           โ”‚
โ”‚                 โ”œโ”€โ”€โ”€[ Logic Gate ]โ”€โ”€โ”€โ”€โ”€โ†’ Output Y           โ”‚
โ”‚                 โ”‚                                           โ”‚
โ”‚    Input B โ”€โ”€โ”€โ”€โ”€โ”˜                                           โ”‚
โ”‚                                                             โ”‚
โ”‚    Y = f(A, B)  โ† Logic function                            โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Physical implementation of gates:
- Transistors (CMOS, TTL, etc.)
- Relays (early computers)
- Vacuum tubes (1st generation computers)

Summary of Logic Gate Types

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Gate     โ”‚   Symbol   โ”‚           Description              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    AND      โ”‚   AยทB      โ”‚  Output 1 only when both are 1     โ”‚
โ”‚    OR       โ”‚   A+B      โ”‚  Output 1 if at least one is 1     โ”‚
โ”‚    NOT      โ”‚   A'       โ”‚  Inverts input                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    NAND     โ”‚  (AยทB)'    โ”‚  Inverted AND                      โ”‚
โ”‚    NOR      โ”‚  (A+B)'    โ”‚  Inverted OR                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    XOR      โ”‚   AโŠ•B      โ”‚  Output 1 when inputs differ       โ”‚
โ”‚    XNOR     โ”‚  (AโŠ•B)'    โ”‚  Output 1 when inputs are equal    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2. Basic Gates (AND, OR, NOT)

AND Gate

AND Gate: Output is 1 only when all inputs are 1

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ”
         A โ”€โ”€โ”€โ”ค    โ”‚
              โ”‚ &  โ”œโ”€โ”€โ”€Y   Y = A ยท B = A AND B
         B โ”€โ”€โ”€โ”ค    โ”‚
              โ””โ”€โ”€โ”€โ”€โ”˜

IEEE/ANSI Symbol:
         A โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ•ฎ
              โ”‚    โ”œโ”€โ”€โ”€Y
         B โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ•ฏ

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ AยทB   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 0 โ”‚ 1 โ”‚   0   โ”‚
โ”‚ 1 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 1 โ”‚ 1 โ”‚   1   โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Real-world analogy:
- Switches connected in series
- Light bulb lights only when both switches are ON

    A       B      Bulb
   โ”€/ โ”€โ”€โ”€โ”€โ”€/ โ”€โ”€โ”€โ”€โ”€โ—ฏโ”€

OR Gate

OR Gate: Output is 1 if at least one input is 1

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ•ฒ
         A โ”€โ”€โ”€โ”ค     โ•ฒ
              โ”‚  โ‰ฅ1  >โ”€โ”€โ”€Y   Y = A + B = A OR B
         B โ”€โ”€โ”€โ”ค     โ•ฑ
              โ””โ”€โ”€โ”€โ”€โ•ฑ

IEEE/ANSI Symbol:
         A โ”€โ”€โ”€โ•ฒโ•ฒ
              โ•ฒโ•ฒโ”€โ”€โ”€โ”€Y
         B โ”€โ”€โ”€โ•ฑโ•ฑ

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ A+B   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 0 โ”‚ 1 โ”‚   1   โ”‚
โ”‚ 1 โ”‚ 0 โ”‚   1   โ”‚
โ”‚ 1 โ”‚ 1 โ”‚   1   โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Real-world analogy:
- Switches connected in parallel
- Light bulb lights when at least one is ON

        โ”Œโ”€โ”€/ โ”€โ”€โ”  A
    โ”€โ”€โ”€โ”€โ”ค      โ”œโ”€โ”€โ”€โ”€โ—ฏโ”€โ”€
        โ””โ”€โ”€/ โ”€โ”€โ”˜  B
            Bulb

NOT Gate (Inverter)

NOT Gate: Inverts the input

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ•ฒ
         A โ”€โ”€โ”€โ”ค  1  oโ”€โ”€โ”€Y   Y = A' = ฤ€ = NOT A = ยฌA
              โ””โ”€โ”€โ”€โ”€โ•ฑ

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚  A'   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚   1   โ”‚
โ”‚ 1 โ”‚   0   โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Notation:
- A' (prime)
- ฤ€ (overbar)
- NOT A
- ยฌA
- !A (programming)
- ~A (bitwise operation)

Real-world analogy:
- Normally closed (NC) switch
- Circuit breaks when button is pressed

Basic Gate Combinations

3-input AND Gate:

         A โ”€โ”€โ”€โ”
              โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”
         B โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค    โ”‚
              โ”‚    โ”‚ &  โ”œโ”€โ”€โ”€Y   Y = A ยท B ยท C
         C โ”€โ”€โ”€โ”˜    โ”‚    โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”˜

Truth Table (8 combinations):
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ C โ”‚ AยทBยทC โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 0 โ”‚ 0 โ”‚ 1 โ”‚   0   โ”‚
โ”‚ 0 โ”‚ 1 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 0 โ”‚ 1 โ”‚ 1 โ”‚   0   โ”‚
โ”‚ 1 โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 1 โ”‚ 0 โ”‚ 1 โ”‚   0   โ”‚
โ”‚ 1 โ”‚ 1 โ”‚ 0 โ”‚   0   โ”‚
โ”‚ 1 โ”‚ 1 โ”‚ 1 โ”‚   1   โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

3-input OR Gate:

Y = A + B + C

Output is 1 if at least one is 1
Output is 0 only when all are 0

3. Universal Gates (NAND, NOR)

NAND Gate

NAND Gate: Inverted AND (NOT AND)

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ•ฒ
         A โ”€โ”€โ”€โ”ค     oโ”€โ”€โ”€Y   Y = (A ยท B)' = A NAND B
         B โ”€โ”€โ”€โ”ค    โ•ฑ
              โ””โ”€โ”€โ”€โ”€โ•ฑ

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ (AยทB)'   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚    1     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚    1     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚    1     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚    0     โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Comparison with AND:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ AยทB   โ”‚ (AยทB)'   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚    1     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚   0   โ”‚    1     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚   0   โ”‚    1     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚   1   โ”‚    0     โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

NOR Gate

NOR Gate: Inverted OR (NOT OR)

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ•ฒ
         A โ”€โ”€โ”€โ•ฒ     oโ”€โ”€โ”€Y   Y = (A + B)' = A NOR B
         B โ”€โ”€โ”€โ•ฑ    โ•ฑ
              โ””โ”€โ”€โ”€โ”€โ•ฑ

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ (A+B)'   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚    1     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚    0     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚    0     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚    0     โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Comparison with OR:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ A+B   โ”‚ (A+B)'   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚    1     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚   1   โ”‚    0     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚   1   โ”‚    0     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚   1   โ”‚    0     โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Meaning of Universal Gates

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Universal Gate                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  NAND and NOR are "Universal Gates".                        โ”‚
โ”‚  โ†’ All logical operations can be implemented with these     โ”‚
โ”‚     gates alone.                                            โ”‚
โ”‚                                                             โ”‚
โ”‚  Implementing other gates with NAND:                        โ”‚
โ”‚                                                             โ”‚
โ”‚  NOT:                                                       โ”‚
โ”‚       A โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ค NAND โ”œโ”€โ”€โ”€โ†’ A'                              โ”‚
โ”‚            โ””โ”€โ”€โ”€โ”ค      โ”‚                                     โ”‚
โ”‚                                                             โ”‚
โ”‚  AND:                                                       โ”‚
โ”‚       A โ”€โ”€โ”€โ”ค NAND โ”œโ”€โ”€โ”€โ”ค NAND โ”œโ”€โ”€โ”€โ†’ AยทB                      โ”‚
โ”‚       B โ”€โ”€โ”€โ”ค      โ”‚โ”€โ”€โ”€โ”ค      โ”‚                              โ”‚
โ”‚                                                             โ”‚
โ”‚  OR:                                                        โ”‚
โ”‚       A โ”€โ”€โ”€โ”ค NAND โ”œโ”€โ”                                       โ”‚
โ”‚       A โ”€โ”€โ”€โ”ค      โ”‚ โ””โ”€โ”€โ”€โ”ค NAND โ”œโ”€โ”€โ”€โ†’ A+B                    โ”‚
โ”‚       B โ”€โ”€โ”€โ”ค NAND โ”œโ”€โ”€โ”€โ”€โ”€โ”ค      โ”‚                            โ”‚
โ”‚       B โ”€โ”€โ”€โ”ค      โ”‚                                         โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Implementing Basic Gates with NAND

1. NOT from NAND:
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
A โ”€โ”ค       โ”‚
   โ”‚ NAND  โ”œโ”€โ”€โ”€ Y = A'
A โ”€โ”ค       โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

   (AยทA)' = A'


2. AND from NAND:
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
A โ”€โ”ค       โ”‚    โ”‚       โ”‚
   โ”‚ NAND  โ”œโ”€โ”€โ”€โ”€โ”ค NAND  โ”œโ”€โ”€โ”€ Y = AยทB
B โ”€โ”ค       โ”‚    โ”‚       โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
               (same input)

   ((AยทB)')' = AยทB


3. OR from NAND:
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
A โ”€โ”ค       โ”‚
   โ”‚ NAND  โ”œโ”€โ”€โ”€โ”€โ”€โ”
A โ”€โ”ค       โ”‚     โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”œโ”€โ”€โ”€โ”ค       โ”‚
                 โ”‚   โ”‚ NAND  โ”œโ”€โ”€โ”€ Y = A+B
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”œโ”€โ”€โ”€โ”ค       โ”‚
B โ”€โ”ค       โ”‚     โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
   โ”‚ NAND  โ”œโ”€โ”€โ”€โ”€โ”€โ”˜
B โ”€โ”ค       โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

   (A'ยทB')' = A+B  (De Morgan)

4. XOR and XNOR Gates

XOR Gate (Exclusive OR)

XOR Gate: Output is 1 when inputs differ

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ•ฒ
         A โ”€โ”€โ”€โ•ฒ =1  โ•ฒโ”€โ”€โ”€Y   Y = A โŠ• B = A XOR B
         B โ”€โ”€โ”€โ•ฑ     โ•ฑ
              โ””โ”€โ”€โ”€โ”€โ•ฑ

IEEE Symbol: =1 or โŠ•

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ AโŠ•B   โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚   0   โ”‚ โ† Equal
โ”‚ 0 โ”‚ 1 โ”‚   1   โ”‚ โ† Different
โ”‚ 1 โ”‚ 0 โ”‚   1   โ”‚ โ† Different
โ”‚ 1 โ”‚ 1 โ”‚   0   โ”‚ โ† Equal
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Equivalent expressions:
A โŠ• B = A'B + AB'  (only one is 1)
      = (A + B)(A' + B')
      = (A + B)(AB)'

XOR properties:
- A โŠ• 0 = A
- A โŠ• 1 = A'
- A โŠ• A = 0
- A โŠ• A' = 1
- A โŠ• B = B โŠ• A (commutative)
- (A โŠ• B) โŠ• C = A โŠ• (B โŠ• C) (associative)

XNOR Gate (Equivalence)

XNOR Gate: Output is 1 when inputs are equal

Circuit Symbol:
              โ”Œโ”€โ”€โ”€โ”€โ•ฒ
         A โ”€โ”€โ”€โ•ฒ =1  oโ”€โ”€โ”€Y   Y = (A โŠ• B)' = A XNOR B
         B โ”€โ”€โ”€โ•ฑ     โ•ฑ
              โ””โ”€โ”€โ”€โ”€โ•ฑ

Truth Table:
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ (AโŠ•B)'  โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚    1    โ”‚ โ† Equal
โ”‚ 0 โ”‚ 1 โ”‚    0    โ”‚ โ† Different
โ”‚ 1 โ”‚ 0 โ”‚    0    โ”‚ โ† Different
โ”‚ 1 โ”‚ 1 โ”‚    1    โ”‚ โ† Equal
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Equivalent expressions:
(A โŠ• B)' = A'B' + AB  (both equal)
         = A โŠ™ B (equivalence symbol)

Applications of XOR

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Major XOR Applications                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  1. Adder                                                   โ”‚
โ”‚     - Sum calculation in half adder                         โ”‚
โ”‚     - LSB of A + B = A โŠ• B                                  โ”‚
โ”‚                                                             โ”‚
โ”‚  2. Parity Check                                            โ”‚
โ”‚     - XOR of multiple bits = 1 if odd number of 1s         โ”‚
โ”‚     - Used for error detection                              โ”‚
โ”‚                                                             โ”‚
โ”‚  3. Comparator                                              โ”‚
โ”‚     - A โŠ• B = 0 if A = B                                    โ”‚
โ”‚     - A โŠ• B = 1 if A โ‰  B                                    โ”‚
โ”‚                                                             โ”‚
โ”‚  4. Toggle                                                  โ”‚
โ”‚     - A โŠ• 1 = A' (bit inversion)                            โ”‚
โ”‚     - A โŠ• 0 = A (maintain)                                  โ”‚
โ”‚                                                             โ”‚
โ”‚  5. Encryption                                              โ”‚
โ”‚     - Message โŠ• Key = Ciphertext                            โ”‚
โ”‚     - Ciphertext โŠ• Key = Message                            โ”‚
โ”‚                                                             โ”‚
โ”‚  6. Swap (without temp variable)                            โ”‚
โ”‚     - a = a โŠ• b                                             โ”‚
โ”‚     - b = a โŠ• b                                             โ”‚
โ”‚     - a = a โŠ• b                                             โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Implementing XOR with Basic Gates

XOR = A'B + AB'

Circuit implementation:
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”
         A โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ค NOT โ”œโ”€โ”€โ”€โ”€โ”
               โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”
               โ”‚               โ””โ”€โ”€โ”€โ”€โ”ค     โ”‚
               โ”‚                    โ”‚ AND โ”œโ”€โ”€โ”€โ”€โ”
               โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     โ”‚    โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”
               โ”‚    โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”˜    โ”œโ”€โ”€โ”€โ”€โ”ค    โ”‚
         B โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”‚    โ”‚ OR โ”œโ”€โ”€โ”€Y
               โ”‚    โ”‚          โ”‚              โ”‚    โ”‚    โ”‚
               โ”‚    โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ””โ”€โ”€โ”€โ”€โ”˜
               โ”‚    โ”‚    โ”‚ NOT โ”œโ”€โ”€โ”€โ”€โ”ค     โ”‚   โ”‚
               โ”‚    โ””โ”€โ”€โ”€โ”€โ”ค     โ”‚    โ”‚ AND โ”œโ”€โ”€โ”€โ”˜
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚     โ”‚
                                    โ””โ”€โ”€โ”€โ”€โ”€โ”˜

Gate count:
- 2 NOT + 2 AND + 1 OR = 5 gates

Implementing XOR with NAND only:
- Requires 4 NAND gates

5. Truth Table Construction

Truth Table Basics

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        Truth Table                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Lists all possible input combinations and corresponding     โ”‚
โ”‚  outputs for a logic function                                โ”‚
โ”‚                                                             โ”‚
โ”‚  n inputs โ†’ 2โฟ rows                                         โ”‚
โ”‚  - 1 input: 2 rows                                          โ”‚
โ”‚  - 2 inputs: 4 rows                                         โ”‚
โ”‚  - 3 inputs: 8 rows                                         โ”‚
โ”‚  - 4 inputs: 16 rows                                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Input listing rule (counting order):
โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ C โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚ 0 โ”‚  โ† 0
โ”‚ 0 โ”‚ 0 โ”‚ 1 โ”‚  โ† 1
โ”‚ 0 โ”‚ 1 โ”‚ 0 โ”‚  โ† 2
โ”‚ 0 โ”‚ 1 โ”‚ 1 โ”‚  โ† 3
โ”‚ 1 โ”‚ 0 โ”‚ 0 โ”‚  โ† 4
โ”‚ 1 โ”‚ 0 โ”‚ 1 โ”‚  โ† 5
โ”‚ 1 โ”‚ 1 โ”‚ 0 โ”‚  โ† 6
โ”‚ 1 โ”‚ 1 โ”‚ 1 โ”‚  โ† 7
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”˜

Truth Tables for Complex Logic Expressions

Example: Y = AB + A'C

Add intermediate columns for step-by-step calculation:

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ C โ”‚ A'  โ”‚  AB  โ”‚ A'C โ”‚ Y=AB+A'C  โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚ 0 โ”‚  1  โ”‚  0   โ”‚  0  โ”‚     0     โ”‚
โ”‚ 0 โ”‚ 0 โ”‚ 1 โ”‚  1  โ”‚  0   โ”‚  1  โ”‚     1     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚ 0 โ”‚  1  โ”‚  0   โ”‚  0  โ”‚     0     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚ 1 โ”‚  1  โ”‚  0   โ”‚  1  โ”‚     1     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚ 0 โ”‚  0  โ”‚  0   โ”‚  0  โ”‚     0     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚ 1 โ”‚  0  โ”‚  0   โ”‚  0  โ”‚     0     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚ 0 โ”‚  0  โ”‚  1   โ”‚  0  โ”‚     1     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚ 1 โ”‚  0  โ”‚  1   โ”‚  0  โ”‚     1     โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Deriving Logic Expressions from Truth Tables

Deriving logic expressions from a given truth table:

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ Y โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚ 1 โ”‚  โ† Row 0: A'B'
โ”‚ 0 โ”‚ 1 โ”‚ 0 โ”‚
โ”‚ 1 โ”‚ 0 โ”‚ 1 โ”‚  โ† Row 2: AB'
โ”‚ 1 โ”‚ 1 โ”‚ 1 โ”‚  โ† Row 3: AB
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”˜

Method 1: Sum of Products (SOP)
- Select only rows where output is 1
- Express each row as AND term (add NOT for 0s)
- Connect with OR

Y = A'B' + AB' + AB

Method 2: Product of Sums (POS)
- Select only rows where output is 0
- Express each row as OR term (add NOT for 1s)
- Connect with AND

Y = (A + B')  โ† from row 0,1

6. Boolean Algebra Basics

What is Boolean Algebra?

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Boolean Algebra                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  Algebraic system developed by George Boole in 1847         โ”‚
โ”‚  Deals with two values (0, 1) and logical operations        โ”‚
โ”‚                                                             โ”‚
โ”‚  Basic operations:                                          โ”‚
โ”‚  - AND (conjunction): ยท or omitted                          โ”‚
โ”‚  - OR (disjunction): +                                      โ”‚
โ”‚  - NOT (complement): ' or ฬ„ (overbar)                       โ”‚
โ”‚                                                             โ”‚
โ”‚  Operation precedence:                                      โ”‚
โ”‚  1. Parentheses ()                                          โ”‚
โ”‚  2. NOT (')                                                 โ”‚
โ”‚  3. AND (ยท)                                                 โ”‚
โ”‚  4. OR (+)                                                  โ”‚
โ”‚                                                             โ”‚
โ”‚  Example: A + B ยท C' = A + (B ยท (C'))                       โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Basic Axioms

Boolean Algebra Axioms:

1. Closure:
   - A ยท B โˆˆ {0, 1}
   - A + B โˆˆ {0, 1}

2. Identity:
   - A ยท 1 = A
   - A + 0 = A

3. Commutative:
   - A ยท B = B ยท A
   - A + B = B + A

4. Distributive:
   - A ยท (B + C) = AยทB + AยทC
   - A + (B ยท C) = (A+B) ยท (A+C)  โ† Different from regular algebra!

5. Complement:
   - A ยท A' = 0
   - A + A' = 1

7. Boolean Algebra Laws

Basic Theorems

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Basic Theorems                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  Idempotent:                                                โ”‚
โ”‚  - A ยท A = A                                                โ”‚
โ”‚  - A + A = A                                                โ”‚
โ”‚                                                             โ”‚
โ”‚  Null/Domination:                                           โ”‚
โ”‚  - A ยท 0 = 0                                                โ”‚
โ”‚  - A + 1 = 1                                                โ”‚
โ”‚                                                             โ”‚
โ”‚  Involution (Double Negation):                              โ”‚
โ”‚  - (A')' = A                                                โ”‚
โ”‚                                                             โ”‚
โ”‚  Absorption:                                                โ”‚
โ”‚  - A + AยทB = A                                              โ”‚
โ”‚  - A ยท (A + B) = A                                          โ”‚
โ”‚                                                             โ”‚
โ”‚  Associative:                                               โ”‚
โ”‚  - (A ยท B) ยท C = A ยท (B ยท C)                                โ”‚
โ”‚  - (A + B) + C = A + (B + C)                                โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

De Morgan's Laws

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    De Morgan's Laws                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  Theorem 1: (A ยท B)' = A' + B'                              โ”‚
โ”‚  "NOT of AND = OR of NOTs"                                  โ”‚
โ”‚                                                             โ”‚
โ”‚  Theorem 2: (A + B)' = A' ยท B'                              โ”‚
โ”‚  "NOT of OR = AND of NOTs"                                  โ”‚
โ”‚                                                             โ”‚
โ”‚  Generalization:                                            โ”‚
โ”‚  (Aโ‚ ยท Aโ‚‚ ยท ... ยท Aโ‚™)' = Aโ‚' + Aโ‚‚' + ... + Aโ‚™'             โ”‚
โ”‚  (Aโ‚ + Aโ‚‚ + ... + Aโ‚™)' = Aโ‚' ยท Aโ‚‚' ยท ... ยท Aโ‚™'             โ”‚
โ”‚                                                             โ”‚
โ”‚  Application: NAND/NOR conversion                           โ”‚
โ”‚  (AB)' = A' + B'  โ†’ NAND to NOR with inverters             โ”‚
โ”‚  (A+B)' = A'B'    โ†’ NOR to NAND with inverters             โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Proof of De Morgan's Laws (truth table):

(A ยท B)' = A' + B'

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ AยทB โ”‚ (AยทB)' โ”‚ A'  โ”‚ B'  โ”‚ A' + B'  โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚  0  โ”‚   1    โ”‚  1  โ”‚  1  โ”‚    1     โ”‚
โ”‚ 0 โ”‚ 1 โ”‚  0  โ”‚   1    โ”‚  1  โ”‚  0  โ”‚    1     โ”‚
โ”‚ 1 โ”‚ 0 โ”‚  0  โ”‚   1    โ”‚  0  โ”‚  1  โ”‚    1     โ”‚
โ”‚ 1 โ”‚ 1 โ”‚  1  โ”‚   0    โ”‚  0  โ”‚  0  โ”‚    0     โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         Equal!

Consensus Theorem

Consensus:

AยทB + A'ยทC + BยทC = AยทB + A'ยทC

"Remove redundant term"

Proof:
BยทC = BยทCยท(A + A')           (A + A' = 1)
    = AยทBยทC + A'ยทBยทC
    = AยทBยทC + A'ยทBยทC         (already included in AB and A'C)

Dual form:
(A + B)ยท(A' + C)ยท(B + C) = (A + B)ยท(A' + C)

Boolean Algebra Laws Summary Table

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚        Law           โ”‚        AND          โ”‚        OR           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Identity             โ”‚ A ยท 1 = A           โ”‚ A + 0 = A           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Null                 โ”‚ A ยท 0 = 0           โ”‚ A + 1 = 1           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Idempotent           โ”‚ A ยท A = A           โ”‚ A + A = A           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Complement           โ”‚ A ยท A' = 0          โ”‚ A + A' = 1          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Commutative          โ”‚ A ยท B = B ยท A       โ”‚ A + B = B + A       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Associative          โ”‚ (AB)C = A(BC)       โ”‚ (A+B)+C = A+(B+C)   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Distributive         โ”‚ A(B+C) = AB + AC    โ”‚ A+BC = (A+B)(A+C)   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Absorption           โ”‚ A(A+B) = A          โ”‚ A + AB = A          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ De Morgan            โ”‚ (AB)' = A' + B'     โ”‚ (A+B)' = A'B'       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

8. Logic Expression Simplification

Algebraic Simplification

Example 1: Y = AB + AB'

Y = AB + AB'
  = A(B + B')    (reverse distributive)
  = A ยท 1        (B + B' = 1)
  = A            (identity)


Example 2: Y = A'B'C + A'BC + AB'C + ABC

Y = A'B'C + A'BC + AB'C + ABC
  = A'C(B' + B) + AC(B' + B)    (reverse distributive)
  = A'C ยท 1 + AC ยท 1             (B' + B = 1)
  = A'C + AC
  = C(A' + A)                    (reverse distributive)
  = C ยท 1
  = C


Example 3: Y = AB + A'C + BC

Y = AB + A'C + BC
  = AB + A'C + BC(A + A')        (A + A' = 1)
  = AB + A'C + ABC + A'BC
  = AB(1 + C) + A'C(1 + B)       (1 + X = 1)
  = AB + A'C                      (consensus theorem)

Karnaugh Map

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Karnaugh Map (K-Map)                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Method to visually simplify by arranging truth table       โ”‚
โ”‚  in 2D format. Group adjacent 1s to eliminate variables.    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2-variable K-Map:
        B
      0   1
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”
 0 โ”‚ A'B'โ”‚ A'B โ”‚
A  โ”œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ค
 1 โ”‚ AB' โ”‚ AB  โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”˜

3-variable K-Map (Gray code order):
         BC
       00  01  11  10
    โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”
  0 โ”‚ 0  โ”‚ 1  โ”‚ 3  โ”‚ 2  โ”‚
A   โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  1 โ”‚ 4  โ”‚ 5  โ”‚ 7  โ”‚ 6  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜
           (minterm numbers)

4-variable K-Map:
          CD
        00  01  11  10
     โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”
  00 โ”‚ 0  โ”‚ 1  โ”‚ 3  โ”‚ 2  โ”‚
     โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  01 โ”‚ 4  โ”‚ 5  โ”‚ 7  โ”‚ 6  โ”‚
AB   โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  11 โ”‚ 12 โ”‚ 13 โ”‚ 15 โ”‚ 14 โ”‚
     โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  10 โ”‚ 8  โ”‚ 9  โ”‚ 11 โ”‚ 10 โ”‚
     โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜

K-Map Usage

Example: Y = ฮฃm(0, 1, 3, 5, 7)  (3 variables)

Step 1: Mark 1s on K-Map
         BC
       00  01  11  10
    โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”
  0 โ”‚ 1  โ”‚ 1  โ”‚ 1  โ”‚    โ”‚   โ† m0, m1, m3
A   โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  1 โ”‚    โ”‚ 1  โ”‚ 1  โ”‚    โ”‚   โ† m5, m7
    โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜

Step 2: Group adjacent 1s (power-of-2 sizes)
         BC
       00  01  11  10
    โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”
  0 โ”‚[1] โ”‚ 1โ”€โ”€โ”ผโ”€1  โ”‚    โ”‚   Group1: m1,m3,m5,m7 (vertical 2 cells)
A   โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  1 โ”‚    โ”‚ 1โ”€โ”€โ”ผโ”€1  โ”‚    โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜
                โ”‚
         Group2: m0,m1 (horizontal 2 cells)

Step 3: Extract common variables for each group
- Group1 (4 cells): Only C is common โ†’ C
- Group2 (2 cells): A' and B' are common โ†’ A'B'

Result: Y = C + A'B'

Verification:
Original: A'B'C' + A'B'C + A'BC + AB'C + ABC
         = A'B'(C'+C) + C(A'B + AB' + AB)
         = A'B' + C(A'B + A) = A'B' + C

K-Map Grouping Rules

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    K-Map Grouping Rules                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  1. Group size must be power of 2 (1, 2, 4, 8, 16...)      โ”‚
โ”‚                                                             โ”‚
โ”‚  2. Only adjacent cells can be grouped (no diagonal)        โ”‚
โ”‚     - K-Map edges wrap around (torus shape)                โ”‚
โ”‚                                                             โ”‚
โ”‚  3. All 1s must be included in at least one group          โ”‚
โ”‚                                                             โ”‚
โ”‚  4. Groups should be as large as possible                   โ”‚
โ”‚     (larger group = fewer variables)                        โ”‚
โ”‚                                                             โ”‚
โ”‚  5. Same 1 can be included in multiple groups if needed    โ”‚
โ”‚                                                             โ”‚
โ”‚  6. Don't Care (X) can be treated as 1 when needed         โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Edge wrapping example (4 variables):

          CD
        00  01  11  10
     โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”
  00 โ”‚ 1  โ”‚    โ”‚    โ”‚ 1  โ”‚  โ† left-right wrap
     โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  01 โ”‚    โ”‚    โ”‚    โ”‚    โ”‚
AB   โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  11 โ”‚    โ”‚    โ”‚    โ”‚    โ”‚
     โ”œโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
  10 โ”‚ 1  โ”‚    โ”‚    โ”‚ 1  โ”‚  โ† top-bottom wrap
     โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜
       โ†‘              โ†‘
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         left-right wrap

4 ones form one group (four corners)
โ†’ B'D' (common variables)

9. Practice Problems

Basic Problems

1. Find the result of the following logical operations. - (a) 1 AND 0 - (b) 1 OR 0 - (c) NOT 1 - (d) 1 NAND 1 - (e) 0 NOR 0 - (f) 1 XOR 1

2. Create truth tables for the following logic expressions. - (a) Y = A + B' - (b) Y = AB + A'B' - (c) Y = (A + B)(A' + C)

3. Derive the logic expression in SOP form for the following truth table.

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”
โ”‚ A โ”‚ B โ”‚ Y โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ 0 โ”‚ 0 โ”‚
โ”‚ 0 โ”‚ 1 โ”‚ 1 โ”‚
โ”‚ 1 โ”‚ 0 โ”‚ 1 โ”‚
โ”‚ 1 โ”‚ 1 โ”‚ 0 โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”˜

Boolean Algebra Problems

4. Simplify the following logic expressions. - (a) Y = A + A'B - (b) Y = AB + AB' - (c) Y = (A + B)(A + B') - (d) Y = A'B + AB' + AB + A'B'

5. Use De Morgan's laws to transform the following. - (a) (ABC)' = ? - (b) (A + B + C)' = ? - (c) ((A + B)C)' = ?

6. Prove the following identities using Boolean algebra. - (a) A + AB = A - (b) A(A + B) = A - (c) A + A'B = A + B

K-Map Problems

7. Simplify the following logic expressions using K-Maps. - (a) Y = ฮฃm(0, 2, 4, 6) (3 variables) - (b) Y = ฮฃm(0, 1, 2, 3, 5, 7) (3 variables) - (c) Y = ฮฃm(0, 1, 2, 5, 8, 9, 10) (4 variables)

8. Simplify the following function with Don't Care conditions. Y = ฮฃm(1, 3, 7) + d(0, 5) (3 variables)

Advanced Problems

9. Implement the following using only NAND gates. - (a) NOT gate - (b) AND gate - (c) OR gate - (d) XOR gate

10. Express the output of the following circuit as a logic expression and simplify.

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”
A โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     โ”‚
        โ”‚ AND โ”œโ”€โ”€โ”€โ”€โ”€โ”
B โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     โ”‚     โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”
        โ””โ”€โ”€โ”€โ”€โ”€โ”˜     โ”œโ”€โ”€โ”€โ”€โ”ค     โ”‚
                    โ”‚    โ”‚ OR  โ”œโ”€โ”€โ”€โ”€ Y
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”     โ”œโ”€โ”€โ”€โ”€โ”ค     โ”‚
A โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ค NOT โ”œโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”
    โ””โ”€โ”€โ”€โ”ค     โ”‚
        โ”‚ AND โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
C โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”˜

Answers **1. Logical operation results** - (a) 1 AND 0 = 0 - (b) 1 OR 0 = 1 - (c) NOT 1 = 0 - (d) 1 NAND 1 = 0 - (e) 0 NOR 0 = 1 - (f) 1 XOR 1 = 0 **2. Truth tables** - (a) Y = A + B': [1,0,1,1] (in order) - (b) Y = AB + A'B': [1,0,0,1] - (c) Y = (A+B)(A'+C): [0,C,B,1] i.e. [0,0,0,1,0,1,0,1] **3.** Y = A'B + AB' = A XOR B **4. Simplification** - (a) Y = A + A'B = A + B (absorption) - (b) Y = AB + AB' = A(B + B') = A - (c) Y = (A+B)(A+B') = A + BB' = A - (d) Y = A'B + AB' + AB + A'B' = A'(B+B') + A(B'+B) = A' + A = 1 **5. De Morgan** - (a) (ABC)' = A' + B' + C' - (b) (A+B+C)' = A'B'C' - (c) ((A+B)C)' = (A+B)' + C' = A'B' + C' **6. Proof** - (a) A + AB = A(1 + B) = Aยท1 = A - (b) A(A+B) = AA + AB = A + AB = A - (c) A + A'B = (A+A')(A+B) = 1ยท(A+B) = A+B **7. K-Map simplification** - (a) Y = B' (m0,m2,m4,m6 are B=0 column) - (b) Y = A' + C (m0,1,2,3=A', m1,3,5,7=C) - (c) Y = B'D' + A'B'C' + A'CD' **8.** With Don't Care: Y = B' or Y = A' + B' (depending on d usage) **9. NAND implementation** - (a) NOT: A NAND A = A' - (b) AND: (A NAND B) NAND (A NAND B) - (c) OR: (A NAND A) NAND (B NAND B) - (d) XOR: Requires 4 NANDs **10.** Y = AB + A'C = AND of A and B OR AND of NOT A and C, simplification result remains AB + A'C (cannot be simplified further)

Next Steps


References

to navigate between lessons