69
Boolean Algebra Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Embed Size (px)

Citation preview

Page 1: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Boolean Algebra

Presented by:Ms. Maria Estrellita D. Hechanova, ECE

Page 2: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Objectives of this Course Define Boolean algebra Identify axioms, theorems, corollaries, and laws

pertaining to the manipulation of Boolean expressions

Compute and manipulate or simplify given Boolean expressions

Properly use Karnaugh Map (K-map) in simplification of Boolean expressions

Relate this lesson to existing applications in computer

Simplify digital circuits

Page 3: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Contents Introduction to Boolean Algebra Basic Definitions and Axioms in Boolean Algebra Basic Theorems Product-of-sums and Sum-of-products Minimal Boolean Expressions and Prime Implicants Applications and other means of simplification:

Logic gate and circuits Truth tables and Boolean functions Karnaugh map (K-map)

Page 4: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Have you ever wondered...

How can we communicate with our computers or laptops?

How is it possible that my SMS from my mobile phone be sent hundreds of miles from my location?

How does televisions be able to project images on a screen?

Why does robots be able to do specific (and even complicated) tasks?

Page 5: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

An introduction

A statement is true if it agrees with reality, false if it doesn’t.

Two-state logic assumes that each statement is either true or false.

The Greeks, especially Aristotle, worked out the theory of two-state logic in great detail.

In 1854, George Boole came up with symbolic logic, better known as the Boolean Algebra.

Page 6: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

An introduction Boolean algebra uses letters and symbols to

represent statements and their logical connections.

Each variable in Boolean algebra has either of two values: true or false. (this is why it is called a two-state or binary algebra)

Boolean algebra was a far-out subject until 1938, when Claude Shannon used it to analyze and design telephone switching circuits.

“He let the variables represents closed and open relays.

Page 7: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

An introduction

Boolean algebra has become one of the major design tools of digital and computer electronics.

LOGIC CIRCUITS!!!

Page 8: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

When to use Boolean Algebra?

At least one (1) or more inputs of either logic 1 (true) or logic 0 (false) and a single desired output (either a 1 or a 0, depending on the inputs)Examples:1. F = a+b2. F = a*b3. F = (a+b)*c’4. F = abc’+(bd)’+ab+a’cdNote that inputs a, b, c, and d should have a value either a

logic 1 or logic 0 and the output F should acquire a value either 1 and 0.

Page 9: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Axioms in Boolean Algebra

• a+b = b+a• a*b = b*a

• a+(b*c) = (a+b)*(a+c)• a*(b+c) = (a*b)+

(a*c)

• a+0 = a• a*1 = a

• a+a’ = 1• a*a’ = 0

Commutative Law

Distributive Law

Identity Law

Complement Law

Page 10: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

To give us a clearer view...

Let a be the values on the column side and b be the values on the row side.

+ Column

Row

0

0

1

1

0 1

1 1

Page 11: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

What is the output if we have *?

Let a be the values on the column side and b be the values on the row side.

* 0

0

1

1

0 0

0 1

Page 12: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

What is the result of the unary operation?

Simply change the input 0 to an output of 1 and the input 1 to an output 0!!

‘ 0 1

1 0

Page 13: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Base on the outputs of the truth tables, what did you notice?

+

*

or

and

not

Page 14: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Duality

The dual of any statement in a Boolean algebra B is the statement obtained in interchanging the operations + and *, and interchanging their identity elements 0 and 1 in the original statement.

Example: The dual of (1+a) * (b+0) = b is...

Theorem 1. Principle of Duality

(0*a) + (b*1) = b

Page 15: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Basic Theorems

Theorem 2: Idempotent Laws:a+a = a a*a = a

Theorem 3: Boundedness Laws:a+1 = 1 a*0 = 0

Theorem 4: Absorption Laws:a+(a*b) = a a*(a+b) = a

Theorem 5: Associative Laws:(a+b)+c = a+(b+c)(a*b)*c = a*(b*c)

