1 / 46

Boolean Algebra

Boolean Algebra. Chapter 10. What is Boolean Algebra?. A minor generalization of propositional logic. In general, an algebra is any mathematical structure satisfying certain standard algebraic axioms. Such as associative/commutative/transitive laws, etc.

avent
Download Presentation

Boolean Algebra

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Boolean Algebra Chapter 10

  2. What is Boolean Algebra? • A minor generalization of propositional logic. • In general, an algebra is any mathematical structure satisfying certain standard algebraic axioms. • Such as associative/commutative/transitive laws, etc. • General theorems that are proved about an algebra then apply to any structure satisfying these axioms. Claude Shannon’sMaster’s thesis! (c)2001-2003, Michael P. Frank

  3. What is Boolean Algebra? • Boolean algebra just generalizes the rules of propositional logic to sets other than {T,F}. • E.g., to the set {0,1} of base-2 digits, or the set {VL, VH} of low and high voltage levels in a circuit. • We will see that this algebraic perspective lends itself to the design of digital logic circuits. Claude Shannon’sMaster’s thesis! (c)2001-2003, Michael P. Frank

  4. Boolean Algebra Operations • Or (+) • 1 + 1 = 1 1 + 0 = 1 0 + 1 = 1 0 + 0 = 0 • AND (· or no operator like multiplication) • 1 · 1 = 1 1 · 0 = 0 0 · 1 = 0 0 · 0 = 0 • Complement or NOT • 1 = 0 0 = 1

  5. Complement, Sum, Product • Correspond to logical NOT, OR, and AND. • We will denote the two logic values as0:≡F and 1:≡T, instead of False and True. • Using numbers encourages algebraic thinking. • New, more algebraic-looking notation for the most common Boolean operators: Precedence order→ (c)2001-2003, Michael P. Frank

  6. Example 1 • 1 · 0 + (0 + 1) = • 0 + (1) = • 0 + 0 = • 0

  7. Boolean equivalents, operations on Boolean expressions • Two Boolean expressions e1 and e2 that represent the exact same function f are called equivalent. We write e1e2, or just e1=e2. • Implicitly, the two expressions have the same value for all values of the free variables appearing in e1 and e2. (c)2001-2003, Michael P. Frank

  8. Boolean equivalents, operations on Boolean expressions • The operators ¯, +, and · can be extended from operating on expressions to operating on the functions that they represent, in the obvious way. (c)2001-2003, Michael P. Frank

  9. Double complement: x = x Idempotent laws: x + x = x, x · x = x Identity laws: x + 0 = x, x · 1 = x Domination laws: x + 1 = 1, x · 0 = 0 Commutative laws: x + y = y + x, x · y = y · x Associative laws: x + (y + z) = (x + y) + z x· (y · z) = (x· y) · z Distributive laws: x + y·z = (x + y)·(x + z) x · (y + z) = x·y + x·z De Morgan’s laws: (x · y) = x + y, (x + y) = x · y Absorption laws: x + x·y = x, x · (x + y) = x Some popular Boolean identities ← Not truein ordinaryalgebras. also, the Unit Property: x + x = 1 and Zero Property: x· x = 0 (c)2001-2003, Michael P. Frank

  10. Duality • The dualed of a Boolean expression e representing function f is obtained by exchanging + with ·, and 0 with 1 in e. • The function represented by ed is denoted fd. (c)2001-2003, Michael P. Frank

  11. Duality • Duality principle: If e1e2 then e1de2d. • Example: The equivalence x(x+y) = ximplies (and is implied by) x + xy = x. (c)2001-2003, Michael P. Frank

  12. Representing Boolean Functions 10.2

  13. Example 1 • Find Boolean expressions to represent F(x,y,z) and G(x,y,z) • Table 1, page 709 • F(x,y,z) = xyz • G(x,y,z) = xyz + x’yz’

  14. Sum-of-Products Expansions • Theorem: Any Boolean function can be represented as a sum of products of variables and their complements. • Proof: By construction from the function’s truth table. For each row that is 1, include a term in the sum that is a product representing the condition that the variables have the values given for that row. Show an example on the board. (c)2001-2003, Michael P. Frank

  15. Sum-of-Products Expansions • Theorem: Any Boolean function can be represented as a sum of products of variables and their complements. • Proof: By construction from the function’s truth table. For each row that is 1, include a term in the sum that is a product representing the condition that the variables have the values given for that row. (c)2001-2003, Michael P. Frank

  16. See Table 1 page 709 • F(x,y,z) = xy’z • G(x,y,z) = xyz’ + x’yz’ (c)2001-2003, Michael P. Frank

  17. Literals, Minterms, DNF • A literal is a Boolean variable or its complement. • A minterm of Boolean variables x1,…,xn is a Boolean product of n literals y1…yn, where yi is either the literal xi or its complement xi. • Note that at most one minterm can have the value 1. • ab' c is a minterm • a+b'+c is a maxterm (c)2001-2003, Michael P. Frank

  18. Literals, Minterms, DNF • The disjunctive normal form (DNF) of a degree-n Boolean function f is the unique sum of minterms of the variables x1,…,xn that represents f. • A.k.a. the sum-of-products expansion of f. (c)2001-2003, Michael P. Frank

  19. Find DNF of F(x,y,z) = (x+y)z’ F(x,y,z) = (x+y)z’ = xz’ + yz’ Distributive = x1z’ + 1yz’ Identity = x(y + y’)z’ + (x + x’)yz’ Unit = xyz’ + xy’z’ + xyz’ + x’yz’ Distributive = xyz’ + xy’z’ + x’yz’ Idemp (1&3) (c)2001-2003, Michael P. Frank

  20. Conjunctive Normal Form • A maxterm is a sum of literals. • CNF is a product-of-maxterms representation. • To find the CNF representation for f, • take the DNF representation for complement f, f = ∑i∏j yi,j • and then complement both sides & apply DeMorgan’s laws to get: f = ∏i∑jyi,j Can also get CNF moredirectly, using the 0rows of the truth table; Get DNF, then negate (c)2001-2003, Michael P. Frank

  21. Find CNF of F(x,y,z) = (x+y)z’ F(x,y,z) = (x+y)z’ Table 1 p 710 = xyz + xy’z + x’yz + x’y’z + x’y’z’ DNF of 0’s = (xyz + xy’z + x’yz + x’y’z + x’y’z’)’ Negate = (x’+y’+z’)(x’+y+z’)(x+y’+z’)(x+y+z’)(x+y+z) Distribute / DeMorgans (c)2001-2003, Michael P. Frank

  22. Logic Gates 10.3

  23. §10.3 – Logic Gates • Inverter, Or, And gate symbols. • Multi-input gates. • Logic circuits and examples. • Adders, “half,” “full,” and n-bit. (c)2001-2003, Michael P. Frank

  24. Logic Gate Symbols x • Inverter (logical NOT,Boolean complement). • AND gate (Booleanproduct). • OR gate (Boolean sum). • XOR gate (exclusive-OR,sum mod 2). x x·y y x x+y y x x⊕y y (c)2001-2003, Michael P. Frank

  25. Basic logic gates • Not • And • Or • Nand • Nor • Xor

  26. NAND, NOR, XNOR • Just like the earlier icons,but with a small circle onthe gate’s output. • Denotes that output is complemented. • The circles can also be placed on inputs. • Means, input is complementedbefore being used. x y x y x y (c)2001-2003, Michael P. Frank

  27. Multi-input AND, OR, XOR • Can extend these gates to arbitrarilymany inputs. • Two commonlyseen drawing styles: • Note that the second style keeps the gate icon relatively small. x1 x1x2x3 x2 x3 x1⋮ x5 x1…x5 (c)2001-2003, Michael P. Frank

  28. Rosen, §10.3 question 1 • Find the output of the following circuit • Answer: (x+y)y • Or (xy)y __

  29. (x+y)y y Rosen, §10.3 question 1 • Find the output of the following circuit • Answer: (x+y)y • Or (xy)y x+y __

  30. ___ _ _ Rosen, §10.3 question 2 • Find the output of the following circuit • Answer: xy • Or (xy) ≡ xy

  31. ___ _ _ x y x y x y Rosen, §10.3 question 2 • Find the output of the following circuit • Answer: xy • Or (xy) ≡ xy

  32. Rosen, §10.3 question 6 • Write the circuits for the following Boolean algebraic expressions • x+y __

  33. x+y x Rosen, §10.3 question 6 • Write the circuits for the following Boolean algebraic expressions • x+y __

  34. Rosen, §10.3 question 6 • Write the circuits for the following Boolean algebraic expressions • (x+y)x _______

  35. (x+y)x x+y Rosen, §10.3 question 6 • Write the circuits for the following Boolean algebraic expressions • (x+y)x _______ x+y

  36. Writing xor using and/or/not • p  q  (p  q)  ¬(p  q) • x  y  (x + y)(xy) ____ x+y (x+y)(xy) xy xy

  37. How to add binary numbers • Consider adding two 1-bit binary numbers x and y • 0+0 = 0 • 0+1 = 1 • 1+0 = 1 • 1+1 = 10 • Carry is x AND y • Sum is x XOR y • The circuit to compute this is called a half-adder

  38. The half-adder • Sum = x XOR y • Carry = x AND y

  39. Using half adders • We can then use a half-adder to compute the sum of two Boolean numbers 1 0 0 1 1 0 0 + 1 1 1 0 ? 0 1 0

  40. The full adder • The “HA” boxes are half-adders

  41. The full adder • The full circuitry of the full adder

  42. Adding bigger binary numbers • Just chain full adders together

  43. S-R Flip-flops • Consider the following circuit: • Set • Reset • What does it do? Set High/ Reset Low Q (output) Q’

  44. §10.4 – Minimizing Circuits • Karnaugh Maps • Don’t care conditions • The Quine-McCluskey Method (c)2001-2003, Michael P. Frank

  45. Goals of Circuit Minimization • (1) Minimize the number of primitive Boolean logic gates needed to implement the circuit. • Ultimately, this also roughly minimizes the number of transistors, the chip area, and the cost. • Also roughly minimizes the energy expenditure • among traditional irreversible circuits. • This will be our focus. • (2) It is also often useful to minimize the number of combinational stages or logical depth of the circuit. • This roughly minimizes the delay or latency through the circuit, the time between input and output. (c)2001-2003, Michael P. Frank

  46. Minimizing DNF Expressions • Using DNF (or CNF) guarantees there is always some circuit that implements any desired Boolean function. • However, it may be far larger than needed! • We would like to find the smallest sum-of-products expression that yields a given function. • This will yield a fairly small circuit. • However, circuits of other forms (not CNF or DNF) might be even smaller for complex functions. (c)2001-2003, Michael P. Frank

More Related