Top Banner
Lecture 7 Topics Boolean Algebra 1
25

Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Dec 30, 2015

Download

Documents

Marian Jones
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Lecture 7

• Topics– Boolean Algebra

1

Page 2: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Logic and Bits Operation

• Computers represent information by bit• A bit has two possible values, namely zero

and one. • A bit can be used to represent a truth value,

since there are two truth values, true and false.

• Bits operations correspond to the logical operations in Boolean Algebra.

2

Page 3: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Boolean Variables & Boolean Operators

• Boolean variables are variables that can take only binary values: 0 or 1, false or true– A,B,C = {0, 1}

• Boolean Operators– AND (A AND B, AB, A ∧ B)– OR (A OR B, A+B, A ∨ B)– NOT (NOT A, A')

3

Page 4: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Boolean Algebra

• 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.”

• Boolean expressions are created by performing Boolean operations on Boolean variables.– Common Boolean operators include AND, OR, and NOT.

4

Page 5: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

5

• A Boolean operator can be completely described using a truth table.

• The AND operator is also known as a Boolean product. The OR operator is the Boolean sum.

Truth Table of Boolean Operators

Page 6: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Boolean Function• A function is a relation that uniquely associates members of

one set with members of another set• A Boolean function :

• has at least one Boolean variable, • has least one Boolean operator, and • yield a result, based on input values, in the set {0,1}.

• Example: • Truth table can be used to represent a Boolean function.

6

• To make evaluation of the Boolean function easier, the truth table contains extra (shaded) columns to hold evaluations of subparts of the function.

Page 7: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

7

Order of Boolean Operations

• There might be many Boolean operators in one Boolean function. Which operator to apply first?

• Order of Boolean Operations: NOT > AND > OR

Page 8: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

In Class Exercise

Construct a Truth Table for

8

Page 9: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

9

Boolean Identities: Simplify a Boolean Function

• Digital computers contain circuits that implement Boolean functions.

• The simpler that we can make a Boolean function, the smaller the circuit that will result.– Simpler circuits are cheaper to build, consume less

power, and run faster than complex circuits.• With this in mind, we always want to reduce our

Boolean functions to their simplest form.• There are a number of Boolean identities that help us to

simplify a Boolean function.

Page 10: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

10

Boolean Identities

Page 11: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

How to prove these identities

• All of the above identities can be proved using truth tables .

• To do this, you use truth tables to show all of the possible values of both sides of the equation.

• If they are identical, then the identity is true.

11

Page 12: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Proving the AND Form of DeMorgan’s Law

12

Page 13: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Simplification of Boolean Expressions

Example 3.3 Simplify the function:

Solution:

(De Morgan’s)

(Commutative)

(Associative)

(Inverse)

(Null)

13

Page 14: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Simplification of Boolean Expressions

Example 3.4 Simplify the function:

Solution:

(Inverse)

(Identity)

(DeMorgan’s)

(Distributive over AND)

(Inverse)

(Identity)

14

Page 15: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Simplification of Boolean Expressions

Example 3.5 Simplify the function:

Solution:

(Commutative)

) (Distributive over OR)

) (Inverse)

(Null)

(Identity)

15

Page 16: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

16

Example 3.6 Simplify the function:

Simplification of Boolean Expressions

𝐹 (𝑥 , 𝑦 , 𝑧)=𝑥𝑦+𝑥 ′ 𝑧+𝑦𝑧

Page 17: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Boolean Algebra Properties

Proof:

Page 18: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

In Class Exercise

Simplify the following functional expressions using Boolean algebra and its identities.

18

Page 19: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

19

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

the complement of a function than it is to implement the function directly.

• DeMorgan’s law provides an easy way of finding the complement of a Boolean function.

• Recall DeMorgan’s law states:

Page 20: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

20

Complements• Extending to DeMorgan’s law: Replace each

variable by its complement and change all ANDs to ORs and all ORs to ANDs.

• Thus, the complement of:

is:

Page 21: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

In Class Exercise

Using DeMorgan’s Law, write an expression for the complement of F if

21

Page 22: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Representing Boolean Functions• Many ways to represent a given Boolean function.

– Truth table– Boolean expressions: an infinite number of Boolean

expressions that are logically equivalent to one another.

• Two Boolean expressions that can be represented by the same truth table are considered logically equivalent.

• In order to eliminate confusion, designers express Boolean functions in standardized or canonical form.– The sum-of-products form: ANDed variables are ORed

together, e.g., .– The product-of-sums form: ORed variables are ANDed

together:

22

Page 23: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

23

Sum-of-Products Form • Any Boolean expression can be

represented in sum-of-products form.• It is easy to convert a truth table to

sum-of-products form: ORed together the values of the variables that result a true function value (1).

• Note that it is not in simplest terms.• Simplify the function and obtain

Page 24: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

In Class Exercise

The true table for a Boolean expression is shown below. Write the Boolean expression in sum-of-products form.

24

Page 25: Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.

Summary• Given a boolean function, construct it’s truth table.• Using truth table to prove a boolean equation is

valid or not.• Applying boolean algebra for boolean function

simplification.• Using DeMorgan’s Law, write an expression for

the complement.• Determine the boolean expression in sum-of-

products form.

25