Page 16: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Other special theorems

Let a be any element of a Boolean algebra B.Theorem 6: Uniqueness of compliment:

If a+x = 1 and a*x = 0, then x = a’Theorem 7: Involution Law:

(a’)’ = aTheorem 8: *Inversion Law:

0’ = 1 1’ = 0Theorem 9: DeMorgan’s Laws:

(a+b)’ = a’ * b’ (a*b)’ = a’ + b’

Page 17: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Boolean Algebra as Lattices

By the basic theorems and the commutative axiom, every Boolean algebra B satisfies the associative, commutative, and absorption laws and hence is a lattice where + and * are the join and meet operations, respectively.

With respect to this, a+1 = 1 implies a ≤ 1 and a*0 = 0 implies 0 ≤ a, for any element a Є B. Thus B is a bounded lattice.

Distributive and complement axioms show that B is also distributive and complemented.

Page 18: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Boolean Algebra as Lattices

So, we could say that, every bounded, distributive, and complemented lattice L satisfies the four (4) axioms.

Alternative Definition:A Boolean algebra B is a bounded,

distributive, and complemented lattice.

Page 19: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Boolean Algebra as Lattices

Since Boolean algebra is a lattice, it has a natural partial ordering.

In the discussion of ordered sets and lattices, it was defined that a≤b if the equivalent conditions a+b = b and a*b = a are satisfied.

Page 20: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Boolean Algebra as Lattices

The following are equivalent in Boolean algebra:

a+b = ba*b = a

a’+b = 1a*b’ = 0

Therefore, in a Boolean algebra, we can define a≤b if all of the above conditions is known to

be true.

Page 21: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Representation Theorem

Let B be a finite Boolean algebra. From the discussion of bounded lattices, an element a in B is an atom if a immediately succeeds 0, that is if 0<<a. Let A be the set of atoms of B and let P(A) be the Boolean algebra of all subsets of the set A of atoms. By theorem 14.8 in distributed lattices, Let L be a finite distributive lattice. Then every a in L can be written uniquely (except for order) as the join of irredundant join irreducible elements, each x≠0 can be expressed uniquely (except for order) as the sum (join) of atoms, i.e., elements of A.

Page 22: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Representation Theorem

Say,x = a1 + a2 + ... + ar

is such a representation.

Consider the function f: B P(A) defined byf(x) = {a1 , a2 , ... , ar}

The mapping is well defined since the representation is

unique.

Page 23: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Representation Theorem

Theorem 10: The above mapping f: B P(A) is an isomorphism.

Thus we see the intimate relationship between the set theory and abstract Boolean algebra in the sense that every finite Boolean algebra is structurally the same as a Boolean algebra of sets.

If a set A has n elements, then its power set P(A) has 2n elements.

Corollary 1: A finite Boolean algebra has 2n elements for some positive integer n.

Page 24: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Sum-of-Products Form for Sets

E will represent some area in the figure and hence will uniquely equal the union of one or more of the eight sets.

Let’s interpret union as a sum and an intersection as a product. Therefore, the eight sets are products, and the unique representation of E will be the sum (union) of products.

Page 25: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Sum-of-Products Form in Boolean Algebra

Boolean expression E is any variable or any expression built up from the variables using the Boolean operations. Naturally, the expression E must be well-formed, that is, where + and * are used as binary operations, and ‘ is used as a unary operation.

Literal is a variable or complemented variable, such as x, x’, y, y’, and so on.

Fundamental product is a literal or a product of two or more literals in which no two literals involve the same variable.

Page 26: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Sum-of-Products Form in Boolean Algebra

Note that, any product of literals can be reduced to either 0 or a fundamental product.

A fundamental product P1 is said to be contained in (or included in) another fundamental product P2 if the literals of P1 are also literals of P2.

Page 27: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Sum-of-Products Form in Boolean Algebra

Definition:A Boolean expression E is called a sum-of-products expression if E is a fundamental product or the sum of two or more fundamental products none of which is contained in another.

