You are on page 1of 36

Boolean Algebra and Logic gates

Objectives
• To study Boolean algebra
 Boolean Algebra: a useful mathematical system for
specifying and transforming logic functions.
 Boolean algebra as a foundation for designing and
analyzing digital systems
• To understand Boolean & DeMorgan’s Theorems

Source: Feleke Merin (Dr. –Eng.) 1


Introduction

George Boole (1815-1864)


• Born to working class parents

• Taught himself mathematics and


joined the faculty of Queen’s College
in Ireland.

• Wrote An Investigation of the Laws of


Thought (1854)

• Introduced binary variables

• Introduced the three fundamental


logic operations: AND, OR, and NOT.

Source: Feleke Merin (Dr. –Eng.) 2


Introduction(contd.)

• In the middle of the twentieth century, computers were


commonly known as “thinking machines” and “electronic
brains.”
– Many people were fearful of them.

• Nowadays, we rarely ponder the relationship between


electronic digital computers and human logic. Computers
are accepted as part of our lives.
– Many people, however, are still fearful of them.

Source: Feleke Merin (Dr. –Eng.) 3


Boolean Algebra

• Boolean Algebra named after George Boole who used it to


study human logical reasoning – calculus of proposition.

• Boolean algebra is a mathematical system for the


manipulation of variables that can have one of two values.
– In formal logic, these values are “true” and “false.”
– In digital systems, these values are “on” and “off,”
1 and 0, or “high” and “low.”

Source: Feleke Merin (Dr. –Eng.) 4


Boolean Algebra(contd.)

• Boolean Algebra
 A tool for the analysis and design of digital systems,
 Describes relationship between logic circuit’s inputs and
outputs,
 Used to help simplify a logic circuit.

Source: Feleke Merin (Dr. –Eng.) 5


Boolean Algebra(contd.)

• Digital computers contain circuits that implement Boolean


expressions (functions).
• Before building a circuit that realizes a Boolean expression,
we would like to simplify that expression as much as
possible.
• Fewer gates means
 Fewer transistors
 Less space required
 Less power required (less heat generated)
 More money made

Source: Feleke Merin (Dr. –Eng.) 6


Boolean Algebra(contd.)

• Boolean expressions are created by performing operations on


Boolean variables.
 Common Boolean operators include AND, OR, and NOT.
• Operations: a OR b; a AND b, NOT a
e.g. 0 OR 1 = 1 0 OR 0 = 0
1 AND 1 = 1 1 AND 0 = 0
NOT 0 = 1 NOT 1 = 0
• Logic level

 0 and 1 do not present actual numbers but instead represent the


state of a voltage variable

Source: Feleke Merin (Dr. –Eng.) 7


Boolean Algebra(contd.)

• Logical functions can be expressed in several ways:


 Truth table
 Logical expressions
 Graphical form

• You must know how to:


 Use a graphical representation to derive a logical expression.
 Use a graphical representation to derive a truth table.
 Use a logical expression to derive a graphical representation.
 Use a logical expression to derive a truth table.
 Use a truth tables to derive a logical expression (SOP & POS)

Source: Feleke Merin (Dr. –Eng.) 8


Boolean Algebra(contd.)

• An SOP expression  when • An POS expression  When


two or more product terms two or more sum terms are
are summed by Boolean multiplied by Boolean
addition. multiplication.
• In an SOP form, a single • In a POS form, a single
overbar cannot extend over overbar cannot extend over
more than one variable more than one variable
– Example – Example
A B CD  A B C D  AB C D ( A  B  C  D )( A  B  C  D )( A  B  C  D )

• But not – But not


( A  B  C  D )( A  B  C  D )( A  B  C  D )
A B CD  A B C D  AB C D

Source: Feleke Merin (Dr. –Eng.) 9


Boolean Algebra(contd.)

To determine the SOP expression represented by a truth


table.
• Instructions:
– Step 1: List the binary values of the input variables
for which the output is 1.
– Step 2: Convert each binary value to the
corresponding product term by replacing:
 each 1 with the corresponding variable, and
 each 0 with the corresponding variable
complement.

• Example: 1010  AB CD

Source: Feleke Merin (Dr. –Eng.) 10


Boolean Algebra(contd.)

To determine the POS expression represented by a truth table.


