You are on page 1of 34

Chapter 2

Boolean Algebra & Logic Gates

1
Chapter Outline
 Introduction
 Digital Logic Gates
 Other Logic Operators
 Logic levels and Digital signals
 Positive and Negative Logic
 Introduction to Boolean algebra
 Variables, literals and terms in Boolean expressions
 Dual of a Boolean expressions
 Postulates and Theorems of Boolean Algebra
 Venn Diagram
 Boolean Functions
 Simplification of Boolean Expressions
 Canonical and Standard forms of logic functions
2
Chapter 2: Boolean Algebra and Logic Gates
Introduction
 Boolean algebra is a mathematical model (system) that provides the basis for logic
operations. George Boole, an English mathematician, introduced this concept in
the study of mathematical theory of logic.
 Digital circuits contain hard ware element called “gates” that perform logic
operations.
Logic Gates
Basic logic gates
Boolean algebra uses three basic operations namely AND, OR, and NOT.
OR Gate: - the output of this gate will be "high" (1) if any of the inputs are "high" (1).
The output goes "low"(0) if and only if all inputs are "low" (0).
A B Y
0 0 0
0 1 1
1 0 1
3
1 1 1
Example: In figure below, what would the output pulse train
look like?

AND Gate: - have one or more input and one output. The output of this
gate will be "high" (1) if and only if all inputs are "high" (1). If any
input(s) are "low" (0), the output will be "low" (0).
A B Y
0 0 0
0 1 0
1 0 0
1 1 1 4
Example: In figure below, what would the output pulse train
look like‘?

NOT (inverter) Gate : - a urinary operator that complement’s a variable


and it is written as . The output of NOT gate is "high" if and only if the
input is "low"

X Y
0 1
1 0
5
Other Logic Operations
 The four other important logic operations are NOR, NAND,
Exclusive-OR (EX-OR), and Exclusive-NOR (EX-NOR).
NOR Gate (OR +NOT): - the output goes "low" (0) if any of the inputs are
made "high" (1). The output is "high" (1) only when all inputs are
"low" (0).

A B OR NOR
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0

6
NAND Gate: - it behaves the same as an AND gate with a NOT
(inverter) gate connected to the output terminal.

A B AND NAND
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0

7
Exclusive-OR (EX-OR) Gate: - the output is a "high" (1) logic level if the
inputs are at different logic levels, either 0 and 1 or 1 and 0. The output is
a "low" (0) logic level if the inputs are at the same logic levels. The
Exclusive-OR (sometimes called XOR) gate.
𝑌 =𝐴∙𝐵+𝐴∙𝐵 =𝐴⊕𝐵

A B Y
0 0 0
0 1 1
1 0 1
1 1 0

8
Exclusive-NOR (EX-NOR) Gate:-means NOT of EX-OR, i.e. the logic
gate that we get by complementing the output of an EX-OR gate.

A B EX-0R EX-NOR
0 0 0 1
0 1 1 0
1 0 1 0
1 1 0 1

9
Universal Gates
 OR, AND, and NOT gates are the three basic logic gates as they
together can be used to construct the logic circuit for any given
Boolean expression.
 NOR and NAND gates have the property that they individually can be
used to hardware-implement a logic circuit corresponding to any
given Boolean expression.
 That is, it is possible to use either only NAND gates or only NOR
gates to implement any Boolean expression. This is so because a
combination of NAND gates or a combination of NOR gates can be
used to perform functions of any of the basic logic gates. It is for this
reason that NAND and NOR gates are universal gates.

10
Universal Gates

Figure
Implementation of basic logic gates using only NAND gates.
11
Universal Gates

Figure
Implementation of basic logic gates using only NOR gates.
12
Logic Levels and Digital Signals

13
14
Positive and Negative Logic
 The binary variables, as we know, can have either of the two states,
i.e. the logic ‘0’ state or the logic ‘1’ state.
 These logic states in digital systems such as computers, for instance,
are represented by two different voltage levels or two different
current levels.
 If the more positive of the two voltage or current levels represents a
logic ‘1’ and the less positive of the two levels represents a logic ‘0’,
then the logic system is referred to as a positive logic system.
 If the more positive of the two voltage or current levels represents a
logic ‘0’ and the less positive of the two levels represents a logic ‘1’,
then the logic system is referred to as a negative logic system.

15
Boolean Algebra
 Boolean algebra is defined as an algebra manipulation based on
binary number system.
 Like any algebra, Boolean algebra is based on a set of rules that
derived from a small number of basic assumptions called Axioms.
Postulates and theorems of Boolean algebra
Assume that the following axioms are true.
1a. 0∙0 = 0 3a. 1 ∙ 1 = 1
1b. 0 + 0 = 0 3b. 1 + 1 = 1
2a. 0 ∙ 1 = 1 ∙ 0 = 0 4a. 𝐼𝑓 𝑥 = 0, 𝑡ℎ𝑒𝑛 𝑥 = 1
2b. 0 + 1 = 1 + 0 = 1 4b. 𝐼𝑓 𝑥 = 1, 𝑡ℎ𝑒𝑛 𝑥 = 0

