Skip to content
Go back

Boolean Algebra Cheat Sheet

This cheat sheet is based on the theoretical foundation developed in my Nand2Tetris Boolean Logic article.

Table of contents

Open Table of contents

What is boolean algebra

Boolean algebra uses binary values:

It replaces arithmetic operators with logical operators, and is the basis for all digital circuits.

Basic operators

OperationSymbolDescriptionExample
NOT~Inverts the input~1 = 0
AND&True only if both inputs are true1 & 1 = 1
OR|True if at least one input is true1 | 0 = 1
XOR^True if inputs are different1 ^ 0 = 1

Figure 1: Different boolean operations.

Truth tables

A truth table is a table that shows the truth value of each possible combination of inputs.

AND gate

xyOutput
000
010
100
111

Figure 2: Truth table for the AND operation.

OR gate

xyOutput
000
011
101
111

Figure 3: Truth table for the OR operation.

XOR gate

xyOutput
000
011
101
110

Figure 4: Truth table for the XOR operation.

Fundamental laws

Identity

Null

Idempotent

Complement

Commutative

Associative

Distributive

Special laws

De Morgan’s laws

Used to transform expressions to NAND/NOT form.

Absorption law

Simplification techniques

Algebraic simplification

Apply identities and laws above to reduce complexity.

Karnaugh Maps (K-Maps)

A graphical method to group minterms and simplify boolean expressions.

The Karnaugh map for the function x+z

Figure 5: The Karnaugh map for the function x+z.

Appendix: Selected proofs

This section contains a few representative proofs for readers interested in the logical foundations of Boolean algebra. Each proof uses either a truth table or simple algebraic reasoning.

De Morgan’s laws

Law 1

~(A & B) = ~A | ~B

Proof:

ABA & B~(A & B)~A | ~B
00011
01011
10011
11100

The column for ~(A & B) is the same as the column for ~A | ~B.

Law 2

~(A | B) = ~A & ~B

Proof:

ABA | B~(A | B)~A & ~B
00011
01100
10100
11100

Again, ~(A | B) and ~A & ~B have identical outputs.

Absorption law

A & (A | B) = A
A | (A & B) = A

Algebraic proof:

A & (A | B) = (A & A) | (A & B) = A
A | (A & B) = (A | A) & (A | B) = A

Share this post on:

Previous Post
Nand2Tetris Project 1 – Boolean Logic
Next Post
Hello, World!