Definition:Let E be any Boolean expression. A sum-of-products form of E is an equivalent Boolean sum-of-products expression.

Page 28: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Sum-of-Products Form in Boolean Algebra

Consider the expressionsE1 = xz’ + y’z + xyz’ and E2 = xz’ + x’yz’ +

xy’z!!

E1 = xz’ + y’z + xyz’

E1 = xz’ + xyz’ + y’z

by absorption law, a + ab = a,E1 = xz’ +y’z

Page 29: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Algorithm for Finding SOP Forms

Algorithm 1A: The input is a Boolean expression E. The output is a sum-of-products expression equivalent to E.

1. Use DeMorgan’s law and involution to move the complement operation into any parenthesis until finally the complement operation only applies to variables. Then E will consists only of sum of products of literals.

2. Use the distributive operation to next transform E into a sum of products.

Page 30: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Algorithm for Finding SOP Forms

3. Use the commutative, idempotent, and complement laws to transform each product in E into 0 or a fundamental product.

4. Use the absorption and identity laws to finally transform E into a sum-of-products expression.

Page 31: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Let’s try to simplify this expression...

E = ((xy)’z)’((x’+z)(y’+z’))’

Answer:E = xyz +xz’

Page 32: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Complete Sum-of-Products Forms

A Boolean expression E = E(x1, x2, ... , xn) is said to be a complete sum-of-products expression if E is a sum-of-products expression where each product P involves all the n variables. Such a fundamental product P which involves all the variables is called a minterm, and there is a maximum of 2n such products of n variables.

Theorem 11: Every nonzero Boolean expression E=E(x1, x2, ... , xn) is equivalent to a complete sum-of-products expression and such a representation is unique. This is called the complete sum-of-product form of E.

Page 33: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Algorithm to transform SOP to complete SOP form

Algorithm 1B: The input is a Boolean sum-of-products expression E=E(x1, x2, ..., xn). The output is a complete sum-of-products expression equivalent to E.

1. Find a product P in E which does not involve the variable xi, and then multiply P by xi+xi’, deleting any repeated products.

2. Repeat step 1 until every product P in E is a minterm, i.e., every product P involves all the variables.

Page 34: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Let’s get the complete sum-of-product form of this expression...

E(x,y,z) = x(y’z)’

Answer:E = xyz + xyz’ + xy’z’

Page 35: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Other terminologies

Sum-of-product form = Disjunctive normal form (DNF)

Complete sum-of-product form = Full disjunctive normal form = Disjunctive canonical form = Minterm canonical form

Page 36: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Minimal Boolean Expression and Prime Implicants

Minimal Sum-of-Products Prime Implicants Consensus of Fundamental Products Consensus Method of Finding Prime

Implicants Finding a Minimal Sum-of-Products Form

Page 37: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Minimal Sum-of-Products Consider a Boolean sum-of-products

expression E. Let EL denote the number of literals in E (counted according to multiplicity), and let ES denote the number of summands in E.

Example:E = xyz’ + x’y’t + xy’z’t +x’yzt

EL = 3 + 3 + 4 + 4 = 14

ES = 4

Page 38: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Minimal Sum-of-Products Assuming that E and F are equivalent Boolean

sum-of-products expression, E is simpler than F if:

EL < FL and ES ≤ FL

EL ≤ FL and ES < FL

E is minimal if there is no equivalent sum-of-products expression which is simpler than E. Note that there can be more than one equivalent minimal sum-of-products expressions.

Page 39: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Prime Implicants

A fundamental product P is called prime implicant of a Boolean expression E if,

P + E = Ebut no other fundamental product contained in P has this property.

Example:E = xy’ + xyz’ + x’yz’

Therefore, xz’ is a prime implicant of E.

Page 40: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Prime Implicants

Theorem 12: A minimal sum-of-products form of a Boolean expression E is a sum of prime implicants of E.

