Professional Documents
Culture Documents
Boolean Algebra
Boolean Algebra
Digital logic circuits are an important part of modern technology. In today’s world, electronics
are based on logic gates. We will now examine the basic building blocks of any logic system,
the AND, OR and NOT functions. We will also learn to relate between logic diagrams and
logic expressions, and how to construct truth tables to verify accuracy.
An appropriate example could be a switch. We can consider a switch a two-state variable because
it is either off or on. Digital inputs have two possible values and are Boolean in nature.
Logic Operations
We have 3 main logic gates that alter our inputs to produce specific output:
1. The conjunction (logical product), commonly called AND, symbolized by (⋅) Ex: 𝐴𝐴 ⋅ 𝐵𝐵
2. The disjunction (logical sum), commonly called OR, symbolized by (+) Ex: 𝐴𝐴 + 𝐵𝐵
3. The negation, commonly called NOT, symbolized by ( � ) Ex: 𝐴𝐴̅
2
Module: Computer Number Systems and Boolean Algebra
Below is a figure representing a two-input AND gate, where A and B are the input variables:
(a) logic symbol; (b) truth table.
a) A b) Condition A B 𝐴𝐴𝐴𝐴
𝐴𝐴𝐴𝐴
B 1 0 0 0
2 0 1 0
3 1 0 0
4 1 1 1
Truth tables are used to show ALL possible outcomes. Remember 𝐴𝐴𝐴𝐴 is only true when both A
AND B are both true.
Example: Construct a truth table using 0s and 1s (binary system) showing a three-input AND
gate. How many conditions produce a TRUE output?
𝑨𝑨 𝑩𝑩 𝑪𝑪 𝑨𝑨𝑨𝑨𝑨𝑨
0 0 0 A
0 0 1 B 𝐴𝐴𝐴𝐴𝐴𝐴
C
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
3
Module: Computer Number Systems and Boolean Algebra
The OR Function
FACT: For the OR function, the output is true when any of the inputs is true. Otherwise, the
output is false.
Below is a figure representing a two-input AND gate, where A and B are the input variables:
(a) logic symbol; (b) truth table
a) A b) Condition A B 𝐴𝐴 + 𝐵𝐵
𝐴𝐴 + 𝐵𝐵
B 1 0 0 0
2 0 1 1
3 1 0 1
4 1 1 1
The complement is best described as simply the opposite. If the condition is true, then the
complement is false; if the condition is false, the complement is true. Since Boolean systems are
one or the other (and that’s it), the complement is the opposite. A logic circuit producing the NOT
function is called an inverter.
Below is a figure representing an inverter, where A is the input variable: (a) logic symbol;
(b) truth table
𝐴𝐴 𝐴𝐴̅
𝐴𝐴 𝐴𝐴̅ 1 0
0 1
𝐴𝐴̅ 𝐴𝐴
4
Module: Computer Number Systems and Boolean Algebra
Below is a figure representing a two-input XOR gate, where A and B are the input variables: (a)
logic symbol; (b) truth table.
a) A b) Condition A B 𝐴𝐴 ⊕ 𝐵𝐵
𝐴𝐴 ⊕ 𝐵𝐵
B
1 0 0 0
2 0 1 1
3 1 0 1
4 1 1 0
Example: Draw the logic diagrams that represent the following Boolean expressions.
a) 𝐵𝐵 + 𝐶𝐶̅
b) (𝐴𝐴̅𝐵𝐵) ⊕ 𝐶𝐶
5
Module: Computer Number Systems and Boolean Algebra
Below is a figure representing a two-input NAND gate, where A and B are the input variables: (a) logic
symbol; (b) truth table.
a) A ����
𝐴𝐴𝐴𝐴 b) Condition A B ����
𝐴𝐴𝐴𝐴
B 1 0 0 1
2 0 1 1
3 1 0 1
4 1 1 0
Below is a figure representing a two-input NOR gate, where A and B are the input variables: (a) logic
symbol; (b) truth table.
a) A b) Condition A B ��������
𝐴𝐴 + 𝐵𝐵
��������
𝐴𝐴 + 𝐵𝐵
B 1 0 0 1
2 0 1 0
3 1 0 0
4 1 1 0
Below is a figure representing a two-input NXOR gate, where A and B are the input variables: (a) logic
symbol; (b) truth table.
a) A b) Condition A B ��������
𝐴𝐴 ⊕ 𝐵𝐵
��������
𝐴𝐴 ⊕ 𝐵𝐵
B
1 0 0 1
2 0 1 0
3 1 0 0
4 1 1 1
6
Module: Computer Number Systems and Boolean Algebra
Summary
Order of operations
The three basic logic functions discussed, AND, OR and NOT, are the basic building blocks for all
computer logic circuits. Logic diagrams are drawn to symbolize logic expressions.
7
Module: Computer Number Systems and Boolean Algebra
Example: Draw the logic diagrams that represent the following Boolean expressions:
a) 𝐴𝐴 ⊕ 𝐵𝐵(𝐴𝐴 + 𝐵𝐵�)
b) �������������
𝐵𝐵 + 𝐶𝐶̅ + 𝐷𝐷
c) ��������
𝐶𝐶̅ + 𝐵𝐵 (𝐴𝐴̅𝐵𝐵)
8
Module: Computer Number Systems and Boolean Algebra
9
Module: Computer Number Systems and Boolean Algebra
All of these rules will be given to you on a formula sheet. Your job is to tell me which one you are
using for each step of your simplification.
Postulates
Postulates describe truths in a short-abbreviated way. Here is a table describing the AND, OR and
NOT functions.
POSTULATES
1a. 𝐴𝐴 = 1 (if 𝐴𝐴 ≠ 0) 1b. 𝐴𝐴 = 0 (if 𝐴𝐴 ≠ 1)
2a. 0 ⋅ 0 = 0 2b. 0 + 0 = 0
3a. 1 ⋅ 1 = 1 3b. 1 + 1 = 1
4a. 1 ⋅ 0 = 0 4b. 1 + 0 = 1
5a. 1� = 0 5b. 0� = 1
Postulates 1a and 1b describe how Boolean expressions are binary (either 1 or 0). Postulates 2a,
3a and 4a describe the AND function. Postulates 2b, 3b and 4b describe the OR function.
Postulate 5a and 5b describe the NOT function.
Algebraic Properties
Below are algebraic properties that are not only true for ordinary algebra, but also Boolean
algebra. Remember, Boolean expressions contain variables having ONLY two possible values.
ALGEBRAIC PROPERTIES
Commutative
6a. 𝐴𝐴𝐴𝐴 = 𝐵𝐵𝐵𝐵 6b. 𝐴𝐴 + 𝐵𝐵 = 𝐵𝐵 + 𝐴𝐴
Associative
7a. 𝐴𝐴(𝐵𝐵𝐵𝐵) = 𝐴𝐴𝐴𝐴(𝐶𝐶) 7b. 𝐴𝐴 + (𝐵𝐵 + 𝐶𝐶) = (𝐴𝐴 + 𝐵𝐵) + 𝐶𝐶
Distributive
8a. 𝐴𝐴(𝐵𝐵 + 𝐶𝐶) = 𝐴𝐴𝐴𝐴 + 𝐴𝐴𝐴𝐴 8b. 𝐴𝐴 + 𝐵𝐵𝐵𝐵 = (𝐴𝐴 + 𝐵𝐵)(𝐴𝐴 + 𝐶𝐶)
The algebraic property 8b is the most unlike ordinary algebra. Let’s prove it’s true using a truth
table.
10
Module: Computer Number Systems and Boolean Algebra
Example: The distributive property 8b states that 𝐴𝐴 + 𝐵𝐵𝐵𝐵 = (𝐴𝐴 + 𝐵𝐵)(𝐴𝐴 + 𝐶𝐶). Prove that they
are equal by constructing a truth table.
these should
be equal!
Theorem
The following theorems define the application of the operators to variables:
THEOREMS
9a. 𝐴𝐴 ⋅ 0 = 0 9b. 𝐴𝐴 + 0 = 𝐴𝐴
10a. 𝐴𝐴 ⋅ 1 = 𝐴𝐴 10b. 𝐴𝐴 + 1 = 1
11a. 𝐴𝐴 ⋅ 𝐴𝐴 = 𝐴𝐴 11b. 𝐴𝐴 + 𝐴𝐴 = 𝐴𝐴
̅
12a. 𝐴𝐴 ⋅ 𝐴𝐴 = 0 12b. 𝐴𝐴 + 𝐴𝐴̅ = 1
13a. 𝐴𝐴̅ = 𝐴𝐴 13b. 𝐴𝐴 = 𝐴𝐴̅
11
Module: Computer Number Systems and Boolean Algebra
Example: Check your solution: Show that (𝐴𝐴 + 𝐵𝐵) + 𝐵𝐵� = 1 by constructing a truth table.
𝑨𝑨 𝑩𝑩
0 0
0 1
1 0
1 1
12
Module: Computer Number Systems and Boolean Algebra
b) 𝐴𝐴̅(𝐵𝐵 + 𝐴𝐴𝐴𝐴)
13
Module: Computer Number Systems and Boolean Algebra
DE MORGAN’S THEOREMS
ABSORPTION THEOREM
15a. 𝐴𝐴(𝐴𝐴 + 𝐵𝐵) = 𝐴𝐴 15b. 𝐴𝐴 + 𝐴𝐴𝐴𝐴 = 𝐴𝐴
16a. 𝐴𝐴(𝐴𝐴̅ + 𝐵𝐵) = 𝐴𝐴𝐴𝐴 16b. 𝐴𝐴 + 𝐴𝐴̅𝐵𝐵 = 𝐴𝐴 + 𝐵𝐵
14
Module: Computer Number Systems and Boolean Algebra
b. �������������
𝐴𝐴̅ + 𝐵𝐵 + 𝐶𝐶̅
15
Module: Computer Number Systems and Boolean Algebra
Example: For the logic diagram below (i) write the Boolean expression, (ii) simplify the Boolean
expression and justify each step, (iii) draw the simplified logic diagram, and (iv) construct a truth
table to prove that the two expressions are equal.
𝐴𝐴
𝐵𝐵
𝑨𝑨 𝑩𝑩
0 0
0 1
1 0
1 1
16