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 complements 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. 00 = 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 Morgans 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 YZ X+(YZ) 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 0s with 1s 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 XY. 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 XYZ 0 X+Y+Z 0
0 0 1 XYZ 1 X+Y+Z 1
0 1 0 XYZ 2 X+Y+Z 2
0 1 1 XYZ 3 X+Y+Z 3
1 0 0 XYZ 4 X+Y+Z 4
1 0 1 XYZ 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: Express2 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 its
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 its 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