No history yet

Introduction to Boolean Algebra

The Logic of 0 and 1

At the heart of every computer, smartphone, and digital device is a system of logic that runs on just two values: true and false. We represent these values with the numbers 1 and 0. This system is called Boolean algebra, and it's the foundation for all of digital electronics and computer programming.

Boolean Variable

noun

A symbol, usually a letter, that can represent one of two possible values: 1 (true) or 0 (false).

Instead of dealing with numbers you can add or subtract in the usual way, Boolean algebra uses logical operations to combine these true and false values. Let's look at the three most basic ones.

The Basic Operations

The fundamental building blocks of Boolean algebra are three operations: AND, OR, and NOT.

The AND operation is like a strict requirement. For the result to be true, all conditions must be true. In Boolean algebra, we often use a dot (·) to represent AND, so A AND B is written as ABA \cdot B. Sometimes, the dot is even omitted, like in regular algebra: ABAB.

The OR operation is more flexible. For the result to be true, at least one of the conditions must be true. We use a plus sign (+) to represent OR, so A OR B becomes A+BA + B.

Finally, the NOT operation simply inverts a value. If something is true, NOT makes it false. If it's false, NOT makes it true. We show the NOT operation with a bar over the variable, so NOT A is written as A\overline{A}.

Lesson image

Truth Tables

A truth table is a simple chart that lists every possible combination of input values and shows the output for each. It's a handy way to define exactly how a logical operation works without any ambiguity.

Here is the truth table for the AND operation (ABA \cdot B). Notice the output is 1 only when both A and B are 1.

ABA · B
000
010
100
111

Next is the truth table for the OR operation (A+BA + B). The output is 1 if A, B, or both are 1.

ABA + B
000
011
101
111

And finally, the truth table for the NOT operation (A\overline{A}) is the simplest. It just flips the input value.

A
01
10

Laws of Boolean Algebra

Just like regular algebra, Boolean algebra has laws that help us manipulate and simplify expressions. These laws are what allow us to design simpler, more efficient digital circuits.

The Commutative Law states that the order of variables doesn't matter for AND and OR operations. It's like saying 3 + 5 is the same as 5 + 3.

AB=BAA+B=B+A\begin{aligned} A \cdot B &= B \cdot A \\ A + B &= B + A \end{aligned}

The Associative Law says that how we group variables doesn't matter when we are only using AND or only using OR. It's the same as (2 + 3) + 4 being equal to 2 + (3 + 4).

(AB)C=A(BC)(A+B)+C=A+(B+C)\begin{aligned} (A \cdot B) \cdot C &= A \cdot (B \cdot C) \\ (A + B) + C &= A + (B + C) \end{aligned}

The Distributive Law shows us how to handle expressions with both AND and OR. It's a bit like factoring in regular algebra.

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

Using these laws, we can simplify complex Boolean expressions. For example, let's simplify the expression A(A+B)A \cdot (A + B).

First, we apply the distributive law: A(A+B)=(AA)+(AB)A \cdot (A + B) = (A \cdot A) + (A \cdot B)

In Boolean algebra, anything AND-ed with itself is just itself (AA=AA \cdot A = A). So, our expression becomes: A+(AB)A + (A \cdot B)

This can be simplified further. If A is 1, the expression is 1+(1B)1 + (1 \cdot B), which is 1+B1 + B, which is always 1. If A is 0, the expression is 0+(0B)0 + (0 \cdot B), which is 0+00 + 0, which is 0. So, the final result is just A!

A(A+B)=AA \cdot (A + B) = A

This kind of simplification is the key to creating efficient digital circuits. By reducing complex logic to its simplest form, we can build faster and cheaper hardware.

Ready to test your understanding of these building blocks?

Quiz Questions 1/5

Boolean algebra is a system of logic based on which two primary values?

Quiz Questions 2/5

Which logical operation is represented by a plus sign (+) in Boolean algebra and results in a true (1) output if at least one of the inputs is true?