Course contentsShow
← Computer Science
Lesson 20 of 2,8721. Digital FoundationsFree lesson

De Morgan's Laws

Understanding how to transform AND/OR operations using negation equivalences.

De Morgan's Laws

You'll learn: How to flip logic operations by distributing negation across AND/OR gates.

The Core Idea

De Morgan's Laws give you two powerful shortcuts for transforming Boolean expressions by moving the NOT operation around. Think of them as "negation redistribution rules":

  1. NOT (A AND B) = (NOT A) OR (NOT B)
  2. NOT (A OR B) = (NOT A) AND (NOT B)

In plain English: When you negate an entire expression, you flip each variable inside and swap the operation (AND becomes OR, OR becomes AND).

Why This Matters

Imagine you have a complex gate circuit but only NAND gates available. De Morgan's Laws let you mathematically prove that different-looking circuits are actually equivalent, helping you redesign logic without changing behavior.

Visual Example

Let's say you want the opposite of "the alarm triggers when the door opens AND the system is armed":

  • Original: Door AND Armed
  • Negated version: NOT (Door AND Armed)
  • Apply De Morgan's: (NOT Door) OR (NOT Armed)

Translation: "The alarm stays OFF when the door is closed OR the system is disarmed." Both express the same logic!

The Pattern

Notice the transformation pattern:

  • The outer NOT "pushes inside"
  • Each variable gets NOTed
  • AND ↔ OR swap places

This works in reverse too. Starting with (NOT A) OR (NOT B)? You can compress it to NOT (A AND B).

Key Takeaway: De Morgan's Laws let you transform between AND/OR operations by distributing negation—flip each variable and swap the operator.