• Instructions:
– Step 1: List the binary values of the input variables for
which the output is 0.
– Step 2: Convert each binary value to the corresponding
product term by replacing:
 each 1 with the corresponding variable complement, and
 each 0 with the corresponding variable.

• Example: 1001  A  B  C  D

Source: Feleke Merin (Dr. –Eng.) 11


Boolean Algebra(contd.)

• A Boolean operator can be completely


described using a truth table.

• The truth table for the Boolean


operators AND and OR are shown at
the right.

• The AND operator is also known as a


Boolean product. The OR operator is
the Boolean sum.

Source: Feleke Merin (Dr. –Eng.) 12


Boolean Algebra(contd.)

• The truth table for the Boolean NOT


operator is shown at the right.

• The NOT operation is most often


designated by an overbar. It is
sometimes indicated by a prime mark (
‘ ) or an “elbow” ().

Source: Feleke Merin (Dr. –Eng.) 13


Boolean Algebra(contd.)

• As with common arithmetic,


Boolean operations have
rules of precedence.

• The NOT operator has


highest priority, followed by
AND and then OR.

Source: Feleke Merin (Dr. –Eng.) 14


Boolean Algebra(contd.)

• Develop a truth table Inputs Output Product


for the standard SOP A B C X Term
expression
0 0 0 0
0 0 1 1 ABC
A B C  AB C  ABC
0 1 0 0
0 1 1 0
1 0 0 1 AB C
1 0 1 0
1 1 0 0
1 1 1 1
ABC
Source: Feleke Merin (Dr. –Eng.) 15
Boolean Algebra(contd.)

• Develop a truth table Inputs Output Product


for the standard SOP A B C X Term
expression
0 0 0 0 ( A  B  C)

( A  B  C )( A  B  C )( A  B  C ) 0 0 1 1
( A  B  C )( A  B  C ) 0 1 0 0 ( A  B  C)
0 1 1 0 (A  B  C )
1 0 0 1
1 0 1 0
(A  B  C )
1 1 0 0
( A  B  C)
1 1 1 1

Source: Feleke Merin (Dr. –Eng.) 16


Boolean Algebra(contd.)

• Implementation of an SOP

AB  A B  AB

A
B

A
B

A
B

Source: Feleke Merin (Dr. –Eng.) 17


Boolean Algebra(contd.)

• Implementation of a POS
( A  B )( A  B )( A  B)

A
B
A
B

A
B

Source: Feleke Merin (Dr. –Eng.) 18


Boolean Algebra(contd.)

• Logical Expression Simplification using:


a) Boolean Algebra b) Karnaugh Map Method
• Need boolean identities • A K-map is a graphical method
(Laws) for simplifying Boolean
expressions and, if properly
• Start with an expression used, will produce the simplest
and apply Boolean laws (minimum) expression possible.
to derive the simplest
(minimum) expression • The size of k-map depends on
possible. the number of variables.

Source: Feleke Merin (Dr. –Eng.) 19


Boolean Algebra(contd.)

 Simplification using Boolean Algebra


• Most Boolean identities have an AND (product) form as
well as an OR (sum) form. We give our identities using
both forms. Our first group is rather intuitive:

Source: Feleke Merin (Dr. –Eng.) 20


Boolean Algebra(contd.)

• Our second group of Boolean identities should be familiar


to you from your study of algebra:

Source: Feleke Merin (Dr. –Eng.) 21


Boolean Algebra(contd.)

• Our last group of Boolean identities are perhaps the most


useful.

Source: Feleke Merin (Dr. –Eng.) 22


Boolean Algebra(contd.)

• We can use Boolean identities to simplify:

as follows:

Source: Feleke Merin (Dr. –Eng.) 23


DeMorgan’s Law

• Sometimes it is more economical to build a circuit using the


complement of a function (and complementing its result)
than it is to implement the function directly.
• DeMorgan’s law provides an easy way of finding the
complement of a Boolean function.
• DeMorgan’s law states:

A  B  A B

A B  A  B

Source: Feleke Merin (Dr. –Eng.) 24


DeMorgan’s Law (contd.)

My name is Augustus DeMorgan.


I’m an Englishman born in India
in 1806. I was instrumental in the
advancement of mathematics and
am best known for the logic
theorems that bear my name.

George Boolean gets WAY too


much credit. He has more
theorems, but mine are WAY
Cooler! Take a look at them.

Source: Feleke Merin (Dr. –Eng.) 25


