Boolean Algebra CS 3402 Digital Logic Boolean Algebra
Boolean Algebra CS 3402 --Digital Logic Boolean Algebra
Outline • Laws and theorems of Boolean Algebra • Switching functions • Logic functions: NOT, AND, OR, NAND, XOR, XNOR • Switching function representations • Canonical forms CS 3402 --Digital Logic Boolean Algebra 2
Axiomatic of Boolean Algebra A Boolean algebra consists of a set B with two binary operations ( “AND”, “OR”) and a unary operation ( ¯ or “NOT”), such that the following axioms satisfy: 1) Set B contains at least two distinct elements a and b. 2) Closure: For every a, b B, a. a + b B b. a b B 3) Commutative Laws: For every a, b B, a. a + b = b + a b. a b = b a CS 3402 --Digital Logic Boolean Algebra 3
Axiomatic of Boolean Algebra 4) Associative Laws: For every a, b, c B, a. (a + b) + c = a + (b + c) b. (a b) c = a (b c) 5) Identities: For every a B, a. an identity element 0, such that a + 0 = a b. an identity element 1, such that a 1 = a 6) Distributive Laws: For every a, b, c B, a. 7) a (b + c) = (a b) + (a c) Complement: For each a B, an a. b. CS 3402 --Digital Logic a+ a such that =1 =0 Boolean Algebra 4
Boolean function • A Boolean function uniquely maps Bn to B. • A Boolean expression is an algebraic statement containing Boolean (binary) variables and operators ( , +, and ), that is (AND, OR, and NOT) • A literal is a variable itself or its complement. When a Boolean function is implemented with logic gates, each literal represents an input to a gate, and each term is implemented a gate. CS 3402 --Digital Logic Boolean Algebra 5
Examples 1) 2) 3) 4) 5) F = XYZ F = X + Y Z F = X Y Z + X YZ + XZ Z = A B (C + D) Z = (A (B (C + D))) CS 3402 --Digital Logic Boolean Algebra 6
Laws and Theorems of Boolean Algebra Duality Every Boolean expression is deducible from the postulates of Boolean algebra remains valid if the operators and the identity elements are interchanged. That is interchange OR and AND operators and replace 1's by 0's and 0's by 1's. CS 3402 --Digital Logic Boolean Algebra 7
Examples 1) X + 1 = 1 X 0 = 0 2) X + XY = X X(X + Y) CS 3402 --Digital Logic Boolean Algebra 8
Laws and Theorems Boundness law: A+1=1 A 0=0 Identity law: A+0=A A 1=1 Idempotent Theorem: A+A=A A A=A Involution Theorem: (A ) = A Theorem of complementarity: A + A = 1 A A = 0 Commutative law: A+B=B+A AB = BA Associative law: A + (B + C) = (A + B) + C A(BC) = (AB)C Distributive law: A (B + C) = AB + AC A + BC = (A+B)(A+C) De. Morgan's Theorem: (A + B) = A B (AB) = A + B Absorption law: A + AB = A A(A + B) = A Consensus Theorem: AB+BC+A C = AB+A C (A+B)(B+C)(A +C) = (A+B)(A +C) CS 3402 --Digital Logic Boolean Algebra 9
Examples Simplify the following Boolean expressions to a minimum number of literals 1) 2) 3) 4) 5) 6) X + X Y X + Y XY + X Y Y X (X + Y ) XY X Y Z + X YZ + XY X Z + XY XY + X Z + YZ XY + X Z (X+Y)(X +Z)(Y+Z) X Y + XZ CS 3402 --Digital Logic Boolean Algebra 10
Switching Functions • A switching algebra is a Boolean algebra whose set B contains only two values 0 and 1. • A switching function uniquely maps Bn to B. f (X, Y, Z) = XY + X Z + YZ If X = 0, Y = 1, Z = 0, then f (X, Y, Z) = 0. If X = 0, Y = 1, Z = 1, then f (X, Y, Z) = 1. CS 3402 --Digital Logic Boolean Algebra 11
Truth Tables A switching function can be represented as a Boolean function or in a tabular form called truth table. A truth table is a list of possible combinations of inputs that correspond to the values of the switching function (output). CS 3402 --Digital Logic Boolean Algebra 12
Example Truth table of f (X, Y, Z) = XY + X Z + YZ X Y Z f 0 0 0 1 1 0 0 0 1 1 1 1 0 1 1 1 CS 3402 --Digital Logic Boolean Algebra 13
Switching Functions There are 16 possible switching functions of two variables: X Y 0 XY X X Y Y OR NOR = Y X 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 CS 3402 --Digital Logic Boolean Algebra NAND 1 1 1 1 1 0 0 1 1 1 0 1 14
Canonical and Standard Forms • Minterms • Maxterms CS 3402 --Digital Logic Boolean Algebra 15
Minterms For two binary variables A and B combined with an AND operation, the minterms or standard products are: AB, AB , A B, and A B. That is, two binary variables provide 22 = 4 possible combinations (minterms. ) n variables have 2 n minterms. Each minterm has each variable being primed if the corresponding bit of the binary number is a 0 and unprimed if a 1. CS 3402 --Digital Logic Boolean Algebra 16
Maxterms Similarly, two binary variables A and B combined with an OR operation, the maxterms or standard sums are: A+B, A+B , A +B, and A +B. That is, two binary variables provide 22 = 4 possible combinations (maxterms. ) n variables have 2 n maxterms. Each maxterm has each variable being primed if the corresponding bit of the binary number is a 1 and unprimed if a 0. A maxterm is the complement of its corresponding minterm, and vice versa. CS 3402 --Digital Logic Boolean Algebra 17
Boolean function • Sum of Products (or Minterms) – A Boolean function can be expressed as a sum of minterms. The minterms whose sum defines the Boolean function are those that give the 1's of the function in a truth table. • Product of Sums (or Maxterms) – A Boolean function can be expressed as a product of maxterms. The maxterms whose sum defines the Boolean function are those that give the 0's of the function in a truth table. CS 3402 --Digital Logic Boolean Algebra 18
Minterms and Maxterms for Three Binary Variables Input Minterm Maxterm X Y Z Term Designation 0 0 0 X Y Z m 0 X+Y+Z M 0 0 0 1 X Y Z m 1 X+Y+Z M 1 0 X YZ m 2 X+Y +Z M 2 0 1 1 X YZ m 3 X+Y +Z M 3 1 0 0 XY Z m 4 X +Y+Z M 4 1 0 1 XY Z m 5 X +Y+Z M 5 1 1 0 XYZ m 6 X +Y +Z M 6 1 1 1 XYZ m 7 X +Y +Z M 7 CS 3402 --Digital Logic Boolean Algebra 19
Examples X Y Z Function F 1 Function F 2 0 0 0 0 1 1 0 0 1 0 1 1 1 0 0 1 1 1 CS 3402 --Digital Logic Boolean Algebra 20
Examples F 1 and F 2 can be expressed as a sum of products as follows: F 1 = X Y Z+XY Z +XYZ = m 1+ m 4+ m 7 F 2 = X YZ+XYZ = m 3+ m 5+ m 6 + m 7 F 1 and F 2 can also be expressed as a product of sums as follows: F 1 = (X+Y+Z)(X+Y +Z )(X +Y +Z) = M 0 M 2 M 3 M 5 M 6 F 2 = (X+Y+Z)(X+Y+Z )(X+Y +Z ) = M 0 M 1 M 2 M 4 CS 3402 --Digital Logic Boolean Algebra 21
Notation Boolean functions expressed as a sum of products or product of sums are said to be in canonical form A convenient way to express these function is by using a short notation, decimal form: F 1(X, Y, Z) = m(1, 4, 7) F 2(X, Y, Z) = m(3, 5, 6, 7) or F 1(X, Y, Z) = M(0, 2, 3, 5, 6) F 2(X, Y, Z) = M(0, 1, 2, 4) CS 3402 --Digital Logic Boolean Algebra 22
Standard forms A Boolean function is said to be in standard form if the function contains one, two or any number of literals. For example: F 1 = Y +XY+X YZ or F 2 = X(Y +Z)(X +Y+Z +W) A Boolean function may be expressed in a nonstandard form. For example, the function F = (WX+YZ)(W X +Y Z ) CS 3402 --Digital Logic Boolean Algebra 23
Example 1 1. Given the following truth table. Express F in a canonical minterms and maxterms. CS 3402 --Digital Logic X Y Z F 0 0 0 1 1 0 1 1 1 1 0 1 1 1 Boolean Algebra 24
Example 2 2. Design a digital logic circuit that will activate an alarm if a door or window is open during non-business hours. Assume that Clock Door Window Alarm C = 0 (non-business hours) D = 0 (closed) W = 0 (closed) A = 0 (off) CS 3402 --Digital Logic Boolean Algebra 1 (business hours) 1 (opened) 1 (on) 25
Conversion between canonical form 1. To convert from a sum of products to a product of sums: rewrite the minterm canonical form in a shorthand notation then replace the existing term numbers by the missing numbers. For example: F 1(X, Y, Z) = m(1, 3, 6, 7) = M(0, 2, 4, 5) CS 3402 --Digital Logic Boolean Algebra 26
Conversion between canonical form 2. To convert from a product of sums to a sum of products: rewrite the maxterm canonical form in a shorthand notation then replace the existing term numbers by the missing numbers. For example: F 1(X, Y, Z) = M(0, 2, 4, 5) = m(1, 3, 6, 7) CS 3402 --Digital Logic Boolean Algebra 27
Conversion between canonical form 3. To obtain the minterm (or maxterm) canonical form of the complement, given the Boolean function in a sum of products (or product of sums) form : list the term numbers that are missing in For example: F(X, Y, Z) = m(0, 2, 4, 5) F (X, Y, Z) = m (1, 3, 6, 7) F(X, Y, Z) = M(1, 3, 6, 7) F (X, Y, Z) = M(0, 2, 4, 5) CS 3402 --Digital Logic Boolean Algebra 28
Don't Care Conditions 1) F(A, B, C, D) = m(1, 3, 7, 11, 13, 15) + d(0, 2, 5) 2) F(A, B, C, D) = m(4, 5, 6, 7, 8, 9, 10, 13) + d(0, 7, 15) 3) BCD increment by 1 function. CS 3402 --Digital Logic Boolean Algebra 29
Logic Functions AND Operation Z = X Y Inputs CS 3402 --Digital Logic Boolean Algebra Output X Y Z 0 0 1 1 1 30
Logic Functions OR Operation Z = X + Y Inputs CS 3402 --Digital Logic Boolean Algebra Output X Y Z 0 0 1 1 1 31
Logic Functions NOT Operation Z = X Inputs Output CS 3402 --Digital Logic Boolean Algebra X Z 0 1 1 0 32
Logic Functions NAND Operation Z = (X Y) Inputs CS 3402 --Digital Logic Boolean Algebra Output X Y Z 0 0 1 0 1 1 1 0 33
Logic Functions NOR Operation Z = (X + Y) Inputs CS 3402 --Digital Logic Boolean Algebra Output X Y Z 0 0 1 0 1 0 0 1 1 0 34
Logic Functions XOR Operation Z = X Y Inputs CS 3402 --Digital Logic Boolean Algebra Output X Y Z 0 0 1 1 0 35
Logic Functions XNOR Operation Z = (X Y) Inputs CS 3402 --Digital Logic Boolean Algebra Output X Y Z 0 0 1 0 1 0 0 1 1 1 36
Switching function representations There are 3 ways to represent a switching function: 1) Boolean expression 2) Truth table 3) Logic diagram CS 3402 --Digital Logic Boolean Algebra 37
Positive and Negative Logic CS 3402 --Digital Logic Boolean Algebra 38
Positive and Negative Logic Truth Table Positive Logic Negative Logic x y z low low 0 0 0 1 1 1 low high low 0 1 0 1 high low 1 0 0 0 1 1 high 1 1 1 0 0 0 CS 3402 --Digital Logic Boolean Algebra 39
Positive and Negative Logic Truth Table Positive Logic Negative Logic x y z low low 0 0 1 1 1 0 low high low 0 1 0 0 high low 1 0 0 0 1 0 high 1 1 0 0 0 1 CS 3402 --Digital Logic Boolean Algebra 40
Example: Traffic lights -- to define three signals CS 3402 --Digital Logic Boolean Algebra 41
- Slides: 41