chapter 2 boolean algebra and logic gates. 2.1 introduction to provide a basic vocabulary and a...

47
Chapter 2 Boolean Algebra and Logic Gates

Upload: grace-mcdowell

Post on 26-Mar-2015

242 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Chapter 2

Boolean Algebra and Logic Gates

Page 2: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.1 Introduction

• To provide a basic vocabulary and a brief foundation in Boolean algebra– Boolean algebra

• To optimize simple circuits• To understand the purpose of algorithms

for optimizing complex circuits with millions of gates.

Page 3: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.2 Basic Definitions

• Closure • Associative law• Commutative law• Identity element• Inverse• Distributed law

Page 4: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Closure

• Closure – A set S is closed with respect to a binary operator if,

for every pair of elements of S, the binary operator specifies a rule for obtaining a unique elements of S.

– Example The set of natural number N = {1,2,3,4,…} is closed

with the binary operator plus(+) by rules of arithmetic addition

Page 5: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Associative law, Commutative law, etc.

• Associative law : (x*y)*z = x*(y*z) for all x,y,z∈S

• Commutative law : x*y = y*x for all x,y∈S

• Identity elements: A set is said to have identity elements with respect to a binary operation * on S if there exists an element e ∈S with the property for all x ∈S, e*x = x*e =xExample: set of integers I={…, -3, -2, -1, 0, 1, 2,

3, …}, x + 0 = 0 + x = x

Page 6: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Associative law, Commutative law, etc.

• Inverse : A set S having the identity elements e with a binary operator * is said to have an inverse, for all x∈S , y∈S, x * y = e example: In the set of integers, I, and the

operator + with 0, the inverse of an element a is (-a), since a + (-a) = 0

• Distributive law : x*(y.z)=(x*y).(x*z)

Page 7: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.3 Axiomatic definitions of Boolean algebra

• George Boole– Developed Boolean algebra in 1854.

• C. E. Shannon– Introduced a two-valued Boolean algebra (s

witching algebra) in 1938.• E. V. Huntington

– Formulated the postulates in 1904. (refer to page 54)

Page 8: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Two-valued Boolean Algebra

• Two_valued Boolean algebra is defined on a set of two elements, B ={0,1}, with rules for the two binary operators + and .

• Closure• Two identity elements: 0 for + and 1 for • Distributed law

x (y+z) = (x y) + (x z)

• x + x’=1 x x’ = 0

Page 9: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.4 Basic theorems and properties of Boolean

Algebra• Duality

– If the dual of an expression is desired, we simply interchange OR and AND operators and replace 1’s by 0’s and 0’s by 1’s.

Page 10: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Basic theorems (Table 2.1)

The theorems, postulates in Table 2.1 are listed in pairs; each relation is the dual of the one paired with it.

Page 11: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

A Proof of theorems

• x + xy = x x + xy = x.1 + xy postulate 2(b) = x(1+y) postulate 4(a) = x(y+1) postulate 3(a) = x.1 theorem 2(a) = x postulate 2(b)

Page 12: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.4 Basic theorems and properties of Boolean Algebra (continued)

• Operator Precedence1. Parentheses2. NOT3. AND4. OR

Page 13: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Boolean algebra is an algebra that deals with binary variables and logic operations

An example: F1 = x + y'z

Its truth table is shown in Table 2.2 and its logic-circuit diagram is shown in Figure 2.1

2.5 Boolean Functions

Page 14: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Equivalent logics with the same truth table An example: F2 in Table

F2 = x’y’z + x’yz + xy’ = x’z ( y’+ y ) + xy’ = x’z + xy’

2.5 Boolean Functions (con.)

Page 15: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Implementation of F2

Page 16: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Algebraic manipulation

• A literal: a single variable within the term that requires a logic gate.

• Minimization: obtaining a simpler circuit

• Designers of digital circuits use computer minimization programs

Page 17: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