(The following topics discuss on the methods of finding the prime implicants of E based on the notion of the consensus of fundamental products. This method can be used to find the minimal sum-of-products form for E. Geometric methods for finding prime implicants will also be discussed later...)

Page 41: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Consensus of Fundamental Products

Let P1 and P2 be fundamental products such that exactly one variable, xk, appears uncomplemented in one of the fundamental products and complemented in the other. Then the consensus of P1 and P2 is the product (without repetitions) of the literals of P1 and the literals of P2 after xk and xk’ are deleted. Note that, it is not proper to define the consensus of P1 = x and P2 = x’.

Lemma 1: Suppose Q is the consensus of P1 and P2. Then P1 + P2 + Q = P1 + P2.

Page 42: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Consensus of Fundamental Products

Example: Find the consensus Q of P1 and P2.

P1 = xyz’s and P2 = xy’t

Q = xz’s * xtQ = xz’st

P1 = xy’ and P2 = y

Q = x * 1Q = x

Page 43: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Consensus Method for Finding Prime Implicants

Algorithm 2A (Consensus Method): The input is a Boolean expression E = P1 + P2 + ... + Pm where the Ps are fundamental products. The output expresses E as a sum of its prime implicants (Theorem 13).

1. Delete any fundamental product Pi which includes any other fundamental product Pj. (Permissible by the absorption law)

2. Add the consensus of any Pi and Pj providing Q does not include any of the Ps. (Permissible by Lemma 1)

3. Repeat 1 and/or 2 until neither can be applied.

Page 44: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Consensus Method for Finding Prime Implicants

Theorem 13: The consensus method will eventually stop, and then E will be the sum of its prime implicants.

Example: E = xyz + x’z’ + xyz’ + x’y’z + x’yz’

Answer: E = x’z’ + xy + x’y’ + yz’

Therefore E is a sum of prime implicants, that is,x’z’ + xy + x’y’ + yz’

Page 45: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Finding a Minimal Sum-of-Products Form

Algorithm 2B: The input is a Boolean expression E = P1 + P2 + ... + Pm where the Ps are all the prime implicants of E. The output expresses E as a minimal sum-of-products.

1. Express each prime implicant P as a complete sum-of-products.

2. Delete one by one those prime implicants whose summands appear among the summands of the remaining prime implicants.

Page 46: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Finding a Minimal Sum-of-Products Form

Example:

E = x’z’ + xy + x’y’ + yz’

Answer:E = xy + x’y’ + yz’

Page 47: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Now, it’s time for the application part of the

presentation... And at this point on, please bear with us because the discussion will be more technical...

(@v@)

Page 48: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Logic Gates and Circuits

Logic circuits (also known as logic networks) are structures which are built up from certain elementary circuits called logic gates.

Each logic circuit may be viewed as a machine L which contains one or more input devices and exactly one output device.

Each input device in L sends a signal, specifically a bit (binary digit), 0 or 1, to the circuit L, and L processes the set of bits to yield an output bit.

Page 49: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Block Diagram

Logic CircuitL

Inp

ut/

s

Ou

tpu

t

Page 50: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Logic Gates There are three basic logic gates:

OR gate Denoted by a plus sign (addition) The output of an OR gate is logic high (1) if at least one of

the inputs is logic high (1), else the output is logic low (0). AND gate

Denoted by an asterisk sign (multiplication) The output of an AND gate is logic high (1) if all of the inputs

are logic high (1), else the output is logic low (0). NOT gate

Denoted by the prime (or a bar on top of the variable) The output is logic high if the input is logic low and the output

is logic low if the input if logic high.

Page 51: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

OR Gate

If at least one of the inputs has a value of logic high (1) , the output is logic high (1). Else, the output is logic low (0)

Page 52: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

AND Gate

If all of the inputs has a value of logic high (1) , the output is logic high (1). Else, the output is logic low (0)

Page 53: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

NOT Gate

If the input is logic high (1), the output is logic low (0). And, vice versa.

