01 / 22

Logic Gates &
Circuit Simplification

Master the fundamental building blocks of digital circuits and learn how Boolean algebra simplifies complex logic into elegant designs.

Discrete Math

What Are Logic Gates?

A logic gate is an idealized device that performs a Boolean function: it takes one or more binary inputs (0 or 1) and produces exactly one binary output. Gates are the physical foundation of every digital system: computers, phones, and calculators.

The Three Primary Gates

AND
Output is 1 only when all inputs are 1. Symbol: \( A \cdot B \)
OR
Output is 1 when at least one input is 1. Symbol: \( A + B \)
NOT
Output is the complement of the input. Symbol: \( \overline{A} \)

Gate Symbols & Truth Tables

AND
\(A\)
\(B\)
\(Out\)
OR
\(A\)
\(B\)
\(Out\)
NOT
\(A\)
\(Out\)
\(A \quad B \quad Out\)
\(0 \quad 0 \quad 0\)
\(0 \quad 1 \quad 0\)
\(1 \quad 0 \quad 0\)
\(1 \quad 1 \quad 1\)
\(A \quad B \quad Out\)
\(0 \quad 0 \quad 0\)
\(0 \quad 1 \quad 1\)
\(1 \quad 0 \quad 1\)
\(1 \quad 1 \quad 1\)
\(A \quad Out\)
\(0 \quad 1\)
\(1 \quad 0\)

Derived Gates: NAND, NOR, XOR

NAND
\( \overline{A \cdot B} \): Output is 0 only when both inputs are 1. "NOT-AND."
NOR
\( \overline{A + B} \): Output is 1 only when both inputs are 0. "NOT-OR."
XOR
\( A \oplus B \): Output is 1 when inputs differ. "Exclusive OR."

Boolean Algebra: The Language of Circuits

Every logic circuit corresponds to a Boolean expression. Boolean algebra gives us rules for manipulating these expressions, just as ordinary algebra gives rules for numbers. The key difference: variables take only the values 0 and 1.

AND notation
\( A \cdot B \) or simply \( AB \)
OR notation
\( A + B \)
NOT notation
\( \overline{A} \) or \( A' \)

Core Laws of Boolean Algebra

1
Identity: \( A + 0 = A \) and \( A \cdot 1 = A \)
2
Null: \( A + 1 = 1 \) and \( A \cdot 0 = 0 \)
3
Complement: \( A + \overline{A} = 1 \) and \( A \cdot \overline{A} = 0 \)
4
Idempotent: \( A + A = A \) and \( A \cdot A = A \)
5
Distributive: \( A \cdot (B + C) = AB + AC \)

De Morgan's Theorems

De Morgan's two laws are the most powerful tools for circuit simplification. They let you swap between AND and OR by moving the complement:

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

"Break the bar, change the sign."
Theorem 2
\( \overline{A + B} = \overline{A} \cdot \overline{B} \)

"Break the bar, change the sign."

AND vs OR: Key Distinction

AND (\( \cdot \)) OR (\( + \))
Output = 1 when All inputs = 1 Any input = 1
Output = 0 when Any input = 0 All inputs = 0
Identity element 1 0
Annihilator 0 1
Real-world analogy Series circuit Parallel circuit

How to Simplify a Circuit

1
Write the expression. Trace the circuit from inputs to output, noting each gate's operation.
2
Apply Boolean laws. Use identity, complement, idempotent, and distributive rules to reduce terms.
3
Use De Morgan's theorems. Convert NAND/NOR sub-expressions and simplify further.
4
Factor or expand. Factor common terms, or expand to spot redundancies.
5
Redraw the circuit. Build the new circuit from the simplified expression: fewer gates = cheaper hardware.

Example 1: Basic Simplification

Simplify: \( F = A \cdot B + A \cdot \overline{B} \)

1
Factor out the common term \( A \):
\( F = A(B + \overline{B}) \)
2
Apply complement law: \( B + \overline{B} = 1 \)
\( F = A \cdot 1 \)
3
Apply identity law: \( A \cdot 1 = A \)
\( \boxed{F = A} \)

Example 2: De Morgan's in Action

Simplify: \( F = \overline{\overline{A} \cdot \overline{B}} \)

1
Apply De Morgan's Theorem 1 to the outer bar:
\( F = \overline{\overline{A}} + \overline{\overline{B}} \)
2
Double negation: \( \overline{\overline{A}} = A \) and \( \overline{\overline{B}} = B \)
\( \boxed{F = A + B} \)

Example 3: Multi-Step Simplification

Simplify: \( F = AB + A\overline{B}C + \overline{A}BC \)

1
Factor \( A \) from the first two terms:
\( F = A(B + \overline{B}C) + \overline{A}BC \)
2
Simplify inside: \( B + \overline{B}C = B + C \) (absorption-like: since \( B + \overline{B}C = (B + \overline{B})(B + C) = B + C \))
\( F = A(B + C) + \overline{A}BC \)
3
Expand: \( F = AB + AC + \overline{A}BC \)
4
Factor \( B \) from terms 1 & 3: \( AB + \overline{A}BC = B(A + \overline{A}C) = B(A + C) \)
\( F = B(A + C) + AC = AB + BC + AC \)

Reading a Circuit Diagram

A B NOT AND AND OR F Circuit expression:
\( F = AB + \overline{A}B \)
Simplified: \( F = B \)

Why Simplification Matters

Fewer Gates
Less hardware means lower manufacturing cost and smaller chip area.
Less Power
Each gate consumes energy. Fewer gates = lower power consumption and less heat.
Faster Circuits
Fewer gate layers means shorter propagation delay: signals reach the output faster.

Common Mistakes

✕ Distributing the Bar Incorrectly
Writing \( \overline{A + B} = \overline{A} + \overline{B} \). De Morgan says the operator must change: it becomes \( \overline{A} \cdot \overline{B} \).
✕ Confusing + with Addition
In Boolean algebra, \( 1 + 1 = 1 \), not \( 2 \). The \( + \) symbol means OR, not arithmetic addition.
✕ Forgetting Double Negation
Leaving \( \overline{\overline{A}} \) unsimplified. Always reduce: \( \overline{\overline{A}} = A \).

Boolean Laws Summary

Law AND Form OR Form
Identity \( A \cdot 1 = A \) \( A + 0 = A \)
Null \( A \cdot 0 = 0 \) \( A + 1 = 1 \)
Complement \( A \cdot \overline{A} = 0 \) \( A + \overline{A} = 1 \)
Idempotent \( A \cdot A = A \) \( A + A = A \)
De Morgan's \( \overline{A \cdot B} = \overline{A} + \overline{B} \) \( \overline{A + B} = \overline{A} \cdot \overline{B} \)
Absorption \( A(A + B) = A \) \( A + AB = A \)

Question 1 of 5

What is the output of an AND gate when \( A = 1 \) and \( B = 0 \)?

Question 2 of 5

By De Morgan's Theorem, \( \overline{A + B} \) equals:

Question 3 of 5

Simplify: \( F = A + AB \)

Question 4 of 5

Which gate is functionally complete on its own (can implement any Boolean function)?

Question 5 of 5

Simplify: \( F = \overline{A} \cdot B + A \cdot B \)