DeMorgan’s Law (contd.)

• BREAK THE LINE, CHANGE THE SIGN


– Break the LINE over the two variables,
– and change the SIGN directly under the line.

A B  A  B Break the line, and change the AND


function to an OR function. Be sure to keep
the lines over the variables.

A  B  A B Break the line, and change the OR function


to an AND function. Be sure to keep the
lines over the variables.

Source: Feleke Merin (Dr. –Eng.) 26


DeMorgan’s Law (contd.)

• DeMorgan’s Theorem #1 A  B  A  B
Proof A B A B
A
A B A
A
A B B A B
B
B

A B A B A B A B A B A B
0 0 0 1 0 0 1 1 1
0 1 0 1 0 1 1 0 1
1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 0 0 0

The truth-tables are equal; therefore, the


Boolean equations must be equal.

Source: Feleke Merin (Dr. –Eng.) 27


DeMorgan’s Law (contd.)

• DeMorgan’s Theorem #2 A  B  A  B
Proof A  B A B
A
A A B
A B B
B B

A B A B A B A B A B A B
0 0 0 1 0 0 1 1 1
0 1 1 0 0 1 1 0 0
1 0 1 0 1 0 0 1 0
1 1 1 0 1 1 0 0 0

The truth-tables are equal; therefore, the


Boolean equations must be equal.

Source: Feleke Merin (Dr. –Eng.) 28


DeMorgan’s: Example #1

• Simplify the following Boolean expression and note the


Boolean or DeMorgan’s theorem used at each step. Put
the answer in SOP form (SOP: sum of product).

F1  ( X  Y)  ( Y  Z)
Solution F1  ( X  Y )  ( Y  Z )

F1  ( X  Y )  ( Y  Z )

F1  ( X  Y )  ( Y  Z )
F1  ( X  Y )  ( Y  Z )
F1  X Y  Y Z

Source: Feleke Merin (Dr. –Eng.) 29


DeMorgan’s: Example #2

• Simplify the output function F2. Be sure to note the Boolean or


DeMorgan’s theorem used at each step. Put the answer in SOP
form.
X XY XY
( X  Z)( XY)
Y
X
Z XZ
F2  (X  Z)(XY)

Source: Feleke Merin (Dr. –Eng.) 30


DeMorgan’s: Example #2 (contd.)

Solution
F 2  ( X  Z )( XY )

F 2  ( X  Z )  ( XY )

F 2  ( X  Z )  ( XY )

F 2  ( X Z )  ( XY )
F 2  ( X Z )  ( XY )
F2  X Z  X Y

Source: Feleke Merin (Dr. –Eng.) 31


DeMorgan’s: Examples (contd.)

Example:
Apply the DeMorgan's theorems to the expressions
ABCand A B C
Solution:

1-
ABC  A  B  C

2-
A  B  C  A B C

Source: Feleke Merin (Dr. –Eng.) 32


DeMorgan’s: Examples (contd.)

Example:
Apply the DeMorgan's theorems to the expressions
( AB  C )( A and
BC ) ( AB )C  A( BC )

Solution:

1- ( AB  C )( A  BC )  ( AB  C )  ( A  BC )

2-
( AB ) C  A ( BC )  ( A  B ) C  A ( B  C )

Source: Feleke Merin (Dr. –Eng.) 33


DeMorgan’s: Exercises

Apply DeMorgan's theorems to each of the following


expressions:

(a) (A  B  C )D

(b) ABC  DEF

(c)
A B  C D  EF

Source: Feleke Merin (Dr. –Eng.) 34


Boolean Exercises

• Simplify the following Boolean functions by applying


Boolean rules.

A BC  A B C  A B C  A B C  ABC

Source: Feleke Merin (Dr. –Eng.) 35


Boolean Exercises (contd.)

Prove the following identities using Boolean algebra and


truth tables:
1. X  XY  X 2. X(X + Y)  X

3. XY  XY  X 4. (X + Y)(X + Y)  X

5. XY  XZ + YZ = XY + XZ 6. (X +Y)(X  Z )(Y  Z )  ( X +Y)(X  Z )

7. AB + A B + A B  1 8. XYZ  X + Y + Z

9. A B  AB  AB  A B 10. AB  A B  A B  AB

------------------The End! ----------------

Source: Feleke Merin (Dr. –Eng.) 36

You might also like