Page 54: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Logic Circuit

Integration of AND, OR, and NOT gates.

Page 55: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Logic Circuits as Boolean Algebra

Since that the truth tables for the OR, AND, and NOT gates are respectively equal to the truth tables for the propositions disjunction, conjunction, and negation, the logic circuit satisfy the same laws as do propositions and hence form a Boolean algebra.

Theorem 14: Logic circuits form a Boolean algebra.

Accordingly, all terms used with Boolean algebra may be used with out logic circuits.

Page 56: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

AND-OR Circuits

This logic circuit corresponds to a Boolean sum-of-products.

Some of the inputs or their complement are fed into each AND gate.

The outputs of all the AND gates are fed into a single OR gate.

The output of the OR gate is the output of the circuit.

Page 57: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

NAND and NOR Gates

NAND Gate Equivalent to an AND gate followed by a

NOT gate. NOR Gate

Equivalent to an OR gate followed by a NOT gate

Page 58: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Truth Tables and Boolean Functions

2n possible input combinations, where n is the number of inputs of the circuit.

Example: Y = abc + ab’c + a’bn = 3 2n = 23 = 8 (there are 8 possible

combinations for the input)Y will be having 8 outputs based on the

combination of the inputs

Page 59: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Truth Tables

Algorhm 3: The input is a Boolean sum-of-products expression Y = Y (A1, A2, ..., An).

1. Write down the special sequences for the inputs A1, A2, ..., An and their complements.

2. Find each product appearing in Y.3. Find the sum Y of the products.

Page 60: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Truth Tables

Page 61: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Boolean Functions

Let E be a Boolean expression with n variables x1, x2, ..., xn. The entire discussion above can be applied to E where now the special sequences are assigned to the variables x1, x2, ..., xn instead of the input devices A1, A2, ..., An. The truth table T = T(E) of E is defined in the same way as the truth table T = T (L) for logic circuit L.

Example: E = xyz + xy’z + x’yT (00001111, 00110011, 01010101) = 00110101

T(E) = 00110101

Page 62: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Karnaugh Map (K-Map)

Pictorial devices for finding prime implicants and minimal forms for Boolean expressions involving at most six (6) variables.

Two fundamental products are said to be adjacent if both have the same variables and if they differ in exactly one literal.

Therefore, there must be an uncomplemented variable in one product and complemented in the other.

The sum of two such adjacent products will be a fundamental product with one less literal.

Page 63: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Karnaugh Map (K-Map)

Case of Two Variables:

Page 64: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Karnaugh Map (K-Map)

Case of Three Variables:

Page 65: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Karnaugh Map (K-Map)

Case of Four Variables:

Page 66: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Karnaugh Map (K-Map)

Examples: Find the prime implicants and a minimal sum-of-products form for each of the following complete sum-of-products Boolean expressions:

1. E1 = xy + xy’

2. E2 = xy + x’y + x’y’

3. E3 = xy + x’y’

4. E4 = xyz + xyz’ + x’yz’ + x’y’z

5. E5 = xyz + xyz’ + xy’z + x’y’z

6. E6 = xyz + xyz’ + x’yz’ + x’y’z’ + x’y’z

7. E7 = xy’ + xyz + x’y’z’ + x’yzt’

Page 67: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Let’s try this one...

Problem: Design a three input minimal AND-OR circuit L with the following table:

T = [A, B, C; L] = [00001111, 00110011, 01010101; 11001101]

Page 68: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

That ends our presentation...

But wait!!We have included problems for you

to practice on with...

Thank you for the time...Hope you learned something from our

presentation!!

Page 69: Presented by: Ms. Maria Estrellita D. Hechanova, ECE

Sources:1. Schaum’s Outlines: Discrete Mathematics 2nd Edition, by

Lipschutz and Lipson, 1997.2. Digital Computer Electronics, by Malvino, 1977.3. Schaum’s Outline Series: Theory and Problems of Introduction to

Computer Science, by Scheid, 1970.