Chapter 2 Boolean Algebra and Logic Gates
Huntington Postulates 1. (a) Closure w.r.t. +. (b) Closure w.r.t.. 2. (a) Identity element 0 w.r.t. +. x + 0 = 0 + x = x. (b) Identity element 1 w.r.t.. x 1 = 1 x = x. 3. (a) Commutative w.r.t. +. x + y = y + x. (b) Commutative w.r.t.. x y = y x. 4. (a) is distributive over +. x (y + z) = (x y) + (x z). (b) + is distributive over. x + (y z) = (x + y) (x + z). 5. x B, x B (called the complement of x).) (a) x + x = 1 and (b) x x = 0. 6. There exists at least 2 distinct elements in B. 2
Summary of Boolean Algebra 3
Summary of Boolean Algebra 4
Summary of Boolean Algebra 5
Basic Theorems & Properties of Boolean Algebra Duality principle Every algebraic expression deducible from the postulates of Boolean algebra remains valid if (1) + and (2) 1 0. The Basic Relations of Boolean Algebra: THEOREM 1: (a) x + x = x; (b) x x = x. Thm 1(b) is the dual of Thm 1(a), and vice versa. THEOREM 2: (a) x + 1 = 1; (b) x 0 = 0. THEOREM 3 (involution): (x ) = x. THEOREM 4 (associative): (a) x + (y + z) = (x + y) + z; (b) x (yz) = (xy)z. 6
Basic Theorems & Properties of Boolean Algebra (Cont.) THEOREM 5 (DeMorgan): (a) (x + y) = x y ; (b) (xy) = x + y THEOREM 6: (a) x + xy = x; (b) x (x + y) = x. The theorems usually are proved algebraically or by truth table. 7
Boolean Function A Boolean function is an expression formed with Boolean variables, the operators OR, AND,and NOT, parentheses, and an equal sign. Any Boolean function can be represented in a truth table (see Tab. 2-2, p. 41 for examples). The number of rows in the table is 2 n, where n is the number of variables in the function. There are infinitely many algebraic expressions that specify a given Boolean function. It is important to find the simplest one. Any Boolean function can be transformed in a straightforward manner from an algebraic expression into a logic diagram composed only of AND, OR, and NOT gates (see Fig. 2-1, p.41 for examples). 8
Boolean Function 9
Boolean Function 10
Gate Implementation 11
Gate Implementation = x z(y + y) + xy = x z + xy 12
Algebraic Manipulation A literal is a complemented or uncomplemented variable. The minimization of the number of literals and the number of terms usually results in a simpler circuit (less expensive). Number of literals can be minimized by algebraic manipulation. Unfortunately, there are no specific rules to follow that will guarantee the final answer. CAD tools for logic minimization are commonly used today. 1. x + x y = (x+x )(x + y)=x+y. 2. x (x + y) = xx +xy=0+xy=xy. 3. xy + yz + x z = xy + x z+yz(x+x )=xy+x z+xyz+x yz=xy(1+z)+x z(1+y)=xy+x z. 4. (x + y)(y + z)(x + z) = (x + y)(x + z). 13
Complement of a Function DeMorgan s theorems can be extended to 3 or more variables, and in general to any function. (x 1 + x 2 +... + x n ) = x 1 x 2 x n. (x 1 x 2... x n ) = x 1 + x 2 +... + x n. To complement a function: 1) take the dual of the function, and 2) complement each literal. 14
Complement of a Function 15
Canonical & Standard Forms 2 variables 4 combinations (x 1 x 2, x 1 x 2, x 1 x 2, and x 1 x 2 ). n variables 2 n combinations, each called a minterm or a standard product (denoted m i, 0 i 2 n - 1). Their complements are called the maxterms or standard sums (denoted M i, 0 i 2 n -1). Canonical forms: 1) sum of minterms; 2) product of maxterms 16
Canonical & Standard Forms 17
Example 18
Example (Cont.) 19
Canonical & Standard Forms Any function can be represented in either of these 2 ways. (1) Canoncial forms: n variables 2 n distinct minterms n (maxterms) 2 2 possible functions. F = A + B C f = Σ(1, 4, 5, 6, 7). (2) By constructing the truth table. 20
Canonical & Standard Forms (example) 21
Conversion Between Canonical Forms 22
Conversion Between Canonical Forms 23
Two-Level Implementation 24
Three- and Two-Level Implementation 25
Other logic operations Notice that apart from AND, OR, and NOT (complement), the following functions also are important: NAND, NOR, XOR (exclusive-or), XNOR (exclusive-nor, or equivalence), & Transfer. 26
Digital Logic Gate 27
Digital Logic Gates A gate can be extended to have multiple inputs if the binary operation it represents is commutative and associative. The NAND ( ) and NOR ( ) operations are commutative, but not associative. 28
Nonassociativity 29
Multiple-Input and Cascaded Gates 30
Digital Logic Gates XOR and XNOR are both commutative and associative and can be extended to more than two inputs. However multiple-input XOR/XNOR are uncommon from the hardware standpoint. XOR is an odd function. It is equal to 1 if the input variables have an odd number of 1 s. Construction of a 3 input XOR is used by cascading 2 input gates. (However it can graphically be represented with a single 3-input gate.) 31
3-Input Exclusive-OR Gate 32
Positive and Negative Logic There exists two different assignments of signal level to logic value. Choosing the H to represent 1 defines a positive logic system. Choosing the L to represent logic 1 defines a negative logic system. The actual signal values aren t determine the type of logic, the assignment of logic values to the relative amplitude of the two signal levels. 33
Positive and Negative Logic 34
Positive and Negative Logic The same physical gate can operate either as a positive logic AND gate or as a negative logic OR gate. It is necessary to include the polarity indicator triangle in the graphic symbols when negative logic is assumed. 35