No history yet

Boolean Algebra Basics

The Logic of True and False

At its heart, Boolean algebra is the math of logic. Instead of dealing with an infinite range of numbers, it only cares about two values: TRUE and FALSE. In the world of computers and electronics, we represent these as 1 (for TRUE) and 0 (for FALSE). These are our Boolean constants.

We also use variables, just like in regular algebra. But a Boolean variable, like AA or BB, can only hold one of those two values, either 1 or 0. This simple binary system is the foundation for all digital logic.

The Basic Operations

There are three fundamental operations in Boolean algebra that let us combine and manipulate these variables.

AND

conjunction

The AND operation is true only if all of its inputs are true. Think of it as a logical multiplication. If you have two variables, AA and BB, the AND operation is written as ABA B.

ABA \cdot B

For the expression $A B$ to be 1 (TRUE), both $A$ and $B$ must be 1. If either is 0 (FALSE), the result is 0.

OR

conjunction

The OR operation is true if at least one of its inputs is true. This is like logical addition. It's written using a plus sign.

A+BA + B

For the expression A+BA + B to be 1 (TRUE), either AA can be 1, or BB can be 1, or both can be 1. It's only 0 if both AA and BB are 0.

NOT

adverb

The NOT operation is the simplest. It just inverts the value. If something is TRUE, NOT makes it FALSE. If it's FALSE, NOT makes it TRUE. It's also called the complement.

We write the NOT of a variable AA by putting a bar over it.

Aˉ\bar{A}

These three operations—AND, OR, and NOT—are the complete toolkit for Boolean algebra. Every logical expression, no matter how complex, can be built from them.

The Rules of the Game

Like regular algebra, Boolean algebra has rules that tell us how variables and operators relate to each other. These laws are what we use to manipulate and simplify logical expressions.

The Commutative Laws tell us that order doesn't matter for AND and OR.

A+B=B+AAB=BAA + B = B + A \\ A \cdot B = B \cdot A

The Associative Laws say that grouping doesn't matter when you're just ANDing or just ORing.

(A+B)+C=A+(B+C)(AB)C=A(BC)(A + B) + C = A + (B + C) \\ (A \cdot B) \cdot C = A \cdot (B \cdot C)

The Distributive Law shows how AND and OR interact. This one should feel familiar from normal algebra.

A(B+C)=(AB)+(AC)A \cdot (B + C) = (A \cdot B) + (A \cdot C)

Helpful Properties

Beyond the fundamental laws, a few other properties are essential for simplifying expressions.

Identity and Null Laws These laws explain what happens when you combine a variable with a constant (0 or 1).

LawOR FormAND Form
IdentityA+0=AA + 0 = AA1=AA \cdot 1 = A
NullA+1=1A + 1 = 1A0=0A \cdot 0 = 0

Notice how in the Null law for OR, adding 1 always results in 1, regardless of what AA is. Similarly, for the AND version, multiplying by 0 always results in 0.

Idempotent and Complement Laws These laws deal with combining a variable with itself or its opposite.

LawOR FormAND Form
IdempotentA+A=AA + A = AAA=AA \cdot A = A
ComplementA+Aˉ=1A + \bar{A} = 1AAˉ=0A \cdot \bar{A} = 0

The Idempotent law might seem strange at first. In regular algebra, A+A=2AA + A = 2A. But in Boolean algebra, there's no "2". ORing a variable with itself doesn't change the value. The Complement law is also very powerful: a variable OR its opposite is always TRUE, and a variable AND its opposite is always FALSE.

Let's review these key ideas before we move on.

Ready to test your knowledge?

Quiz Questions 1/5

In Boolean algebra, what are the only two values a variable can represent?

Quiz Questions 2/5

For the Boolean expression ABA \cdot B to be TRUE (1), which of the following must be correct?

These rules are the foundation for simplifying complex logical statements. By applying them, you can reduce a complicated expression to a much simpler, equivalent one, which is a crucial skill in designing digital circuits and writing efficient code.