Skip to content
LearnTronics menu

LearnTronics

Math

Math Index

Boolean Algebra — mathematics using only 0 and 1

In the previous lesson we introduced base 2, where every digit is either 0 or 1. Boolean algebra becomes simpler still: for the moment, each variable represents only one Boolean value at a time.

A Boolean variable has only two possible values:
0 or 1.

Those two values can also be read as false / true, off / on, or low / high when we apply the mathematics to logic and digital electronics.

This page takes a more mathematical approach than the Logic tutorials. The Logic section explains what AND, OR, NOT, and related ideas mean in ordinary language and circuits. Here we treat them as operations that can be calculated, rearranged, simplified, and proven equivalent.

Variables and operators

Let A and B be Boolean variables. Each may have only the value 0 or 1. The fundamental operations are:

OperationWordsCommon notationMeaning
NOT NOT A ~A
also ¬A or A
Reverse the value
ANDA AND BA·B or AB1 only when both are 1
ORA OR BA + B1 when either or both are 1
XORA XOR BA ⊕ B1 when exactly one is 1
Negation notation: LearnTronics will normally use the tilde, ~A, to mean NOT A. You will also commonly encounter ¬A, especially in formal logic, and an overbar such as A, especially in Boolean algebra, digital logic, and older electronics texts. All three mean the same thing here.
Important: the symbols + and · do not mean ordinary arithmetic here.

In Boolean algebra:
1 + 1 = 1 because 1 OR 1 is still 1.
1 · 1 = 1 because 1 AND 1 is 1.

The basic truth tables

ABA·BA+BA⊕B
00000
01011
10011
11110
A~A
01
10

A truth table is therefore not merely a logic diagram aid. It is also a mathematical way to define a Boolean operation completely.

Boolean identities

Because Boolean variables can only be 0 or 1, many useful relationships can be written as compact algebraic laws.

LawExpressionMeaning
Identity — ANDA·1 = AAND with 1 leaves A unchanged.
Identity — ORA+0 = AOR with 0 leaves A unchanged.
Null — ANDA·0 = 0AND with 0 always produces 0.
Null — ORA+1 = 1OR with 1 always produces 1.
Idempotent — ANDA·A = ARepeating A does not change it.
Idempotent — ORA+A = ARepeating A does not change it.
Complement — ANDA·~A = 0A and NOT A cannot both be 1.
Complement — ORA+~A = 1Either A or NOT A must be 1.
Double negation~(~A) = ANegating twice returns the original value.

Proving one identity

Consider:

A + 0 = A

There are only two possible values for A, so we can test both:

AA + 0Equal to A?
00Yes
11Yes

Because the two columns match for every possible value of A, the identity is proven.

Commutative, associative, and distributive laws

LawBoolean formWhat it allows
Commutative ANDA·B = B·ASwap the order of AND terms.
Commutative ORA+B = B+ASwap the order of OR terms.
Associative AND(A·B)·C = A·(B·C)Regroup AND operations.
Associative OR(A+B)+C = A+(B+C)Regroup OR operations.
DistributiveA·(B+C) = A·B + A·CDistribute AND across OR.
Boolean distributiveA + B·C = (A+B)·(A+C)OR can also distribute across AND.

The last relationship often surprises students because ordinary arithmetic does not have a matching form. Boolean algebra has its own structure and should be learned on its own terms.

Absorption

LawExpressionResult
AbsorptionA + A·BA
AbsorptionA·(A+B)A

Why A + A·B simplifies to A

If A is 1, the expression is already 1 regardless of B. If A is 0, then A·B is also 0. So B can never change the final answer.

A + A·B = A

De Morgan's laws

De Morgan's laws show how NOT moves across AND and OR operations:

~(A·B) = ~A + ~B
~(A+B) = ~A · ~B

In words:

Verify De Morgan with a truth table

ABA·B~(A·B)~A~B~A+~B
0001111
0101101
1001011
1110000

The final two columns match on every row, so the two expressions are equivalent.

Simplifying an expression

Suppose we begin with:

A·B + A·~B
1. Both terms contain A, so factor A:
A·(B + ~B)
2. From the complement law, B + ~B = 1:
A·1
3. From the identity law, A·1 = A:
A

So the entire original expression reduces to just A.

From algebra to circuits

A Boolean expression can describe the same function as a network of logic gates. Simplifying the algebra can therefore reduce the number of gates, connections, or operations needed to produce the same result.

That is one reason Boolean algebra is so useful in digital electronics: two expressions may look different but still produce exactly the same output for every possible input.

For the language and circuit interpretation of these operators, see Tutorial 0024 — AND, OR, NOT.