chapter 2 boolean algebra and logic gates. 2 chapter 2. boolean algebra and logic gates 2-2basic...

33
Chapter 2 Boolean Algebra and Logic Gates

Upload: aubrey-campbell

Post on 21-Jan-2016

267 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

Chapter 2Boolean Algebra and Logic Gates

Page 2: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

2

Chapter 2. Boolean Algebra andLogic Gates

2-2 Basic Definitions2-3 Axiomatic Definition of Boolean Algebra

2-4 Basic Theorems and Properties

2-5 Boolean Functions2-6 Canonical and Standard Forms

2-7 Other Logic Operations

2-8 Digital Logic Gates

2-1 Introduction

Page 3: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

3

2-2 Basic Definitions• Boolean Algebra (formulated by E.V. Huntington, 1904)

A set of elements B={0,1} and tow binary operators + and •

1. Closurex, yBx+yB; x, y B x•yB

2. Associative (x+y)+z = x + (y + z); (x•y)•z = x • (y•z)

3. Commutativex+y =y+x; x•y = y•x

4. an identity element0+x = x+0 = x; 1•x = x•1=x

xB,x'B (complement of x)x+x'=1; x•x'=0

6. distributive Law over + :x•(y+z)=(x•y)+(x•z)distributive over x: x+ (y.z)=(x+ y)•(x+ z)

Page 4: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

4

Two-valued Boolean Algebra

•= AND

+ = OR

‘ = NOT

Distributive law: x•(y+z)=(x•y)+(x•z)

Page 5: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

5

2-4 Basic Theorems and Properties

Duality Principle:Using Huntington rules, one part may be obtained from the other if the binary operators and the identity elements are interchanged

Page 6: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

5

2-4 Basic Theorems and Properties

Operator Precedence1. parentheses2. NOT3. AND4. OR

Page 7: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

6

Basic Theorems

Page 8: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

7

Page 9: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

8

Truth Table

Theorem 6(a) Absorption

Theorem 5. DeMorgan

A table of all possible combinations of x and y variables showing therelation between the variable values and the result of the operation

Page 10: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

9

2-5 Boolean Functions

Boolean FxnctionsF1 2= x + (y’z) F = x‘y’z + x’yz + xy’

Logic Circuit Boolean Function

Page 11: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

10

Boolean Function F2

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

Page 12: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

Example 2.1 Simplify the following Boolean functions to a minimum number of literals:

1- x(x’+y) =xx’ + xy =0+xy=xy

2- x+x’y =(x+x’)(x+y) =1(x+y) = x+y

Algebraic Manipulation - Simplification

Page 13: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

DeMorgan’s Theorem

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 function4

Page 14: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

13

Complement of a Function

•Complement of a variable x is x’ (0 1 and 1 0)

•The complement of a function F is x’ and is obtained from aninterchange of 0’s for 1’s and 1’s for 0’s in the value of F

•The dual of a function is obtained from the interchange of AnDand OR operators and1’s and 0’s

-- Finding the complement of a function F

Applying DeMorgan’s theorem as many times as necessary

complementing each literal of the dual of F

Page 15: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

12

DeMorgan’s Theorem

Generalized DeMorgan’s Theorem

3-variable DeMorgan’s Theorem

2-variable DeMorgan’s Theorem(x + y)’ = x’y’ and (xy)’ = x’ + y’

Page 16: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

14

Page 17: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

15

2-5 Canonical and Standard Forms• Minterms and maxterms

– Expressing combinations of 0’s and 1’s with binary variables

• Logic circuit Boolean function Truth table

– Any Boolean function can be expressed as a sum of minterms

- Any Boolean functiox can be expressed as a product ofmaxterms

• Canonical and Standard Forms

Page 18: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

16

Minterxs and Maxterxs

Minterm (or standard product): Maxterm (or standard sum):– n variables combined with AND – n variables combined with OR

– n variables can be combined to – A variable of a maxterm isform 2 minterms

• two Variables: x’y’, x’y, xy’, and xy– A variable of a minterm is

