Boolean Algebra and Logic Gates 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 optimize simple circuits To understand the purpose of algorithms for optimizing complex circuits with millions of gates.
2.2 Basic Definitions Closure Associative law Commutative law Identity element Inverse Distributed law
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
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 =x Example: set of integers I={…, -3, -2, -1, 0, 1, 2, 3, …}, x + 0 = 0 + x = x
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)
2.3 Axiomatic definitions of Boolean algebra George Boole Developed Boolean algebra in 1854. C. E. Shannon Introduced a two-valued Boolean algebra (switching algebra) in 1938. E. V. Huntington Formulated the postulates in 1904. (refer to page 54)
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
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.
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.
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)
2.4 Basic theorems and properties of Boolean Algebra (continued) Operator Precedence Parentheses NOT AND OR
2.5 Boolean Functions 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 (con.) 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’
Implementation of F2
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
Example 2.1 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 function 4. 4 and 5 are known as consensus theorem
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 algebraically through DeMorgan’s theorem.
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'
Example 2.2 F1=x'yz'+x'y'z, F2=x(y'z'+yz). <Answer> 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')
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'
2.6 Canonical and Standard Forms Minterms and Maxterms
Functions of Three Variables Example: f1, f2 , f1’?
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
Sum of Minterms Any Boolean functions can be expressed as sum of minterms.
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' + AB'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)
Product of Maxterms Any Boolean functions can be expressed as product of maxterms.
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)
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
Example: F(x,y,z)=xy+x’z F=xy+x’z = (1,3,6,7) = (0,2,4,5)
Standard Forms Sum of Products(SOP): a Boolean expression containing AND terms Product of Sums(POS): a Boolean expression containing OR terms
F1= y’ + xy + x’yz’ F2= x(y’+z)(x’+y+z)
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
Incompletely Specified Functions Assume that the output of N1 does not generate all possible combinations of values for A,B, and C.
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)
2.7 Other Logic Operations 16 functions of two binary variables
Boolean expressions of the 16 functions
2.8 Digital Logic Gates
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
3-input Gates By definition xyz = (x+y+z)’ xyz = (xyz)’ F = [(ABC)'(DE)']' = ABC + DE
3-input XOR gate
Positive and Negative Logic
2-8 Integrated Circuits SSI MSI LSI VLSI
Digital Logic Families Typical digital IC families TTL ECL MOS CMOS Evaluation parameters Fan-out Fan-in Power of dissipation Propagation delay Noise margin