1. x(x'+y) = xx' + xy = 0 + xy = xy. 2. x +x'y = (x+x')(x+y) = 1(x+y) = x + y. 3. (x+y)(x+y') = x + xy + xy' + yy' = x(1+y+y') = x. 4. xy + x'z + yz = xy + x'z + yz(x+x') = xy + x'z + xyz + x'yz = xy(1+z) + x'z(1+y) = xy + x'z 5. (x+y)(x'+z)(y+z) = (x+y)(x'+z) : by duality from f

unction 4. 4 and 5 are known as consensus theorem

Example 2.1

Page 18: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Complement of a function

The complement of a function F is F’ F’ is obtained from an exchange of 0’s for 1’s and 1’s

for 0’s of function F The complement of a function may derived algebraical

ly through DeMorgan’s theorem.

Page 19: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Complement of a function (cont.)

DeMorgan’s theorem (Table 2.1) can be extended to three variables.

(A + B + C)'= (A+x)' let B+C=x = A'x' by theorem 5(a)(DeMorgan) = A'(B+C)' substitute B+C=x = A'(B'C') by theorem 5(a)(DeMorgan) = A'B'C' by theorem 4(b)(associative)

DeMorgan’s theorem can be generalized. (A+B+C+D+…+F)' = A'B'C'D'…F' (ABCD…F)' = A' +B'+ C' + D' + … + F'

Page 20: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Example 2.2

Find the complement of the functions F1=x'yz'+x'y'z, F2=x(y'z'+yz).

<Answer> F1' = (x'yz'+x'y'z)' = (x'yz')'(x'y'z)'

= (x+y'+z)(x+y+z') F2' = [x(y'z'+yz)]' = x'+(y'z'+yz)'

= x'+(y'z')'(yz)' = x'+(y+z)(y'+z')

Page 21: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Example 2.3

Find the complement of the functions F1 And F2 Example 2.2 by taking their duals and complementing each literal.

<Answer> 1. F1 = x'yz' + x'y'z. The dual of F1 is (x'+y+z')(x'+y'+z) Complement each literal : (x+y'+z)(x+y+z')=F1' 2. F2 = x(y'z'+yz). The dual of F2 is x+(y'+z')(y+z) Complement each literal : x'+(y+z)(y'+z')=F2'

Page 22: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.6 Canonical and Standard Forms

• Minterms and Maxterms

Page 23: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Functions of Three Variables

• Example: f1, f2 , f1’?

Page 24: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Functions of Table 2.4

f1 = x’y’z+xy’z’+xyz = m1 + m4 + m7

f2 = x’yz+xy’z+xyz’+xyz = m3 + m5 + m6 + m7

f1’ = x’y’z’+ x’yz’ + x’yz + xy’z + xyz’ (f1’)’= (x’y’z’+ x’yz’+x’yz+xy’z + xyz’)’ = (x+y+z)(x+y’+z)(x+y+z)(x’+y+z’)(x’+y’+z) = M0.M2.M3.M5.M6 = f1

Similarly f2 = M0.M1.M2.M4

Page 25: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Sum of Minterms

• Any Boolean functions can be expressed as sum of minterms.

Page 26: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Example 2.4

Express F = A + B’C in sum of minterms.<Answer> A = A(B+B') = AB +AB' = AB(C+C') + AB'(C+C') = ABC + ABC' + A

B'C +AB'C‘B'C = B'C(A+A') = AB'C + A'B'C F = A + B'C = A' B'C + AB'C' + AB'C + ABC' + ABC

= m1 + m4 + m5 + m6 + m7

= ∑(1, 4, 5, 6, 7)

Page 27: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To
Page 28: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Product of Maxterms

• Any Boolean functions can be expressed as product of maxterms.

Page 29: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Example 2.5

Express the Boolean function F = xy + x'z in a product of maxterm form.

<Answer> F = xy + x'z = (xy+x')(xy+z)

= (x+x')(y+x')(x+z)(y+z) = (x'+y)(x+z)(y+z)x' + y= x' + y + zz'= (x'+y+z)(x'+y+z')x + z= x + z + yy'= (x+y+z)(x+y'+z)y + z= y + z + xx'= (x+y+z)(x'+y+z)F = (x+y+z)(x+y'+z)(x'+y+z)(x'+y+z')

= M0M2M4M5

= ∏(0, 2, 4, 5)

Page 30: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Conversion between Canonical Forms

• F(A,B,C) = (1,4,5,6,7) F’(A,B,C) = (0,2,3) = m0+m2+m3

If F, (F’)’ is taken by DeMorgan’s theorem

F=(m0+m2+m3)’=m0’.m2’.m3’ = M0M2M3 = (0,2,3)

• It is clear that mj’=Mj

Page 31: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Example: F(x,y,z)=xy+x’z

• F=xy+x’z = (1,3,6,7) = (0,2,4,5)

Page 32: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Standard Forms

• Sum of Products(SOP): a Boolean expression containing AND terms

• Product of Sums(POS): a Boolean expression containing OR terms

Page 33: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

F1= y’ + xy + x’yz’ F2= x(y’+z)(x’+y+z)

Page 34: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Nonstandard forms: F3=AB+C(D+E)

• Figure 2-4(a): Nonstandard forms• Figure 2-4(b): Conversion to its standard

form

• 3-level 2- level

Page 35: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Incompletely Specified Functions

• Assume that the output of N1 does not generate all possible combinations of values for A,B, and C.

Page 36: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

The function F is incompletely specified.

The minterm A’B’C and ABC’ are “don’t care terms”.

F = m(0,3,7)+ d(1,6)

Page 37: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.7 Other Logic Operations

• 16 functions of two binary variables

Page 38: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Boolean expressions of the 16 functions

Page 39: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2.8 Digital Logic Gates

Page 40: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Extension to Multiple Inputs

• NAND and NOR operators are not associative (xy)z x(yz)

<Proof> (x↓y)↓z= [(x+y)'+z]' = (x+y)z'= xz' + yz' x↓(y↓z)= [x+(y+z)'] ' = x'(y+z)= x'y + x'z

Page 41: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To
Page 42: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

3-input Gates• By definition xyz = (x+y+z)’ xyz = (xyz)’• F = [(ABC)'(DE)']' = ABC + DE

Page 43: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

3-input XOR gate

Page 44: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Positive and Negative Logic

Page 45: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To
Page 46: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

2-8 Integrated Circuits

• SSI• MSI• LSI• VLSI

Page 47: Chapter 2 Boolean Algebra and Logic Gates. 2.1 Introduction To provide a basic vocabulary and a brief foundation in Boolean algebra –Boolean algebra To

Digital Logic Families• Typical digital IC families

– TTL– ECL– MOS– CMOS

• Evaluation parameters– Fan-out– Fan-in– Power of dissipation– Propagation delay– Noise margin