16
Single variable theorem
From the axioms we can define some rules which are dealing
with a single variable. These rules are often called theorems. If 𝑥 is a
variable in B, then the following theorems hold true.

5a. 𝑥 ∙ 0 = 0 7a. 𝑥 ∙ 𝑥 = 𝑥 9. 𝑥 = 𝑥
5b. 𝑥 + 0 = 𝑥 7b. 𝑥 + 𝑥 = 𝑥
6a. 𝑥 ∙ 1 = 𝑥 8a. 𝑥 ∙ 𝑥 = 0
6b. 𝑥 + 1 = 1 8b.x + 𝑥 = 1

Note that it is easy to prove the validity of these theorems by


substituting the possible values of 𝑥. i.e. 0 or 1.

17
Two and three variables properties
Commutative

Associative

Distributive

Simplification

DE Morgan’s law

N: B: - theorems from 10a to 15b involve more than one variable and can
be proved by making truth table 18
For example, 12. 𝑏. 𝑋 + 𝑌 ∙ 𝑍 = (𝑋 + 𝑌) ∙ (𝑋 + 𝑍)

X Y Z Y∙Z X+(Y∙Z) X+Y X+Z (X+Y)∙(X+Z)


0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1

19
Variables, Literals and Terms in Boolean Expression
 Variablesare the different symbols in a Boolean expression. The
complement of a variable is not considered as a separate variable.
 Each occurrence of a variable or its complement is called a literal. For
two variables 𝑥 𝑎𝑛𝑑 𝑦, the literals are 𝑥, 𝑦, 𝑥 𝑎𝑛𝑑 𝑦.
 Example 1. 𝐴 + 𝐴 ∙ 𝐵 + 𝐴 ∙ 𝐶 + 𝐴 ∙ 𝐵 ∙ 𝐶
2. 𝑃 + 𝑄 ∙ 𝑅 + 𝑆 ∙ 𝑃 + 𝑄 + 𝑅
 In expressions (1) and (2) there are eight and seven literals
respectively.
 A Boolean function may contain several terms for example, ,
expressions(3) consists Six terms , which are inputs to OR gate. Each
term may include a single or multiple variables which may or may not
be complemented.
 Example:
3. 𝐹 = 𝐴 + 𝐴 ∙ 𝐵′ + 𝐴 ∙ 𝐵′ ∙ 𝐶 + 𝐴′ ∙ 𝐵 ∙ 𝐶′ + 𝐴 ∙ 𝐵 ∙ 𝐶 + 𝐴′ ∙ 𝐵′ ∙ 𝐶′
20
Duality principle of Boolean Algebra
Duality principle states that a Boolean function remains valid if we take
the dual of the expressions on both sides of the equal sign. Dual can be
found by interchanging the (+) operator with (∙) operator and vice versa
and by replacing all 0’s with 1’s and vice versa.

For example, 𝑓 = 𝑦 + 𝑥 𝑦 = 𝑦 ∙ 1 ∙ 𝑥 = 𝑦

Then the dual f, 𝑓𝐷


𝑓𝐷 = 𝑦 ∙ 𝑥 + 𝑦 = 𝑦 ∙ 𝑥 + 𝑦 + 𝑦 = 𝑦 ∙ 𝑥 + 𝑦 = 𝑦 ∙ 𝑥 ∙ 1 = 𝑦
Hence, 𝑓 = 𝑓𝐷

21
Venn Diagram
 A helpful illustration that may be used to realize the relation among the variables
of a Boolean expression is called Venn diagram.
 This diagram consist overlapping circles inside a rectangle as shown in the figure
below.
Venn diagram for two variables
 Each circle labeled by a variable. We designate all points inside a circle as belonging
to the named variable and all points outside a circle are not belonging to the
variable. For example, take the circle labeled x. if we are inside the circle, we say
that x = 1; when outside, we say x = 0. Now, with two overlapping circles, there are
four distinct areas inside the rectangle: these are

X'Y' = the area not belonging to either X or Y.


X'Y =the area inside a circle Y but outside X.
XY' = the area inside a circle X but outside Y.
XY = the area inside both circles.

22
Simplification using Boolean Algebra
Example: - Simplify the following expression using Boolean algebra

