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

Boolean Expressions and Laws

Writing boolean expressions and applying commutative, associative, and distributive laws.

Boolean Expressions and Laws

What You'll Learn

You'll learn how to write boolean expressions and simplify them using three fundamental laws that work just like algebra rules.

Writing Boolean Expressions

A boolean expression combines boolean values (TRUE/FALSE) and gates (AND, OR, NOT, etc.) into a single statement. For example:

A AND (B OR C)

This reads as: "A is TRUE and either B or C is TRUE."

Just like in arithmetic where 2 + 3 × 4 needs order-of-operation rules, boolean expressions follow precedence: NOT first, then AND, then OR. Use parentheses to be clear!

The Three Key Laws

These laws let you rearrange and simplify boolean expressions without changing their meaning:

1. Commutative Law

Order doesn't matter for AND and OR:

  • A AND B = B AND A
  • A OR B = B OR A

Think of addition: 3 + 5 = 5 + 3

2. Associative Law

Grouping doesn't matter:

  • (A AND B) AND C = A AND (B AND C)
  • (A OR B) OR C = A OR (B OR C)

Like multiplication: (2 × 3) × 4 = 2 × (3 × 4)

3. Distributive Law

You can "distribute" AND over OR (and vice versa):

  • A AND (B OR C) = (A AND B) OR (A AND C)

Like arithmetic: 2 × (3 + 4) = (2 × 3) + (2 × 4)

Why This Matters

These laws help you simplify complex circuits and write cleaner logic. Instead of building A AND (B OR C) with many gates, you might rearrange it to use fewer components.

Key Takeaway: Boolean expressions combine gates into statements, and the commutative, associative, and distributive laws let you rearrange them algebraically to simplify logic circuits.