Boolean Algebra
Learn the laws of Boolean algebra, including De Morgan's laws, and use them to simplify expressions step by step and check the result with a truth table.
Advanced30 min18 problems
Definition
Boolean algebra is a set of laws for rewriting Boolean expressions. Each law says that two expressions are equivalent: they have the same truth value for every input, so you may always replace one with the other. With the laws you can simplify an expression without building a new truth table every time.
We write 1 for true and 0 for false (the interactive truth tables use 1 and 0 too). Engineers often write for , for and for : these mean exactly the same. In this lesson we use , and .
The laws (, and are Boolean variables):
| Law | AND form | OR form |
|---|---|---|
| Identity | ||
| Null (domination) | ||
| Idempotent | ||
| Complement | ||
| Double negation | (only one form) | |
| Commutative | ||
| Associative | ||
| Distributive | ||
| Absorption | ||
| De Morgan |
Notice the pattern: swap with and 0 with 1 in one column and you get the other column. This is called duality.
Simplifying step by step: use one law per step and name it. Then check the result with a truth table: if the final columns match in every row, the simplification is correct.
Try it now
Which law says ?
Interactive Visual
Truth Table
ExpressionA ∧ B ∨ A ∧ ¬B
| A | B | A ∧ B | ¬B | A ∧ ¬B | A ∧ B ∨ A ∧ ¬B |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 1 |
1= True0= False
Truth Table
A ∧ B
| A | B | A ∧ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
1= True0= False
Interactive Sandbox
Expression Calculator
Try these:
History
No calculations yet
Practice Problems
18 problemsProblem 1 of 18
Easy
Which law says ?
Glossary
- Boolean algebra
- The set of laws for rewriting and simplifying Boolean expressions
- Law
- An equivalence that holds for every value of the variables, such as
- Equivalent
- Having the same truth value in every row of the truth table
- Simplify
- Rewrite an expression with fewer operators while keeping it equivalent
- De Morgan's laws
- and
- Absorption law
- and
Formula Card
Identity and null laws
AND with 1 and OR with 0 change nothing; AND with 0 and OR with 1 decide the result
Idempotent and complement laws
Repeating a variable adds nothing; a variable with its own negation gives a constant
Double negation
Two NOTs cancel each other out
Distributive laws
Both hold in Boolean algebra; the second one does not work for ordinary numbers
Absorption laws
The longer part is swallowed by $A$
De Morgan's laws
Break the bar, change the sign