Chapter 4 Boolean Algebra
Chapter 4 Boolean Algebra
In this chapter, we will study logic gates, which are the elementary blocks of logic circuits, and
we will see how it is possible to describe their operation using Boolean algebra. Additionally,
we will teach you how to build logic circuits by combining gates and how Boolean algebra
manages to describe and analyse them.
2. Basic Notation
Before delving into this topic, it's essential to familiarize ourselves with some fundamental notations.
Boolean Algebra created by George Boole. It is a convenient and systematic way of expressing and
analyzing the operations and the mathematics of logic circuits
Logical Variables These are like switches that can only be in one of two states: 0 or 1
Logical 0 (LOW or False):
▪ Think of it as "off" or "no electricity."
▪ In circuits, it usually means 0 volts.
Logical 1 (HIGH or True):
▪ Think of it as "on" or "yes, electricity is flowing."
▪ In circuits, it means there’s a higher voltage.
Logical Function is a mathematical function X = f (A,B,C..) describes the relation between the inputs
(A, B, C,…) as variables and the outputs X.
Example: If you press a button (input A), the light turns ON (output X).
Logical Operators takes one or more logical values as input and provides a single logical value as
out-put. Two types of operators are distinguished: basic and combined.
Truth table lists all possible combinations of its inputs and their corresponding outputs.
The number of possible input combinations is based on how many inputs there are. To find the total
combinations:
Use the formula: PC = 2ᴺ, where N is the number of inputs.
1
Chapter 3 Boolean Algebra
-For two input variables: N = 22 = 4 combinations Input 1 Input Input 3 Output (X)
(A) 2(B) (C)
-For three input variables: N = 23 = 8 combinations
0 0 0 0
-For four input variables: N = 24 = 16 combinations 0 0 1 0
Example: Draw the truth table of the pervious combinational 0 1 0 0
system. 0 1 1 0
1 0 0 0
1 0 1 0
We have 3 inputs → Pc = 23 => 8 possible combinations of inputs 1 1 0 0
And 1 output X= A+B+C 1 1 1 1
3. Logical operators
Basic operators:
3.1. Negation (NOT gate) Also known the complement
• it has one input and one output.
• It represents the inverse(complement) of a variable.
• It is indicated by a bar over the variable (overbar 𝑨 ̅ ).
The Logical NOT Gate
A NOT gate, more commonly known as an inverter, always has only one input. Its output takes the
logical level opposite to the logical level of the input. Input Output
(A) ̅)
(X=𝑨
0 1
1 0
The logic expression (function) of the inverter gate is given by the following equation:
✓ If A = 1, then 𝑋 = 𝐴̅ = 0.
✓ If A = 0, then X= 𝐴̅ = 1. The complement of the variable A is read as “not A” or “A bar.”
The symbol used for the NOT gate is a triangle with a circle at the output, The circle is used also in
other gates to indicate a negation
Example:
Binary
The ones complement in logic circuits is consider
as an inverter.
The bits of the binary number are applied to the
inverter inputs and the 1’s complement of the
number appears on the outputs.
1’s complement
2
Chapter 3 Boolean Algebra
• The following table represents the truth table of the AND gate.
Input 1 Input 2 Output
(A) (B) (X = AB)
According to this table, you can easily deduce that the logical AND
function (logic product) corresponds to binary multiplication. 0 0 0
0 1 0
In the AND operation, the output is 1 if and only if all inputs are 1, and 1 0 0
it is 0 in all other cases. 1 1 1
The Logical AND Gate In other words, the AND gate is a logical circuit that activates its output (level
1) only when all its inputs are active (level 1). In all other cases, the output of the AND gate is inactive
(level 0), thus:
There are some AND gates with more than 2 inputs, the output gives the multiplications of the in-
puts.
To extend the AND expression to more than two input variables, simply use a new letter for each input
variable.
o The function of a 3-input AND gate, for example, can be expressed as X = ABC, where A, B, and
C are the input variables.
o The expression for a 4-input AND gate can be X = ABCD, and so on.
The output is an audible alarm, it is energized for 30 seconds (the AND gate is HIGH=1) if there is a
passenger on the seat, and the seatbelt is unbuckled.
3
Chapter 3 Boolean Algebra
• Disjunction is a two bits or more operation, it pro- Input 1 (A) Input 2 (B) Output (X)
vides a true value if at least one bit is true(1). 0 0 0
• When we combine A and B using the logical OR 0 1 1
function, the result X satisfies the following ex-
1 0 1
pression:
1 1 1
X=A+B
• The output function is active if A OR B is active.
• The operation of this operator is defined by the following truth table.
• The logical OR is represented by the symbol of addition (logic addition): X = A + B
• The symbol used to represent a two-
input OR gate is shown:
The Logical OR Gate It is a logical circuit that activates its output (level 1) if either one or both of the
inputs are active (level 1). The output is inactive (level 0) only if both inputs are inactive (level 0).
Like the AND gates, it exists some OR gates with more than 2 inputs, the output gives the addition of
the inputs.
To extend the OR expression to more than two input variables, a new letter is used for each additional
variable.
4
Chapter 3 Boolean Algebra
Combined operators:
In digital electronics, four other types of logical gates are frequently encountered:
In reality, these gates correspond to combinations of the basic AND, OR, and NOT operations, and it is
relatively easy to describe them using the functions of Boolean algebra that you are already familiar
with.
• The NAND gate operates similarly to an AND gate followed by an inverter. The output expres-
sion of a NOT-AND gate is:
X= ̅̅̅̅̅
𝐴. 𝐵 = 𝐴 ↑ 𝐵.
5
Chapter 3 Boolean Algebra
• The truth table indicates that the output of a NOT-AND gate is precisely the inverse of that of
an AND gate for all input combinations.
Input 1 Input 2 Output (X)
(A) (B) ̅̅̅̅̅
𝑨. 𝑩 = 𝑨 ↑ 𝑩
In general, the output function of a n-input NOT-AND gate is
0 0 1
✓ Active (logic level 1) if only one of the inputs is inactive 0 1 1
(logic level 0).
1 0 1
✓ Inactive (logic level 0) only when all inputs are active (logic
level 1). 1 1 0
You'll notice based in the figure that it is the symbol of an OR gate, except there is a small bubble
(circle) at the tip. This small circle represents an inversion operation.
• NOR gate operates similarly to an OR gate followed by an inverter. The output expression of a
NOR gate is:
X = ̅̅̅̅̅̅̅̅̅
𝐴 + 𝐵=𝐴↓𝐵
where X is the output, and A and B are the two inputs. The bar over the expression ̅̅̅̅̅̅̅̅̅̅
𝐴 + 𝐵 indicates
the logical NOT (inversion) operation applied to the OR of A and B.
• The truth table shown indicates that the output of a NOR Input 1 (A) Input 2 Output X=
(B) ̅̅̅̅̅̅̅̅
𝑨+𝑩 =𝑨↓ 𝑩
gate is precisely the inverse of that of an OR gate for all in-
put combinations. 0 0 1
0 1 0
1 0 0
In general, the output function of a n-input NOR gate is: 1 1 0
✓ Active (logic level 1) only when all inputs are inactive (logic level 0).
✓ Inactive (logic level 0) if any of the inputs is active (logic level 1).
6
Chapter 3 Boolean Algebra
When the two input logic levels are opposite, the output of the exclusive-NOR gate is Low. The opera-
tion can be stated as follows (A and B are inputs, X is the output):
̅̅̅̅̅̅̅̅
X=𝐴 ⊕ 𝐵 = 𝐴. 𝐵 + 𝐴̅. 𝐵̅
7
Chapter 3 Boolean Algebra
A logic system can be represented with its logic expression, truth table or logic diagram.
•To write the expression of a logic diagram, we write sub-expressions for each logic gate
based on its inputs and operation.
• Combine the sub-expressions using the appropriate logical operators based on the in-
terconnections in the diagram. Use parentheses to clarify the order of operations.
Example: For the example logic diagram in the following Figure, the Boolean expression is deter-
mined in the following three steps:
1. The expression for the left-most AND gate with inputs C and D is CD.
2. The output of the left-most AND gate is one of the inputs to the OR gate and B is the
other input. Therefore, the expression for the OR gate is B + CD.
3. The output of the OR gate is one of the inputs to the right-most AND gate and A is the
other in-put. Therefore, the expression for this AND gate is A(B + CD), and the final
output expression for the entire circuit is given by:
F=A(B + CD)
4.2. Truth table and logic diagram from Expression
8
Chapter 3 Boolean Algebra
• In a truth table, a logic output is considered True when it is in the HIGH state, represented by
the logical value 1, and False when if is in LOW state (0).
B A S
• In the following truth table, the expression S is at 1 for three input
combinations: 0 0 1
• 0 1 0
A = 0 and B = 0, OR A= 0 and B = 1, OR A= 1 and B = 1 1 0 1
So these combinations can be written with this expression: 1 1 1
̅ .B
S=A ̅ + ̅A . B + A. ̅B
To write expression of a logic function represented by its truth table, we use Canonical form: Sum Of
Products (SOP) or Product of Sum (POS)
Simplifying logic expressions is essential in digital design and Boolean algebra for several reasons:
• Reduced Complexity: and make circuits easier to understand.
• Minimized Costs: by reducing the number of used logic gates.
• Improved Performance: The speed of a circuit is directly proportional to its simplicity—fewer
components result in quicker response times.
• Facilitates Troubleshooting: During the debugging and troubleshooting phases, simplified logic
expressions can make it easier to identify and rectify errors.
In this Chapter, we employ algebraic techniques and Karnaugh maps for simplifying logic expressions
The algebraic simplification method is based on the application of the basic laws, rules, and theo-
rems of Boolean algebra. Let’s introduce the set of this rules:
Rules Expression (OR) Demonstration Expression (AND) Demonstration
Negation/comple- 𝐴 + 𝐴̅ = 1 A=0→0+1=1 𝐴. 𝐴̅ = 0 A=0→0⋅1=0
ment A=1→1+0=1 A=1→1⋅0=0
Xor complement 𝐴 1 = 𝐴̅
𝐴 𝐴̅ = 1
Before presenting the other laws of Boolean algebra, we would like to mention that in the previous
rules, the variable can correspond to an expression containing more than one variable.
9
Chapter 3 Boolean Algebra
laws of Boolean algebra: The following laws pertain with more than one variable:
-Commutative law:
• With OR Expression: 𝐴 + 𝐵 = 𝐵 + 𝐴
• With AND Expression: 𝐴. 𝐵 = 𝐵. 𝐴
• With XOR Expression: 𝐴 𝐵 = 𝐵 𝐴
- Associative law:
• With OR Expression: 𝐴 + (𝐵 + 𝐶) = (𝐵 + 𝐴) + 𝐶
• With AND Expression: (𝐴. 𝐵). 𝐶 = 𝐴. (𝐵𝐶)
• With XOR Expression: 𝐴 ⊕ (𝐵 ⊕ 𝐶) = (𝐴 ⊕ 𝐵) ⊕ 𝐶
- Distributive law:
• With OR Expression: 𝐴 + (𝐵. 𝐶) = (𝐴 + 𝐵). (𝐴 + 𝐶)
(𝐴 + 𝐵). (𝐴 + 𝐶) = 𝐴𝐴 + 𝐴𝐶 + 𝐴𝐵 + 𝐵𝐶
= 𝐴 + 𝐴𝐶 + 𝐴𝐵 + 𝐵𝐶
= 𝐴(1 + 𝐶) + 𝐴𝐵 + 𝐵𝐶
= 𝐴(1 + 𝐵) + 𝐵𝐶
= 𝐴 + 𝐵𝐶
- Inclusion:
𝐴. 𝐵 + 𝐴. 𝐵̅ = 𝐴 (𝐴 + 𝐵). (𝐴 + 𝐵̅) = 𝐴
Demonstration: Let’s demonstrate the first case 𝐴. 𝐵 + 𝐴. 𝐵̅ = 𝐴
10
Chapter 3 Boolean Algebra
𝐴. 𝐵 + 𝐴. 𝐵̅ = 𝐴. (𝐵 + 𝐵̅)
knowing that 𝐵 + 𝐵̅ = 1
𝐴. 𝐵 + 𝐴. 𝐵̅ = 𝐴. (1) = 𝐴
- Relief theory
𝐴 + (𝐴̅. 𝐵) = 𝐴 + 𝐵 𝐴. (𝐴̅ + 𝐵) = 𝐴. 𝐵
Demonstration: Let’s demonstrate 𝐴 + (𝐴̅. 𝐵) = 𝐴 + 𝐵
𝐴 + (𝐴̅. 𝐵) = (𝐴 + 𝐴̅)(𝐴 + 𝐵) f
𝐴 + (𝐴̅. 𝐵) = 1(𝐴 + 𝐵) (𝐴 + 𝐴̅) = 1
̅
𝐴 + (𝐴. 𝐵) = 𝐴 + 𝐵
- De-Morgan theory
The De Morgan theorems prove to be highly useful for simplifying expressions involving sums or
products of complemented variables. Here are these two theorems:
̅̅̅̅̅̅̅̅
𝐴 + 𝐵 = 𝐴̅. 𝐵̅ ̅̅̅̅̅
𝐴. 𝐵 = 𝐴̅ + 𝐵̅
Although these theorems were formulated for single variables A and B, they remain true for cases
where X and Y are expressions involving multiple variables.
̅̅̅̅̅̅̅̅̅̅
𝐴𝐵̅ + 𝐶 = ̅̅̅̅̅̅̅
( 𝐴. 𝐵̅). 𝐶̅
Example: Apply DeMorgan’s theorems and Boolean algebra to the specific expression
11
Chapter 3 Boolean Algebra
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅
𝐴 + 𝐵𝐶̅ + 𝐷(𝐸 + 𝐹̅ )
Identify the terms to which you can apply DeMorgan’s theorems, and think of each term as a single
variable.
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅
𝐴 + 𝐵𝐶̅ + 𝐷(𝐸 + 𝐹̅ ) = ̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅̅̅̅ ( 𝐴 + 𝐵𝐶 ). 𝐷(𝐸 ̅̅̅̅̅̅̅̅̅̅
+ 𝐹̅ )
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅ ̅ + ̿̿̿̿̿̿̿̿̿̿
𝐴 + 𝐵𝐶̅ + 𝐷(𝐸 + 𝐹̅ ) = (𝐴. 𝐵𝐶̅ ). (𝐷 (𝐸 + 𝐹̅ ))
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅
𝐴 + 𝐵𝐶̅ + 𝐷(𝐸 + 𝐹̅ ) = (𝐴. 𝐵𝐶̅ ). (𝐷 ̅ + 𝐸 + 𝐹̅ )
A simplified Boolean expression uses the fewest gates possible to implement a given expression us-
ing the basic laws, rules, and theorems of Boolean algebra.
Example: Using Boolean algebra techniques, simplify this expression:
𝐴𝐵 + 𝐴(𝐵 + 𝐶) + 𝐵(𝐵 + 𝐶)
Step 1: Apply the distributive law to the second and third terms in the expression, as follows:
𝐴𝐵 + 𝐴𝐵 + 𝐴𝐶 + 𝐵𝐵 + 𝐵𝐶
𝐴𝐵 + 𝐴𝐵 + 𝐴𝐶 + 𝐵 + 𝐵𝐶
Step 3: Apply rule Idempotent (𝐴𝐵 + 𝐴𝐵 = 𝐴𝐵) to the first two terms.
𝐴𝐵 + 𝐴𝐶 + 𝐵 + 𝐵𝐶
𝐴𝐵 + 𝐴𝐶 + 𝐵
Step 5: Apply rule Absorption (𝐴𝐵 + 𝐵 = 𝐵) to the first and third terms.
𝐵 + 𝐴𝐶
At this point the expression is simplified as much as possible. Once you gain experience in applying
Boolean algebra, you can often combine many individual steps.
12
Chapter 3 Boolean Algebra
Step 1: Apply the associative law to the 2 ,3,4 and 5 terms in the expression, as follows:
𝐴𝐵̅𝐶𝐷 + 𝐴𝐵(𝐶̅ 𝐷
̅ + 𝐶̅ 𝐷 + 𝐶𝐷
̅ + 𝐶𝐷)
Step 2: Apply the commutative law and complement rule to the 2nd term in the expression, as fol-
lows:
𝐴𝐵̅𝐶𝐷 + 𝐴𝐵(𝐶̅ (𝐷
̅ + 𝐷) + 𝐶(𝐷
̅ + 𝐷))
Step 3: Apply the associative and Relief ( 𝐵̅𝐶𝐷 + 𝐵 = 𝐵 + 𝐶𝐷 ) laws in the expression, as follows:
𝐴𝐵̅𝐶𝐷 + 𝐴𝐵𝐶̅ 𝐷
̅ + 𝐴𝐵𝐶̅ 𝐷 + 𝐴𝐵𝐶𝐷
̅ + 𝐴𝐵𝐶𝐷
= 𝐴(𝐶𝐷 + 𝐵)
So, we have moved from circuits that contains several AND and OR gates connected with inverters to
just 2 AND gates and 1 OR.
The truth table lists the combination of inputs and their corresponding outputs. The function repre-
sented by the truth table is True (1) for some combinations, and false (0) for the others
When extracting a logic expression from a truth table, we have the flexibility to derive the original
function (𝐹) by considering the rows with ones, or its complemented form ( 𝐹̅ ) by focusing on the rows
with zeros.
All Boolean expressions, regardless of their form, can be converted into either of two forms: the sum-
of-products form or the product-of-sums form.
Standardization (canonical form) makes the evaluation, simplification, and implementation of Boolean
expressions much more systematic and easier.
A product term was defined as a term consisting of the product (Boolean multiplication) of literals
(variables or their complements). When two or more product terms are summed by Boolean addition,
the resulting expression is a sum-of-products (SOP). Some examples are:
𝐴𝐵 + 𝐴𝐵𝐶
𝐴𝐵 + 𝐴𝐵𝐶 + 𝐴𝐶
13
Chapter 3 Boolean Algebra
In an SOP expression, a single overbar cannot extend over more than one variable; however, more
than one variable in a term can have an overbar. For example, an SOP expression can have the term:
̅𝑩
𝑨 ̅ but not 𝑨𝑩𝑪
̅𝑪 ̅̅̅̅̅̅
Implementing an SOP expression simply requires ORing the outputs of two or more AND gates. A prod-
uct term is produced by an AND operation, and the sum (addition) of two or more product terms is
produced by an OR operation.
Conversion of a General Expression to SOP Form can be changed into SOP form by applying Boolean
algebra techniques.
For example, the expression 𝐴(𝐵 + 𝐶𝐷) can be converted to SOP form by applying the distributive
law:
So far, we have seen SOP expressions in which some of the product terms do not contain all of the
variables of the expression.
A standard SOP expression is one in which all the variables appear in each product term in the ex-
pression.
Standard Sum of products or sum of minterms = disjunctive canonical form = first canonical form =
FC1
✓ Standard Sum of products expression is important in constructing truth tables, and in the
Karnaugh map simplification method.
✓ The logical product of these variables is known as Minterm
✓ In the minterm or in a product term in general, the normal variable is represented by 1 and
the complemented variable is represented by 0.
14
Chapter 3 Boolean Algebra
The first canonical form can be obtained from the truth table directly by considering those input com-
binations that produce a logic ‘1’ at the output.
̅,
Example: Let’s take an example about that, So, assume the function 𝑭(𝑨, 𝑩, 𝑪) = 𝑨. 𝑩 + 𝑪
A B C A.B ̅
𝑪 ̅ minterms
𝑭(𝑨, 𝑩, 𝑪) = 𝑨. 𝑩 + 𝑪
0 0 0 0 1 1 ̅. 𝑩
𝑨 ̅
̅. 𝑪
0 0 1 0 0 0
0 1 0 0 1 1 ̅ . 𝑩. 𝑪
𝑨 ̅
0 1 1 0 0 0
1 0 0 0 1 1 𝑨. 𝑩 ̅
̅. 𝑪
1 0 1 0 0 0
1 1 0 0 1 1 𝑨. 𝑩. 𝑪̅
1 1 1 1 0 1 𝑨. 𝑩. 𝑪
To obtain the logical expression from the truth table in the first canonical form FC 1 (we add the sum
of the Minterms for which the output is 1.
6.1.2. decimal form of the canonical form (FD 1) : decimal form of the disjunctive (first) ca-
nonical form FD 1 represented by the sum of decimal numbers equivalent to the
Minterms in which the output is equal to 1.
The variable is represented by 1 and the complemented variable is represented by 0.
Any nonstandard SOP expression (referred to simply as SOP) can be converted to the standard form
using Boolean algebra. Each product term in an SOP expression that does not contain all the variables
15
Chapter 3 Boolean Algebra
in the expression can be expanded to standard form to include all variables in the domain and their
complements.
As stated in the following steps, a nonstandard SOP expression is converted into standard form
̅ = 𝟏): a variable added to its complement equals 1.
using Boolean algebra rule (𝑨 + 𝑨
Step 1: Multiply each nonstandard product term by a term made up of missing variable and its com-
plement. This results in two product terms. As you know, you can multiply anything by 1 without
changing its value.
Step 2: Repeat Step 1 until all resulting product terms contain all variables in the domain in either
complemented or uncomplemented form. In converting a product term to standard form, the number
of product terms is doubled for each missing variable.
𝐹 = 𝐴𝐵 + 𝐶
The domain of this SOP expression is A, B, C. Take one term at a time. The first term, AB, is missing
variable 𝐶 𝑜𝑟 𝐶̅ , so multiply the first term 𝐶 + 𝐶̅ as follows:
The two resulting terms are missing variable D or, so multiply both terms by 𝐵 + 𝐵̅ as follows:
A sum term was defined as a term consisting of the sum (Boolean addition) of literals (variables or their
complements). When two or more sum terms are multiplied, the resulting expression is a product-of-
sums (POS). Some examples are:
(𝐴 + 𝐵̅ )(𝐴 + 𝐵 + 𝐶̅ )
(𝐴̅ + 𝐵 + 𝐶̅ )(𝐶 + 𝐷
̅ + ̅𝐸 )(𝐵̅ + 𝐶 + 𝐷)
16
Chapter 3 Boolean Algebra
In an POS expression, a single overbar cannot extend over more than one variable; however, more
than one variable in a term can have an overbar. For example, an POS expression can have the term:
̅+𝑩
𝑨 ̅ +𝑪̅ but not ̅̅̅̅̅̅̅̅̅̅̅̅̅
𝑨+𝑩+𝑪
Implementing a POS expression simply requires ANDing the outputs of two or more OR gates. A sum
term is produced by an OR operation, and the product of two or more sum terms is produced by an
AND operation.
A standard POS expression is one in which all the variables in the domain appear in each sum term
in the expression.
𝐷 )(𝐴̅ + 𝐵 + 𝐶̅ + 𝐷)(𝐴 + 𝐵 + 𝐶 + 𝐷)
For example, (𝐴 + 𝐵̅ + 𝐶 + ̅
Standard Product of Sums = Product of maxterms = Conjunctive canonical form = Second canonical
form = FC2
The Maxterms of n variables is the logical sum of all the variables in the domain whether in their nor-
mal or complemented forms. In the maxterm, of in a sum term in general, the normal variable is
represented by 0 and the complemented variable is represented by 1.
A B C Maxterm
Example: n = 3 (A, B, C) then: 0 0 0 𝐴+𝐵+𝐶 M0
0 0 1 𝐴 + 𝐵 + 𝐶̅ M1
𝐴̅ + 𝐵̅ + 𝐶̅ , 𝐴 + 𝐵̅ + 𝐶̅ , ̅𝐴 + 𝐵 + 𝐶̅ , ̅𝐴 + 𝐵̅ + 𝐶, 𝐴̅ + 𝐵 +
0 1 0 𝐴 + 𝐵̅ + 𝐶 M2
𝐶, 𝐴 + 𝐵 + 𝐶̅ , 𝐴 + 𝐵̅ + 𝐶, 𝐴 + 𝐵 + 𝐶 are maxterms
0 1 1 𝐴 + 𝐵̅ + 𝐶̅ M3
𝐴̅ + 𝐵̅, 𝐴̅ + 𝐶, 𝐵 + 𝐶̅ , 𝐵 + 𝐶, 𝐴 + 𝐵̅ are not maxterms; 1 0 0 𝐴̅ + 𝐵 + 𝐶 M4
1 0 1 𝐴̅ + 𝐵 + 𝐶̅ M5
With n variable, we can form 2n different maxterms 1 1 0 𝐴̅ + 𝐵̅ + 𝐶 M6
1 1 1 𝐴̅ + 𝐵̅ + 𝐶̅ M7
The second canonical form can be obtained from the truth table directly by considering those input
combinations that produce a logic ‘0’ at the output.
1. We directly obtain the maxterms for which the output in the truth table is 0.
2. ̅ (for which the output is 0) by adding the
We first obtain the FC 1 of the function 𝑭
Minterms, then we calculate 𝐹̿ by applying the DE Morgan theorem.
Let the same previous example: 𝐹(𝐴, 𝐵, 𝐶) = 𝐴. 𝐵 + 𝐶̅ .
A B C A.B ̅
𝑪 ̅
𝑭(𝑨, 𝑩, 𝑪) = 𝑨. 𝑩 + 𝑪 Maxterms for output 0 ̅)
Minterms (𝑭
0 0 0 0 1 1
0 0 1 0 0 0 ̅
𝑨+𝑩+𝑪 𝐴̅. 𝐵̅. 𝐶
0 1 0 0 1 1
0 1 1 0 0 0 𝑨+𝑩 ̅
̅ +𝑪 𝐴̅. 𝐵. 𝐶
1 0 0 0 1 1
17
Chapter 3 Boolean Algebra
1 0 1 0 0 0 𝑨̅+𝑩+𝑪 ̅ 𝐴. 𝐵̅. 𝐶
1 1 0 0 1 1
1 1 1 1 0 1
Using the first method, we directly get the FC2 by multiplying the maxterms for which the output is
0:
FC2 (F) = (𝑨 + 𝑩 + 𝑪̅ ).(𝑨 + 𝑩
̅ +𝑪̅ ).(𝑨
̅+𝑩+𝑪 ̅)
Using the second method, we first get 𝐹̅ which is the sum of minterms for which the output is 0, then
complementing it using de-morgan’s:
𝐹̅ = 𝐴̅. 𝐵̅ . 𝐶 + 𝐴̅. 𝐵. 𝐶+ 𝐴. 𝐵̅. 𝐶
𝐹 = 𝐹̿ =𝐴 ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅. 𝐵̅ . 𝐶 + 𝐴̅. 𝐵. 𝐶 + 𝐴. 𝐵̅. 𝐶
= ̅̅̅̅̅̅̅̅
𝐴̅. 𝐵̅. 𝐶 . ̅̅̅̅̅̅̅̅
𝐴̅. 𝐵. 𝐶 . ̅̅̅̅̅̅̅̅
𝐴. 𝐵̅. 𝐶
= (𝐴 + 𝐵 + 𝐶̅ ).( 𝐴 + 𝐵̅ + 𝐶̅ ).( 𝐴̅ + 𝐵 + 𝐶̅ )
= FC2 (F)
nd
6.2.2. The Standard POS Form (2 canonical form)
The decimal form of the conjunctive canonical form FD 2 produces decimal numbers equivalent to
the Maxterms of the function for which the output is equal to 0. The variable is represented by 0 and
the complemented variable is represented by 1.
- The maxterm 𝐴̅ + 𝐵 + 𝐶 is represented by (100)2 = (4)10
As stated in the following steps, a nonstandard POS expression is converted into standard form using
Boolean algebra rule (𝐴 . 𝐴̅ = 0) : A variable multiplied by its complement equals 0.
Step 1: Add to each nonstandard product term a term made up of the product of the missing variable
and its complement. This results in two sum terms. As you know, you can add 0 to anything without
changing its value.
Step 2: Apply rule: A + BC = (A + B)(A + C)
Step 3: Repeat Step 1 until all resulting sum terms contain all variables in the domain in either comple-
mented or uncomplemented form.
Example: Given the function 𝐹(𝐴, 𝐵, 𝐶) = (𝐴̅ + 𝐵 + 𝐶̅ ). (𝐴 + 𝐵). 𝐵̅ convert the standard POS.
F=(𝐴̅ + 𝐵 + 𝐶̅ ). (𝐴 + 𝐵). 𝐵̅
=(𝐴̅ + 𝐵 + 𝐶̅ ). (𝐴 + 𝐵 + (𝐶. 𝐶̅ )). (𝐵̅ + (𝐴. 𝐴̅) + (𝐶. 𝐶̅ ) )
=(𝐴̅ + 𝐵 + 𝐶̅ ). ((𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶̅ )). ((𝐵̅ + 𝐴). (𝐵̅ + 𝐴̅)) + (𝐶. 𝐶̅ ) )
18
Chapter 3 Boolean Algebra
𝐹𝐶2 = (𝐴̅ + 𝐵 + 𝐶̅ ). ((𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵 + 𝐶̅ )). ((𝐵̅ + 𝐴 + 𝐶). (𝐵̅ + 𝐴 + 𝐶̅ ). (𝐵̅ + 𝐴̅ + 𝐶). (𝐵̅ + 𝐴̅
+ 𝐶̅ ))
7. General examples that combines everything:
Example 1: Assume the following function F(A, B, C) represented by the truth table below: Write the
FC1, FC2, FD1, FD2
Solution:
A B C F minterms maxterms
0 0 0 0 0 𝐴+𝐵+𝐶
1 0 0 1 0 𝐴 + 𝐵 + 𝐶̅
2 0 1 0 1 ̅𝐴. 𝐵. 𝐶̅
3 0 1 1 0 𝐴 + 𝐵̅ + 𝐶̅
4 1 0 0 1 ̅ 𝐶̅
𝐴. 𝐵.
5 1 0 1 0 𝐴̅ + 𝐵 + 𝐶̅
6 1 1 0 0 𝐴̅ + 𝐵̅ + 𝐶
7 1 1 1 1 𝐴. 𝐵. 𝐶
✓ To write the FC1, we first write the minterms from the truth table whenever the output is 1.
- They are all presented in the table below. The FC1 is the sum of these minterms.
- The minterms correspond to binary representations of (010, 100, 111).
𝑭𝑪𝟏(𝑭) = ̅ ̅ + 𝑨. 𝑩.
𝑨. 𝑩. 𝑪 ̅𝑪 ̅ + 𝑨. 𝑩. 𝑪
- The FD1 is the decimal representation of the minterms:
𝑭𝑫𝟏 (𝑭) = ∑ (𝟐, 𝟒, 𝟕)
✓ To represent the FC2 by multiplying the maxterms from the truth table whenever the output
is 0.
- The maxterms are the binary representation of (000, 001, 011, 101, 110).
- Remember that in maxterms, the 0 correspond the variable and 1 corresponds to the comple-
mented variable.
̅ ). (𝑨 + 𝑩
𝑭𝑪𝟐 (𝑭) = ( 𝑨 + 𝑩 + 𝑪). (𝑨 + 𝑩 + 𝑪 ̅ ). (𝑨
̅ +𝑪 ̅+𝑩+𝑪
̅ ). (𝑨
̅+𝑩
̅ + 𝑪)
𝑭𝑫𝟐 = ∏(𝟎, 𝟏, 𝟑, 𝟓, 𝟔)
Example 2: given the function F(A, B, C) = ̅𝐴. 𝐵. 𝐶 + 𝐴. 𝐶 + 𝐴. 𝐵̅. 𝐶 + 𝐴̅. 𝐵̅ . Write the canonical forms
of the function.
Solution:
19
Chapter 3 Boolean Algebra
It can be noticed that function is given in a form that is similar to SOP, where the first term is a
minterm, and the third term is a minterm as well. The second and last product terms has to be put in
a minterm form.
1. So: we multiply the second term ̅𝐴. 𝐶 by the missing the variable and its complement (𝐵 +
𝐵̅) to get ̅𝐴. 𝐵. 𝐶 + ̅𝐴. 𝐵̅. 𝐶
2. We also multiply the last term 𝐴̅. 𝐵̅ by (𝐶 + 𝐶̅ ) to get 𝐴̅. 𝐵̅. 𝐶 +𝐴̅. 𝐵̅. 𝐶̅
The function as sum of minterms is: ̅𝐴. 𝐵. 𝐶 + 𝐴. 𝐵. 𝐶 + 𝐴. 𝐵̅. 𝐶+ 𝐴. 𝐵̅. 𝐶 + 𝐴̅. 𝐵̅. 𝐶 +𝐴̅. 𝐵̅. 𝐶̅
And this is our FC1 (standard sum of products). Notice that the third and fourth terms are repeated,
so we remove one of them to get :
𝑭𝑪𝟏(𝑭) = ̅ ̅. 𝑩
̅. 𝑪 + 𝑨
𝑨. 𝑩. 𝑪 + 𝑨. 𝑩. 𝑪 + 𝑨. 𝑩 ̅. 𝑩
̅. 𝑪 + 𝑨 ̅
̅. 𝑪
These minterms correspond to the binary representation of : (011, 111, 101, 001, 000 )
So in this example, we found FC1 and FC2 without using a truth table.
Example 3: given the function 𝐹(𝐴, 𝐵, 𝐶) = (𝐵 + 𝐶). 𝐴. ( (𝐵̅ + 𝐶̅ )) find the canonical forms of this
function.
Solution: we notice that this function is in the form of product of sums. However, they are not in the
standard form.
1. The first term(𝐵 + 𝐶) is converted to a maxterm by adding (𝐴. 𝐴̅) to get: (𝐴 + 𝐵 + 𝐶). (𝐴̅ +
𝐵 + 𝐶)
̅̅̅̅ then
2. The second term A is converted to a maxterm by adding (𝐵. 𝐵̅ ) to get (𝐴 + 𝐵). (𝐴 + 𝐵)
by adding (𝐶. 𝐶̅ ) to get (𝐴 + 𝐵 + 𝐶). (𝐴 + 𝐵̅ + C). (𝐴 + 𝐵 + 𝐶̅ ). (𝐴 + 𝐵̅ + C̅)
3. The last term (𝐵̅ + 𝐶̅ ) is converted to a maxterm by adding (𝐴. 𝐴̅)to get (𝐴 + 𝐵̅ + 𝐶̅ ). (𝐴̅ +
𝐵̅ + 𝐶̅ )
̅ + 𝑩 + 𝑪). (𝑨 + 𝑩
𝑭𝑪𝟐 (𝑭) =∶ (𝑨 + 𝑩 + 𝑪). (𝑨 ̅ ). (𝑨 + 𝑩
̅ + 𝑪). (𝑨 + 𝑩 + 𝑪 ̅ ). (𝑨
̅ +𝑪 ̅+𝑩 ̅)
̅ +𝑪
It corresponds to the binary representation of (000, 100,010, 001, 011, 111) after removing the re-
peated terms
So, the 𝑭𝑫𝟐 (𝑭) = ∏(𝟎, 𝟏, 𝟐, 𝟑, 𝟒, 𝟕)
And the FD1(F) = ∑ (5,6) which are the terms that didn’t appear in the FC2.
̅
̅ . 𝑪 + 𝑨. 𝑩. 𝑪
𝑭𝑪𝟏(𝑭) = 𝑨. 𝑩
Remember that:
✓ All truth table entries that are not minterms, they are for sure maxterms
20
Chapter 3 Boolean Algebra
✓ We can determine the FC2 from the FC1 by determining which truth table entries are not there
and writing their corresponding maxterms and vice versa.
Standard Forms of Boolean Expressions
As we said before that there are two different ways to simplify logic circuits. The first way is based on
the application of the theorems of Boolean algebra which is thoroughly discussed in previous section.
In the following section, we will explore the other method (Karnaugh maps), which, on the contrary,
follows a systematic approach.
The number of cells in a Karnaugh map, as well as the number of rows in a truth table, is equal to the
total number of possible input variable combinations.
The Karnaugh table, just like the truth table, is a tool that shows how input values connect to the
desired output.
A B
0 0
0 1 A B C B 0 1
A
B 00 01 11 10
A A
0 1 0 0 0 00 000 001
0 00 01 0 000 001 011 010
B 0 0 1
1 0
1 10 11 0 1 0 01 010 011 1 100 101 111 110
1 1
0 1 1
1 0 0 11 110 111
1 0 1
1 1 0 10 100 101
1 1 1
21
Chapter 3 Boolean Algebra
A B C D
0 0 0 0 CD 00 01 11 10
AB
0 0 0 1
0 0 1 0 00 0 1 3 2
0 0 1 1
01 4 5 7 6
0 1 0 0
0 1 0 1 11 12 13 15 14
0 1 1 0
0 1 1 1 10 8 9 11 10
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
The Karnaugh table is designed to ensure that only one variable changes between two neighboring
cells follows the gray code count. This will help in simplification later since there is one common vari-
able between each cell. and it can be taken out as a common factor and the remaining variable is
simplified since it is left along with its complement.
Adjacency boxes (cells ):Two boxes are said to be adjacent in the Karnaugh table if they correspond to
combinations differing by only one bit. Adjacency is defined by a single-variable change.
Examples of cells adjacent: the yellow boxes with red marked are adjacent to the green box that con-
tains the letter. The boxes in orange are not adjacent since there a two-variable change.
Cells are not adjacent to cells that diagonally touch any of their corners.
Cell adjacency in a 2,3,4 variables Karnaugh table:
Cell adjacency in a 2-variable Karnaugh table:
B 0 𝟏 B 0 𝟏 B 0 𝟏 B 0 𝟏
A A A
A
0 X 0 X 0 0
1 1 1 X 1 X
22
Chapter 3 Boolean Algebra
C 0 1 AB 00 01 11 10
AB C
00 X 0 X
01 1
11
10
C 0 1 AB 00 01 11 10
AB C
00 0 X
01 X 1
11
10
C 0 1 AB 00 01 11 10
AB C
00 0
01 1 X
11
10 X
00 01 11 10
00
01
11 X
10
Cells in the outer left column are adjacent to corresponding cells in the outer right column. The map
can be visualized as wrapping around from top to bottom or from left to right.
23
Chapter 3 Boolean Algebra
A B C 𝑿
00 01 11 10 0 0 0 0 1
1 0 0 1 0
0 1 1 1 2 0 1 0 1
0 1 3 2 3 0 1 1 1
1 1 1 4 1 0 0 0
4 5 7 6 5 1 0 1 0
6 1 1 0 1
7 1 1 1 1
24
Chapter 3 Boolean Algebra
A B C D 𝑿
0 0 0 0 0 0
1 0 0 0 1 0
2 0 0 1 0 0
00 01 11 10
3 0 0 1 1 0
4 0 1 0 0 0
00
5 0 1 0 1 0
0 1 3 2
6 0 1 1 0 0 01
7 0 1 1 1 0 4 5 7 6
8 1 0 0 0 0 11 1 1 1 1
9 1 0 0 1 0 12 13 15 14
10 1 0 1 0 0 10 1
11 1 0 1 1 1 8 9 11 10
12 1 1 0 0 1
13 1 1 0 1 1
14 1 1 1 0 1
15 1 1 1 1 1
25
Chapter 3 Boolean Algebra
0 1
1 1 1 1
The process that results in an expression containing the fewest possible terms with the fewest
possible variables is called minimization. After an SOP expression has been mapped, a minimum
SOP expression is obtained by grouping the 1s and determining the minimum SOP expression from
the map.
8.5.1. Grouping the 1s
You can group 1s on the Karnaugh map according to the following rules by enclosing those adjacent
cells containing 1s. The goal is to maximize the size of the groups and to minimize the number of
groups
1. A group must contain either 1, 2, 4, 8, or 16 cells, which are all powers of two.
2. Each cell in a group must be adjacent to one or more cells in that same group, but all cells
in the group do not have to be adjacent to each other.
3. Always include the largest possible number of 1s in a group
4. Each 1 on the map must be included in at least one group. The 1s already in a group can
be included in another group as long as the overlapping groups include noncommon 1s.
26
Chapter 3 Boolean Algebra
B 0 𝟏
A
0 1 𝑋𝑠 = 𝐵̅
1 1
For 3 inputs kmap: the 1st canonical form of 𝑋 = 𝐴̅𝐵̅𝐶 + 𝐴̅𝐵𝐶̅ + 𝐴̅𝐵𝐶 + 𝐴𝐵𝐶̅ + 𝐴𝐵𝐶
𝐵𝐶 00 01 11 10
A
𝑋𝑠 = 𝐵 + 𝐴̅𝐶̅
0 1 1 1
1 1 1
27
Chapter 3 Boolean Algebra
CD 00 01 11 10
AB
00
𝑋𝑆 = 𝐴𝐵 + 𝐴𝐶𝐷
0 1 3 2
01
4 5 7 6
11 1 1 1 1
12 13 15 14
10 1
8 9 11 10
The POS is much the same to SOP except that with POS expressions, 0s representing the standard sum
terms are placed on the Karnaugh map instead of 1s.
For a POS expression in standard form, a 0 is placed on the Karnaugh map for each sum term in the
expression. Each 0 is placed in a cell corresponding to the value of a sum term.
When a POS expression is completely mapped, there will be a number of 0s on the Karnaugh map
equal to the number of sum terms in the standard POS expression. The cells that do not have a 0 are
the cells for which the expression is 1. Usually, when working with POS expressions, the 1s are left off.
0 0
1 0 0
The process for minimizing a POS expression is basically the same as for an SOP expression except
that you group 0s to produce minimum sum terms
instead of grouping 1s to produce minimum CD 00 01 11 10 product
terms. The rules for grouping the 0s are the AB same as
those for grouping the 1s.
00 0 0 0 0
𝐵𝐶 00 01 11 10 0 1 3 2
A 01 0 0 0 0
4 5 6
0 0 7
11
1 0 0
12 13 15 14
10 0 0 0
𝑋𝑆 = (B + C̅) (𝐴̅ + 𝐵) 8 9 11 10
𝑋𝑆 = 𝐴 (𝐷 + 𝐵)( 𝐴̅ + 𝐵 + 𝐶)
Grouping the 1s yields an SOP expression that is equivalent to grouping the 0s.
28