Ch2. Boolean Algebra and Logic Gates

advertisement

EEA051 - Digital Logic

數位邏輯

Chapter 2

Boolean Algebra and Logic Gates

吳俊興

國立高雄大學 資訊工程學系

October 2005

Chapter 2. Boolean Algebra and

Logic Gates

2-1 Basic Definitions

2-2 Axiomatic Definition of Boolean Algebra

2-3 Basic Theorems and Properties

2-4 Boolean Functions

2-5 Canonical and Standard Forms

2-6 Other Logic Operations

2-7 Digital Logic Gates

2-8 Integrated Circuits

2

2-1/2-2 Basic and Axiomatic Definitions

• Boolean Algebra (formulated by E.V. Huntington, 1904)

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

• Huntington postulates

1. Closure w.r.t. the operator + ( • ) x, y ∈ B ⇒ x+y ∈ B; x, y ∈ B ⇒ x • y ∈ B

2. Associative w.r.t. + ( • )

(x+y)+z = x + (y + z); (x • y) • z = x • (y • z)

3. Commutative w.r.t. + ( • ) x+y = y+x; x • y = y • x

4. An identity element w.r.t. + ( • )

0+x = x+0 = x; 1 • x = x • 1= x

5. ∀ x ∈ B, ∃ x' ∈ B ( complement of x ) x+x'= 1; x • x'= 0

6.

• is distributive over + : x • ( y+z )=( x • y ) + ( x • z )

+ is distributive over • : x + ( y • z )=( x + y ) • ( x + z )

Duality principle : remains valid if the operators and identity elements are interchanged

3

Two-valued Boolean Algebra

• = AND

+ = OR

‘ = NOT

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

4

2-3 Basic Theorems and Properties

Operator Precedence

1.

parentheses

2.

NOT

3.

AND

4.

OR

5

Basic Theorems

6

7

Truth Table

A table of all possible combinations of the variables showing the relation between the variable values and the result of the operation

Theorem 6(a) Absorption

Theorem 5. DeMorgan

8

2-4 Boolean Functions

Logic Circuit ⇔ Boolean Function

Boolean Functions

F

1

= x + (y’z) F

2

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

9

Boolean Function F2

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

10

Algebraic Manipulation - Simplification

11

DeMorgan’s Theorem

2-variable DeMorgan’s Theorem

(x + y)’ = x’y’ and (xy)’ = x’ + y’

3-variable DeMorgan’s Theorem

Generalized DeMorgan’s Theorem

12

Complement of a Function

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

•The complement of a function F is F’ and is obtained from an interchange 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 AND and OR operators and 1’s and 0’s

•Finding the complement of a function F

9 Applying DeMorgan’s theorem as many times as necessary

9 complementing each literal of the dual of F

13

14

2-5 Canonical and Standard Forms

• Minterms and Maxterms

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

(normal form x or complement form x’)

• Logic circuit ⇔ Boolean function ⇔ Truth table

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

– Any Boolean function can be expressed as a product of maxterms

• Canonical and Standard Forms

15

Minterms and Maxterms

Minterm (or standard product):

– = n variables combined with AND

– n variables can be combined to form 2 n minterms

• two variables: x’y’, x’y, xy’, and xy

– A variable of a minterm is

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

• and unprimed if a 1

Maxterm (or standard sum):

– = n variables combined with OR

– A variable of a maxterm is m j

• unprimed if the corresponding bit is a 0

• and primed if a 1

’ = M j

001 => x’y’z

100 => xy’z’

111 => xyz

16

Expressing Truth Table in Boolean Function

• Any Boolean function can be expressed as a sum of minterms or a product of maxterms

(either 0 or 1 for each term)

• said to be in a canonical form

• n variables

⇒ 2 n minterms

⇒ 2 2n possible functions

(x+y’+z’)

17

Expressing Boolean Function in Sum of

Minterms (Method 1 - Supplementing)

18

Expressing Boolean Function in Sum of

Minterms (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)

19

Expressing Boolean Function in Product of

Maxterms

20

Conversion between Canonical Forms

¾ Canonical conversion procedure

Consider: F(A, B, C) = Σ (1, 4, 5, 6, 7)

F’: Complement of F = F’(A, B, C) = Σ (0, 2, 3) = m

0

+ m

Compute complement of F’ by DeMorgan’s Theorem

2

F = (F’)’ = (m

0

+ m

2

+ m

3

)’ = (m

0

’ ⋅ m

2

’ ⋅ m

3

’)

= m

0

’ ⋅ m

2

’ ⋅ m

3

’ = M

0

M

2

M

3

= Π (0, 2, 3)

+ m

3

¾ Summary

• m j

’ = M 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)

21

Example – Two Canonical Forms of Boolean

Algebra from Truth Table

¾ Boolean expression: F(x, y, z) = xy + x’z

¾ Deriving the truth table

¾ Expressing in canonical forms

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

22

Standard Forms

• Canonical forms: each minterm or maxterm must contain all the variables

• Standard forms : the terms that form the function may contain one, two, or any number of literals

(variables)

• Two types of standard forms (2-level)

– sum of products

F

1

= y’ + xy + x’yz’

– product of sums

F

2

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

• Canonical forms ⇔ Standard forms

– Sum of minterms, Product of maxterms

– Sum of products, Product of sums

23

Standard Form and Logic Circuit

F

1

= y’ + xy + x’yz’ F

2

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

24

Nonstandard Form and Logic Circuit

Nonstandard form:

F

3

= AB + C(D+E)

Standard form:

F

3

= AB + CD + CE

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

25

2-6 Other Logic Operations

• There are 2 2n functions for n binary variables

• For n=2

– there are 16 possible functions

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

• Subdivided into three categories:

26

Truth Tables and Boolean Expressions for the 16 Functions of Two Variables

27

2-7 Digital Logic

Gates

Figure 2-5 Digital Logic Gates

1. Two are equal to a constant

2. Four are repeated twice

3. Two, Inhibition and implication, are impractical

The gates can be extended to have more than two inputs except for the inverter and buffer

28

Multiple-Inputs

• NAND and NOR functions are communicative but not associative

– Define multiple NOR (or NAND) gate as a complemented OR (or AND) gate (Section 3-6)

XOR and equivalence gates are both communicative and associative

– uncommon, usually constructed with other gates

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

29

30

2-8 Integrated Circuits

Digital ICs are often categorized according to their circuit complexity as measured by the number of logic gates in a single package

– Small-scale integration (SSI)

• the inputs and outputs of the gates are connected directly to the pins in the package

• usually fewer than 10 gates, limited by the number of pins available

– Medium-scale integration (MSI)

• 10 to 1,000 gates in a package

• usually perform specific elementary digital operations

– Large-scale integration (LSI)

• Thousands of gates

• Include digital systems such as processors, memory chips, and programmable logic devices

– Very large-scale integration (VLSI)

• Hundred of thousands of gates

31

Summary

Chapter 2 Boolean Algebra and Logic Gates

2-1 Basic Definitions

2-2 Axiomatic Definition of Boolean Algebra

2-3 Basic Theorems and Properties

2-4 Boolean Functions

2-5 Canonical and Standard Forms

2-6 Other Logic Operations

2-7 Digital Logic Gates

2-8 Integrated Circuits

32

Download