1. 𝐴 ∙ 𝐵 + 𝐴 ∙ 𝐵 + 𝐶 + 𝐵 ∙ (𝐵 + 𝐶)
2. (𝐴 ∙ 𝐵 + 𝐴 ∙ 𝐶)′ + 𝐴′ ∙ 𝐵′ ∙ 𝐶
3. 𝐴 ∙ 𝐵′ + 𝐶 + 𝐵 ∙ 𝐷 + 𝐴′ ∙ 𝐵′ ∙ 𝐶
4. 𝐴 ∙ 𝐵 + 𝐶 ∙ 𝐷) ∙ (𝐴′ + 𝐵′ ) ∙ (𝐶 ′ + 𝐷′

23
Canonical and Standard forms for logic functions

Canonical form
 Consider two variables X and Y combined with an AND operation.
There are four possible combinations: XY, X ′ Y, XY ′ , and X′Y′. This is
called minterm or a standard product.
 The variable is primed if the corresponding bit of binary number is 0.

 In a similar fashion, n variables forming an OR term, with each


variable primed or unprimed provide 2nd possible combinations called
maxtermsor a standard sums.
 The variable is unprimed if the corresponding bit is 0 and primed if it
is 1.

24
Minterms and Maxterms for 3 binary variables
Variables Minterms Maxterms
X Y Z Terms Designation Terms Designation
0 0 0 X’Y’Z’ 𝑚0 X+Y+Z 𝑀0
0 0 1 X’Y’Z 𝑚1 X+Y+Z’ 𝑀1
0 1 0 X’YZ’ 𝑚2 X+Y’+Z 𝑀2
0 1 1 X’YZ 𝑚3 X+Y’+Z’ 𝑀3
1 0 0 XY’Z’ 𝑚4 X’+Y+Z 𝑀4
1 0 1 XY’Z 𝑚5 X’+Y+Z’ 𝑀5
1 1 0 XYZ’ 𝑚6 X’+Y’+Z 𝑀6
1 1 1 XYZ 𝑚7 X’+Y’+Z’ 𝑀7

N: B each maxterm is the complement of its corresponding minterm


and vice versa.
25
 A Boolean function may be expressed algebraically from a given truth table. Form
minterm by forming a minterm for each combination of variables that produces a 1
in a function and then taking the OR of all those terms.
 For example: - function of 3 variables.
X Y Z Function 𝒇𝟏 Function 𝒇𝟐
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
𝑓1 = 𝑋 ′ 𝑌 ′ 𝑍 + 𝑋𝑌 ′ 𝑍 ′ + 𝑋𝑌𝑍 = 𝑚1 + 𝑚4 + 𝑚7 = 𝑚(1, 4, 7)
Similarly
𝑓2 = 𝑋 ′ 𝑌𝑍 + 𝑋𝑌 ′ 𝑍 + 𝑋𝑌𝑍 ′ + 𝑋𝑌𝑍 = 𝑚3 + 𝑚5 + 𝑚6 + 𝑚7 = 𝑚(3, 5, 6, 7)
26
This shows a Boolean function can be expressed as a sum of minterms.
 Now consider the complement of the Boolean function
𝑓1′ = 𝑋 ′ 𝑌 ′ 𝑍 ′ + 𝑋 ′ 𝑌𝑍 ′ + 𝑋 ′ 𝑌𝑍 + 𝑋𝑌 ′ 𝑍 + 𝑋𝑌𝑍′
 If we take the complement of 𝑓1′ , we obtain 𝑓1
𝑓1 = 𝑋 + 𝑌 + 𝑍 𝑋 + 𝑌 ′ + 𝑍 𝑋 + 𝑌 ′ + 𝑍 ′ 𝑋 ′ + 𝑌 + 𝑍 ′ 𝑋 ′ + 𝑌 ′ + 𝑍
𝑓1 = 𝑀0 𝑀2 𝑀3 𝑀5 𝑀6
𝑓1 = 𝑀(0, 2, 3, 5, 6)

 It shows that any Boolean function can be expressed as a product of


maxterms.
 Boolean functions expressed as a sum of minterms or product of
maxterms are said to be in canonical form.
 Similarly, it is possible to read for 𝑓2 from the truth table.
Exercise: Express𝑓2 interms of minterm and maxterm?

27
Standard forms
 It is another way of expressing a Boolean function. These are two
types of standards.
1. Sum of product (SOP)
2. Product of sum (POS)
 Sum of product is a Boolean function (expression) containing AND
terms, called product terms of one or more literals each. The sum
denotes the ORing of these terms.
Example: 𝐹1 = 𝑌 ′ + 𝑋𝑌 + 𝑋′𝑌𝑍′

 A product of sum is a Boolean expression containing OR terms,


called sum terms. Each term may have any number of literals. The
product denotes the ANDing of these terms.
Example: 𝐹1 = 𝑋 𝑌 ′ + 𝑍 (𝑋 ′ + 𝑌 + 𝑍 ′ + 𝑊)

28
Standard SOP and POS
 SOP form can be converted to standard SOP by ANDing the terms in
the expression with terms formed by ORing the variable and it’s
complement which are not present in that term.
 Similarly, POS form can be converted to standard POS by ORing the
terms in the expression with terms formed by ANDing the variable
and it’s complement which are not present in that term.

Example:
i. convert 𝑌(𝑥1 , 𝑥2 , 𝑥3 ) = 𝑥1 𝑥2 + 𝑥1 𝑥3 + 𝑥2 𝑥3 into standard SOP
ii. convert 𝑌 𝑥1 , 𝑥2 , 𝑥3 = (𝑥1 +𝑥2 ) 𝑥1 + 𝑥3 (𝑥2 + 𝑥3 )into standard POS

29
AND Gate

30
OR Gate

31
NOT Gate

32
NAND Gate

33
NOR Gate

34

You might also like