Introduction

Boolean algebra is a branch of algebra that deals with binary variables and logical operations. It is fundamental in digital logic design, computer architecture, and circuit design.

Basic Boolean Operations

Boolean algebra operates on binary values: 0 (False) and 1 (True). The fundamental operations are:

AND ( or )

The AND operation returns 1 only if both inputs are 1.

Truth Table for AND
A | B | A ⋅ B
--|--|------
0 | 0 |  0
0 | 1 |  0
1 | 0 |  0
1 | 1 |  1

OR (+ or )

The OR operation returns 1 if at least one input is 1.

Truth Table for OR
A | B | A + B
--|--|------
0 | 0 |  0
0 | 1 |  1
1 | 0 |  1
1 | 1 |  1

NOT (¬ or !)

The NOT operation inverts the input.

Truth Table for NOT
A | ¬A
--|---
0 |  1
1 |  0

Other Important Boolean Operations

NAND ()

NAND is the negation of AND.

Truth Table for NAND
A | B | A ⊼ B
--|--|------
0 | 0 |  1
0 | 1 |  1
1 | 0 |  1
1 | 1 |  0

NOR ()

NOR is the negation of OR.

Truth Table for NOR
A | B | A ⊽ B
--|--|------
0 | 0 |  1
0 | 1 |  0
1 | 0 |  0
1 | 1 |  0

XOR ()

XOR returns 1 if the inputs are different.

Truth Table for XOR
A | B | A ⊕ B
--|--|------
0 | 0 |  0
0 | 1 |  1
1 | 0 |  1
1 | 1 |  0

XNOR ()

XNOR returns 1 if the inputs are the same.

Truth Table for XNOR
A | B | A ⊙ B
--|--|------
0 | 0 |  1
0 | 1 |  0
1 | 0 |  0
1 | 1 |  1

Boolean Algebra Laws

The following laws simplify Boolean expressions:

  • Identity Law: A + 0 = A, A ⋅ 1 = A
  • Null Law: A + 1 = 1, A ⋅ 0 = 0
  • Idempotent Law: A + A = A, A ⋅ A = A
  • Complement Law: A + ¬A = 1, A ⋅ ¬A = 0
  • Commutative Law: A + B = B + A, A ⋅ B = B ⋅ A
  • Associative Law: (A + B) + C = A + (B + C), (A ⋅ B) ⋅ C = A ⋅ (B ⋅ C)
  • Distributive Law: A ⋅ (B + C) = (A ⋅ B) + (A ⋅ C)
  • De Morgan’s Theorems:
    • ¬(A ⋅ B) = ¬A + ¬B
    • ¬(A + B) = ¬A ⋅ ¬B

Real-World Applications

Digital Circuits

Boolean algebra is used in designing digital circuits such as:

  • Logic gates (AND, OR, NOT, etc.)
  • Flip-flops and memory storage
  • Arithmetic logic units (ALUs)

Programming & Conditional Statements

Boolean expressions control loops and conditions in programming:

JavaScript Example
if (isUserLoggedIn && hasPermission) {
  console.log("Access granted");
} else {
  console.log("Access denied");
}

Database Queries

SQL uses Boolean logic to filter data:

SQL Example
SELECT * FROM users WHERE age > 18 AND city = 'New York';

Problem-Solving with Boolean Algebra

Example 1: Simplify the Expression

Simplify A ⋅ (A + B).

Solution: Using the Absorption Law:

A ⋅ (A + B) = A

Example 2: Circuit Implementation

Design a circuit that outputs 1 only when exactly one of two switches is ON.

Solution: Use the XOR gate (A ⊕ B).

Conclusion

Boolean algebra is a foundational concept in computer science and engineering. Mastering it allows for efficient circuit design, logical problem-solving, and optimized programming logic.