47
11.1 Boolean Functions

11.1 Boolean Functions

  • Upload
    reba

  • View
    55

  • Download
    1

Embed Size (px)

DESCRIPTION

11.1 Boolean Functions. Boolean Algebra. An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and, or , and not , (typically operating on the set {0,1}). - PowerPoint PPT Presentation

Citation preview

Page 1: 11.1 Boolean Functions

11.1 Boolean Functions

Page 2: 11.1 Boolean Functions

Boolean Algebra• An algebra is a set with one or more operations defined

on it.• A boolean algebra has three main operations, and, or, and

not, (typically operating on the set {0,1}).

• Rules of precedence for Boolean operators: PCoPS- parentheses, complements, products, sums

OR + a+b

AND ∙ ab

NOT complement

Page 3: 11.1 Boolean Functions

Examples:

1 ∙0+1 ∙ (1+1 )+0=¿

(1 ∙1)+0 ∙1=¿

Page 4: 11.1 Boolean Functions

Laws of Boolean Algebra

Double Complement

Idempotent

Identity

Domination

00

11

1

0

x

x

xx

xx

xxx

xxx

xx

Page 5: 11.1 Boolean Functions

More Laws of Boolean Algebra

Commutative

Associative

Distributive

))((

)(

)()(

)()(

zxyxyzx

xzxyzyx

zxyyzx

zyxzyx

xyyx

xyyx

Page 6: 11.1 Boolean Functions

Laws of Boolean Algebra Concluded

DeMorgan’s Laws

Absorption Laws

Unit Property

Zero Property 0

1

)(

xx

xx

xyxx

xxyx

yxyx

yxxy

Page 7: 11.1 Boolean Functions

“Proving” the Laws of Boolean Algebra

• If the underlying set is just {0,1}, we can prove these laws with truth tables, just as we did with propositional logic.

Page 8: 11.1 Boolean Functions

Duals and the Duality Principle

• The dual of a boolean expression is obtained by replacing all sums by products, all products by sums, all 0’s by 1’s, and all 1’s by 0’s.

• Example:

• The duality principle says that if an equation in a boolean algebra is an identity, i.e. always true no matter what the values of the variables, then the equation obtained by replacing both sides by their duals is also an identity.

Page 9: 11.1 Boolean Functions

Boolean Functions of Degree n on the Boolean algebra {0, 1}

Page 10: 11.1 Boolean Functions

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

Example: Boolean Function Table

1 1 1

1 1 0

1 0 1

1 0 0

0 1 1

0 1 0

0 0 1

0 0 0

Page 11: 11.1 Boolean Functions

Using a 3-cube to represent a Boolean Function:

Page 12: 11.1 Boolean Functions

Lattices and Boolean Algebra

• A lattice is a partially ordered set in which every pair of elements has both a least upper bound (lub) and a greatest lower bound (glb).

• The supremum ab is defined as lub(a,b) and the infimum ab is defined as glb(a,b)

• A lattice is said to be distributive if each of and distributes over the other.

• For a distributive lattice to be a Boolean algebra, there must be (a) a largest element 1, (b) a least element 0, and (c) for each element x a complement with the property that

x0 and 1 xxxx

Page 13: 11.1 Boolean Functions

11.2 Representing Boolean Functions

( n-ary functions on the set {0, 1} )

Page 14: 11.1 Boolean Functions

Disjunctive Normal Form

• Pick out all the ones in the “function table” column corresponding to the function value.

• Translate each to an “and” of n literals (a literal is a Boolean variable of the form x or )

• Each such product is called a “minterm”.• The desired function is the sum of these

minterms, and is called the sum-of-products expansion or disjunctive normal form of the function.

x

Page 15: 11.1 Boolean Functions

Example

1 1

1 0

0 1

0 0

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

Page 16: 11.1 Boolean Functions

Another Example

• Find the DNF expansion of )()(),,( zyyxzyxF

1 1 1

1 1 0

1 0 1

1 0 0

0 1 1

0 1 0

0 0 1

0 0 0

Page 17: 11.1 Boolean Functions

Example: Find the sum-of-products expansion of the Boolean function that equals 1 if and only if

Page 18: 11.1 Boolean Functions

Laws of Boolean Algebra Concluded

DeMorgan’s Laws

Absorption Laws

Unit Property

Zero Property 0

1

)(

xx

xx

xyxx

xxyx

yxyx

yxxy

Page 19: 11.1 Boolean Functions

Functional Completeness• A set of operators on an algebra is said to be

functionally complete if any function of any degree on that algebra can be expressed in terms of those operators

• The set is functionally complete in any boolean algebra.

• But since , so is• Also, since , is also

functionally complete

},,{

𝑥𝑦=¿𝑥+𝑦=¿

Page 20: 11.1 Boolean Functions

Example: Express the Boolean function using only the operators and .

Page 21: 11.1 Boolean Functions

The NAND Operation

yx |

Page 22: 11.1 Boolean Functions

The NOR Operation

yx

Page 23: 11.1 Boolean Functions

Example:

1. Express the Boolean function using only the operator and using only the operator .

Page 24: 11.1 Boolean Functions

11.3 Logic Gates

• Boolean algebra is the algebra of circuits.• The elementary operations of the algebra

correspond to circuit elements called gates.

Page 25: 11.1 Boolean Functions

Basic Types of Gates

Page 26: 11.1 Boolean Functions

Combinations of gates

• Branching and multiple inputs

xyyx

xyxxy

)(

)(

Page 27: 11.1 Boolean Functions

Example:

Page 28: 11.1 Boolean Functions

Example

• Three switches x, y, and z, controlling a light

x y z F(x,y,z)

1 1 1

1 1 0

1 0 1

1 0 0

0 1 1

0 1 0

0 0 1

0 0 0

Page 29: 11.1 Boolean Functions
Page 30: 11.1 Boolean Functions

Half-Adder Circuit

Page 31: 11.1 Boolean Functions

Full Adder

Page 32: 11.1 Boolean Functions

11.4 Minimization of Circuits

• Minimizing a circuit is minimizing the number of gates necessary to achieve the required outputs

• Equivalent to minimizing the Boolean function, i.e. to finding the least number of Boolean operations needed to compute the function

• Recall that any such function can be expressed as a sum of minterms– Note that the number of possible minterms is

exponential in the number n of variables.– Note also that the number of functions is exponential in

the number of minterms.

Page 33: 11.1 Boolean Functions

Karnaugh Maps for Two Variables

• Variables x and y• Label rows with x and x, columns with y

and y

Page 34: 11.1 Boolean Functions

Another Example𝐹 (𝑥 , 𝑦 )=𝑥 𝑦+𝑥 𝑦

Page 35: 11.1 Boolean Functions

Karnaugh Maps (K-Maps) for Three Variables

• Variables x, y, and z• Use x and x as row labels• Use all possible products of y and z

literals, arranged in a Gray code, as column labels

• The geometric picture is that of a band, since the last and first cells in each row are to be considered adjacent

Page 36: 11.1 Boolean Functions
Page 37: 11.1 Boolean Functions

Examples

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

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

Page 38: 11.1 Boolean Functions

Implicants, Prime Implicants, and Essential Prime Implicants

Page 39: 11.1 Boolean Functions

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

Page 40: 11.1 Boolean Functions

K-Maps for Four Variables

• Variables w, x, y, and z• Use all possible products of w and x

literals, arranged in a Gray code, as row labels

• Use all possible products of y and z literals, arranged in a Gray code, as row labels

• Geometric picture is that of a torus

Page 41: 11.1 Boolean Functions

Example𝐹 (𝑤 , 𝑥 , 𝑦 , 𝑧 )=𝑤𝑥𝑦𝑧+𝑤𝑥𝑦 𝑧+𝑤𝑥 𝑦 𝑧+𝑤𝑥𝑦𝑧+𝑤𝑥𝑦𝑧+𝑤𝑥𝑦𝑧

Page 42: 11.1 Boolean Functions

Another Example𝐹 (𝑤 , 𝑥 , 𝑦 , 𝑧 )=𝑤𝑥𝑦 𝑧+𝑤𝑥 𝑦 𝑧+𝑤𝑥 𝑦 𝑧+𝑤𝑥 𝑦 𝑧

Page 43: 11.1 Boolean Functions

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

A light controlled by 4 switches:

Page 44: 11.1 Boolean Functions

The Quine-McCluskey Method

• Map each min-term into a bit string. E.g. map wxyz to 0110.

• Generate implicants as bit strings with wild card characters, such as 0–01

• Prime implicants are those which are not generalized by any other implicant

• Essential prime implicants are those which generalize a min-term not generalized by any other implicant

Page 45: 11.1 Boolean Functions

Example

wxyz, wxyz, wxyz, wxyz, wxyz, wxyz, wxyz

Page 46: 11.1 Boolean Functions

wxyz, wxyz, wxyz, wxyz, wxyz, wxyz, wxyz

Check with Karnaugh Map

Page 47: 11.1 Boolean Functions

Linkhttp://www.mathcs.bethel.edu/~gossett/DiscreteMathWithProof/QuineMcCluskey.html