1 / 58

Boolean Algebra and Standart Forms of Expression

Boolean Algebra and Standart Forms of Expression. Overview. Switching algebra Axioms Theorems Algebraic m inimization Standard forms Sum-of-minterms Product-of-maxterms Other Logic Gates. Combinational Circuits. A combinational circuit has one or more digital inputs

jolene-moon
Download Presentation

Boolean Algebra and Standart Forms of Expression

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 and Standart Forms of Expression

  2. Overview • Switching algebra • Axioms • Theorems • Algebraic minimization • Standard forms • Sum-of-minterms • Product-of-maxterms • Other Logic Gates

  3. Combinational Circuits • A combinational circuit has • one or more digital inputs • one or more digital outputs • a functional specificationthat details the value of each output forevery possible combination of valid input values • a timing specification consisting (at minimum) of an upper boundtPD on the required time for the device to compute the specifiedoutput values from an arbitrary set of stable, valid input values

  4. Functional Specifications • There are many ways of specifying thefunction of a combinational device, forexample: • Concise alternatives: • Boolean function • Truth table • Schematic

  5. Combinational Circuits • Combinational logic circuits has no memory! • Outputs are only function of current input combination • Nothing is known about past events • Repeating a sequence of inputs always gives the same output sequence • Sequential logic circuits (covered later) does have memory • Repeating a sequence of inputs can result in an entirely different output sequence

  6. Combinational Logic Example • Circuit controls the level of fluid in a tank • inputs are: • HI - 1 if fluid level is too high, 0 otherwise • LO - 1 if fluid level is too low, 0 otherwise • outputs are: • Pump - 1 to pump fluid into tank, 0 for pump off • Drain - 1 to open tank drain, 0 for drain closed • input to output relationship is described by a truth table

  7. HI 0 0 1 1 LO 0 1 0 1 Pump 0 1 0 x Drain 0 0 1 x Tank level is OK Low level, pump more in High level, drain some out inputs cannot occur HI Pump Drain LO Combinational Logic Example Truth Table Representation Schematic Representation

  8. Terms and Definitions • Logic Expression (Boolean/Switching function) - a mathematical formula consisting of logical operators and variables • f(x,y,z) = (x + y’).z + x’ • Logic Operator - a function that gives a well defined output according to switching algebra • Not (’), And (.), Or (+) • Logic Variable - a symbol representing the two possible switching algebra values of 0 and 1 • x, y, z • Logic Literal - the values 0 and 1 or a logic variable or it’s complement • x, y’, z, x’

  9. Logic Expressions - Precedence • Like standard algebra, switching algebra operators have a precedence of evaluation • NOT operations have the highest precedence • AND operations are next • OR operations are lowest • Parentheses explicitly define the order of operator evaluation • If in doubt, USE PARENTHESES!

  10. Truth Tables • A truth table shows all possible inputs and outputs of a function. • There is one-to-one correspondence between a Boolean function and its turth table. • Remember that each input variable represents either 1 or 0. • Because there are only a finite number of values (1 and 0), truth tables themselves are finite. • A function with n variables has 2n possible combinations of inputs. • Inputs are listed in binary.

  11. f(x,y,z) = (x + y’)z + x’ f(0,0,0) = (0 + 1)0 + 1 = 1 f(0,0,1) = (0 + 1)1 + 1 = 1 f(0,1,0) = (0 + 0)0 + 1 = 1 f(0,1,1) = (0 + 0)1 + 1 = 1 f(1,0,0) = (1 + 1)0 + 0 = 0 f(1,0,1) = (1 + 1)1 + 0 = 1 f(1,1,0) = (1 + 0)0 + 0 = 0 f(1,1,1) = (1 + 0)1 + 0 = 1 Truth Tables

  12. Switching Algebra • Based on Boolean Algebra • Developed by George Boole in 1854 • Basic laws of Boolean Algebra will be implemented as logic gates. • Networks of logic gates allow us to manipulate digital signals • Can perform numerical operations on digital signals such as addition, multiplication • Can perform translations from one binary code to another. • A switching (Boolean) variable X can take on only one of two values: • X = 0, if X ≠ 1 • X = 1, if X ≠ 0

  13. X 0 1 X 1 0 X X Switching Algebra Operations - NOT • Unary complement/inversion operation • Usually shown as overbar , other forms are ~X, X’ X

  14. X 0 0 1 1 Y 0 1 0 1 X·Y 0 0 0 1 Switching Algebra Operations - AND • Also known as the conjunction operation; output is trueonly if all inputs are true • Algebraic operators are ‘·’, ‘&’, ‘’

  15. X 0 0 1 1 Y 0 1 0 1 X+Y 0 1 1 1 Switching Algebra Operations - OR • Also known as the disjunction operation; output is trueif any input is true • Algebraic operators are ‘+’, ‘|’, ‘’

  16. Switching Algebra Axioms

  17. Single-Variable Theorems

  18. Prove X + 0 = X (a) Keep axioms handy (b) Elaborate cases: if X = 0, have X + 0 = 0 + 0 = 0 = X if X = 1, have X + 0 = 1 + 0 = 1 = X

  19. Duality Principle of Boolean Algebra • How to apply the duality principle? • 1’s and 0’s are interchanged. • AND or OR operators are interchanged. • Variables are left unchanged. • Dual theorem is still true!

  20. (T12) X + X’ . Y = X + Y (T12’) X . (X’ + Y) = X.Y Two- and Three-Variable Theorems

  21. Prove (X.Y).Z=X.(Y.Z) Same output

  22. Prove (X.Y)+(X.Z)=X.(Y+Z) Same output

  23. DeMorgan’s Theorem • (x + y)’ = x’y’ <=> (x . y)’ = x’ + y’ • General form of the DeMorgan’s theorem:

  24. Complementing a Function Algebraically • You can use DeMorgan’s law to find out the complement of a Boolean Function f(x,y,z) = x(y’z’ + yz) f’(x,y,z)= ( x(y’z’ + yz) )’ [ complement both sides ] = x’ + (y’z’ + yz)’ [ because (xy)’ = x’ + y’ ] = x’ + (y’z’)’ (yz)’ [ because (x + y)’ = x’ y’ ] = x’ + (y + z)(y’ + z’) [ because (xy)’ = x’ + y’, twice]

  25. Logic Expression Minimization • Goal is to find an equivalent of an original logic expression that: • has fewer variables per term • has fewer terms • needs less logic to implement • There are three main manual methods • Algebraic minimization • Karnaugh Map minimization • Quine-McCluskey (tabular) minimization

  26. Algebraic Minimization • Process is to apply the switching algebra postulates, laws, and theorems to transform the original expression • Hard to recognize when a particular law can be applied • Difficult to know if resulting expression is truly minimal • Very easy to make a mistake • Incorrect complementation • Dropped variables

  27. Minimization via Adjacency • Adjacency is easy to use; very powerful • Look for two terms that are identical except for one variable • Application removes one term and one variable from the remaining term A.B.C.D’ + A.B.C.D = (A.B.C).D’ + (A.B.C).D = (A.B.C).(D’ + D) = A.B.C

  28. (T12) X + X’ . Y = X + Y (T12’) X . (X’ + Y) = X.Y Simplification with Axioms x’y’ + xyz + x’y [T8; x’y’ + x’y = x’(y’ + y) ] = x’(y’ + y) + xyz [T5; y’ + y = 1 ] = x’. 1 + xyz [T1’; x’. 1 = x’ ] = x’ + xyz [T8: x’ + xyz = (x’ + x) (x’ + yz)] = (x’ + x)(x’ + yz) [T5; x’ + x = 1 ] = 1 . (x’ + yz) [T1’: 1 . (x’ + yz) = x’ + yz] = x’ + yz [Axiom 2 ]

  29. (T12) X + X’ . Y = X + Y (T12’) X . (X’ + Y) = X.Y Proving Consensus Theorem • XY + X’Z + YZ [T1’: YZ.1 = YZ] = XY + X’Z + YZ. 1 [T5: X + X’ = 1] = XY + X’Z + YZ(X + X’) [T8: YZ(X + X’) = XYZ + X’YZ] = XY + X’Z + XYZ + X’YZ = XY.1 + XYZ + X’Z.1 + X’YZ [T1’: XY.1 = XY, X’Z.1 = X’Z] = XY(1 + Z) + X’Z(1 + Y) [T8: XY.1+ XYZ = XY(1 + Z)] = XY + X’Z

  30. (x + y’).z + x’ Boolean Expressions and Circuits • Any Boolean expressioncan be converted into a circuit by combining basicgates. • The precedences are explicit in a circuit. • Make sure thatthe hardware does operations in the right order!

  31. How Simplification Helps? • Here are two different but equivalent circuits • In general the one with fewer gates is “better”: • It costs less to build • It requires less power • But we had to do some work to find the second form x’y’ + xyz + x’y = x’(y’ + y) + xyz = x’1 + xyz = x’ + xyz = (x’ + x)(x’ + yz) = 1  (x’ + yz) = x’ + yz

  32. Another Example F= X’YZ+ X’YZ’+XZ = X’Y(Z+Z’)+XZ = X’Y . 1 + XZ = X’Y+ XZ

  33. Standard Expression Forms • Two standardexpression forms: • Sum-of-products • Sum-of-minterms • OR of AND terms • Product-of-sums • Product-of-maxterms • AND of OR terms

  34. Minterms • A minterm is a special product of literals • Each input variable, either complemented or uncomplemented, appears exactly once • Each minterm is 1 for exactly one combination of inputs, and 0 for the others • A function with n variables has 2n minterms (since each variable can appear complemented or not) • A three-variable function, such as f(x,y,z), has 23 = 8 minterms

  35. Minterms

  36. Sum of Minterms Form • Every function can be written as a sum of minterms • A special kind of sum of products form • The sum of minterms form for any function is unique • Converting a truth table tosum of minterms form: • Logical sum of all the minterms that produce a 1 in the truth table

  37. Sum of Minterms Form f = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ = m0 + m1 + m2 + m3 + m6 = m(0,1,2,3,6) f’ = xy’z’ + xy’z + xyz = m4 + m5 + m7 = m(4,5,7) f’ contains all the minterms not in f • A function that includes all the 2^n minterms is equal to logic 1 • G(X,Y)= m(0,1,2,3)= 1

  38. Sum of Products Form • The sum-of-minterms form is a standard algebraic expression that is obtained from a truth table • When we simplify a function in SoM form by • reducing the number of product terms or • reducing the number of literals in the terms the simplified expression is said to be in Sum-of-Products form

  39. Sum of Products Form • Sum of products expression can be implemented using a two-level circuit • literals and their complements at the “0th” level • AND gates at the first level • a single OR gate at the second level F= m(0,1,2,3,4,5,7) (SoM) = Y’ + X’YZ’ + XY (SoP)

  40. Maxterms • A maxterm is a special sum of literals • Each input variable, either complemented or uncomplemented, appears exactly once • Each maxterm is 0 for exactly one combination of inputs, and 1 for the others • A function with n variables has 2nmaxterms

  41. Maxterms

  42. Product of Maxterms Form • Every function can be written as a product of maxterms • A special kind of product of sums form • The product of sums form for any function is unique • Converting a truth table toproduct of maxterms form: • Logical product of all the maxterms that produce a 0 in the truth table

  43. Product of MaxtermsForm f = (x’ + y + z)(x’ + y + z’)(x’ + y’ + z’) = M4 M5 M7 = ∏M(4,5,7) f’ = (x + y + z)(x + y + z’)(x + y’ + z) (x + y’ + z’)(x’ + y’ + z) = M0 M1 M2 M3 M6 = ∏M(0,1,2,3,6) f’ contains all the maxterms not in f • A function that includes all the 2^n maxterms is equal to logic 0 • G(X,Y)= ∏m(0,1,2,3)= 0

  44. Product of Sums Form • The product-of-maxterms form is a standard algebraic expression that is obtained from a truth table • When we simplify a function in PoM form by • reducing the number of sum terms or • reducing the number of literals in the terms, the simplified expression is said to be in Product-of-Sums form

  45. Products of Sums Form • Product of sums expression can be implemented using a two-level circuit • literals and their complements at the “0th” level • OR gates at the first level • a single AND gate at the second level F= ∏M(0,2,3,4,5,6) (PoM) = X(Y’ + Z)(X + Y +Z’) (PoS)

  46. Minterms and maxterms are related • Any minterm mi is the complement of the corresponding maxterm Mi • For example, m4’ = M4 because (xy’z’)’ = x’ + y + z Minterm Shorthand x’y’z’ m0 x’y’z m1 x’yz’ m2 x’yz m3 xy’z’ m4 xy’z m5 xyz’ m6 xyz m7 Maxterm Shorthand x + y + z M0 x + y + z’ M1 x + y’ + z M2 x + y’ + z’ M3 x’ + y + z M4 x’ + y + z’ M5 x’ + y’ + z M6 x’ + y’ + z’ M7

  47. Converting Between Standard Forms • We can convert a sum of minterms to a product of maxterms • In general, just replace the minterms with maxterms, using maxterm numbers that don’t appear in the sum of minterms: • The same thing works for converting from a product of maxterms to a sum of minterms From before f = m(0,1,2,3,6) and f’ = m(4,5,7) = m4 + m5 + m7 complementing (f’)’ = (m4 + m5 + m7)’ so f = m4’ m5’ m7’ [ DeMorgan’s law ] = M4 M5 M7 [ By the previous page ] = ∏ M(4,5,7) f = m(0,1,2,3,6) = ∏ M(4,5,7)

  48. Other Gates • NAND gate: • NOR gate:

  49. NAND and NOR • Both NAND and NOR are universal gates • Universal gate: A gate that alone can be used to implement all • Boolean functions • It is sufficient to show that NAND (NOR) can be used to implement • AND, OR, and NOT operations

  50. (xx)’ = x’ [ because xx = x ] ((xy)’ (xy)’)’ = xy [ from NOT above ] ((xx)’ (yy)’)’= (x’ y’)’ [ xx = x, and yy = y ] = x + y [ DeMorgan’s law ] NANDs are universal! • NOT • AND • OR

More Related