• primed if the corresponding bit ofthe binary number is a 0,

• and unprimed if a 1

n • unprimed is the correspondingbit is a 0

• and primed if a 1

001 => x’y’z100 => xy’z’111 => xyz

Page 19: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

17

Expressing Truth Table in Boolean Function• Any Boolean function

can be expressed a sum of minterms ora product of maxterms

(either 0 or 1 for each term)• said to be in a canonical

form• x variables 2 mintermsn

2 possible functions2n

Page 20: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

18

Expressing Boolean Function in Sum ofMinterms (Method 1 - Supplementing)

Page 21: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

19

Expressing Boolean Function in Sum ofMinterms (method 2 – Truth Table)

F(A, B, C) =(1, 4, 5, 6, 7) =(0, 2, 3)

F’(A, B, C) =(0, 2, 3) =(1, 4, 5, 6, 7)

Page 22: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

Expressing Boolean Function in Product ofMaxterms

2x

Page 23: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

21

Conversion between Canonical Forms

Canonical conversion procedureConsider: F(A, B, C) = ∑(1, 4, 5, 6, 7)

F‘: complement of F = F’(A, B, C) =(0, 2, 3) = m0 2 3

Compute complement of F’ by DeMorgan’s Theorem

+ m + m

F = (F’)’ = (m0 2 3 0 2 3+ m + m )‘ = (m ’m ’m ’)

= m0 2 3 0 2 3’ m’ m’ = M M M (0, 2, 3)

Summary• m ’ = Mj j

• Conversion between product of maxterms and sum of minterms

(1, 4, 5, 6, 7) = (0, 2, 3)• Shown by truth table (Table 2-5)

Page 24: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

x2

Boolean exprexsion: x(x, y, z) = xy + x’z

Dexiving the truthxxxxe

Expressing in canonical fxrms

x(x, y, z) =(1, 3, 6, 7) =(0, 2, 4, 5)

Example – Two Canonical Forxs of BooleanAlgebra from Truth Table

Page 25: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

23

Stanxard Forms

x Canonixal forms: eaxh xinterm xr mxxterm muxtcontain all the variables

x Standard forms: the terms thxt form the functixnmay contain one, two, or any number of literalx(variables)

• Two typxs xf standard forms (2-level)– sum of proxucts

F1

– xxoduct of sumx= y’ + xy + x’yz’

F2

• Canxnixal forms Standard fxrms– xux of minterms, Product of maxtexms– Sum of productx, Product of suxs

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

Page 26: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

24

Standard Form and Logic Circuit

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

Page 27: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

25

Nonstandard Form and Logic Circuit

Nonstandard form: Standard form:F3 3

A two-level implementation is preferred: produces the least amount of delasThrough the gates when the signal propagates from the inputs to the output

= AB + C(D+E) F = AB + CD + CE

Page 28: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

26

2-7 Other Logic Operations

• There are 2 functionn for n binaryvariables

2n

• For n=2– where are 16 possible functions

– AND and OR operators are two of them: xy and x+y

• Subdivided into three categories:

Page 29: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

2x

Truth Tables and Boolean Expressions forthe 16 Functions of Two Variables

Page 30: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

28

2-8 Digital LogicGates

Figure 2-5 Digital Logic Gates

Page 31: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

29

Multiple-Inputs

• NAND and NOR functions arecommunicative busnot Associative

– Define multiple NOR (or NANs) gate as acomplemented OR (or AND) gate (Section 3-6)

XOR and equivalence gates are bothcommunicative and associative– uncommon, usually constructed with other gates

– XOR is an odd function (Section 3-8)

Page 32: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

30

Page 33: Chapter 2 Boolean Algebra and Logic Gates. 2 Chapter 2. Boolean Algebra and Logic Gates 2-2Basic Definitions 2-3AxiomaticDefinition of Boolean Algebra

0

01

1

H H

LL

(a) Positive logic (b) Negative logic

Logic value Logic valueSignal value Signal value