1 / 20

Boolean algebra

Boolean algebra. Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn how to how use Boolean algebra to simplify Booleans expressions. Last time, we saw this expression and converted it to a circuit:. (x + y’)z + x’. Simplifying circuits.

kenisha
Télécharger la présentation

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 • Last time we talked about Boolean functions, Boolean expressions, and truth tables. • Today we’ll learn how to how use Boolean algebra to simplify Booleans expressions. • Last time, we saw this expression and converted it to a circuit: (x + y’)z + x’ ©2000-2002 Howard Huang

  2. Simplifying circuits • The expression and circuit on the previous page are actually equivalent to the simplified ones below: x’ + z • Simpler hardware is always better! • In many cases, the simpler circuit is also faster. • Less hardware means smaller size, which also reduces costs. • Simpler circuits draw less power. • How do we know this circuit is the same as the one on the last page? Boolean algebra

  3. Boolean algebra is special • Boolean algebra gives us a way to simplify Boolean functions, much like regular algebra allows us to simplify mathematical functions. • The AND and OR operations are similar to multiplication and addition: • AND is the same as multiplication for the values 0 and 1 • OR is almost the same as addition, except for 1 + 1. • But there are important differences to watch out for, too. • Boolean algebra uses are only two values. • OR is not quite the same as addition, and NOT is a new operation. Boolean algebra

  4. Formal definition of Boolean algebra • A Boolean algebra requires: • A set of values B, which contains at least two elements 0 and 1 • Two 2-argument operations + and  • A one-argument operation ' • The values and operations must satisfy the axioms below. Boolean algebra

  5. Satisfying the axioms • The operations we chose do satisfy all of the axioms. We can show this by looking at the definitions of our operations. • For example, the axiom x + x’ = 1 is satisfied, because: • We have only two possible values for x: 0 and 1. • The complement of these values are 1 and 0, respectively. • 0 + 1 = 1, and 1 + 0 = 1. Boolean algebra

  6. Proofs with truth tables • We can always prove equivalences using truth tables, to explicitly show that two expressions always produce the same results. • Let’s use truth tables to prove DeMorgan’s law, (x + y)’ = x’y’. • The columns on the left in each table are the inputs. We have two inputs, x and y, so there are four possible input combinations. • The columns on the right, in blue, are outputs. • Intermediate columns can be useful in deriving the outputs. • Since both of the columns in blue are the same, this shows that (x + y)’ and x’y’ really are equivalent. Boolean algebra

  7. Similarities with regular algebra • Several of the axioms (in blue) look just like regular algebraic rules. • The associative laws show that there is no ambiguity in a term such as xyz or x + y + z, so we can use multiple-input primitive gates: Boolean algebra

  8. The complement operation • The magentaaxioms deal with the complement operation, which doesn’t exist in normal algebra. • Most of them almost make sense if you translate them into English: • “It is raining or it is not raining” is always true (x + x’ = 1) • “It is raining and it is not raining” can never be true (x  x’ = 0) • “I am not not handsome” means “I am handsome” ((x’)’ = x) Boolean algebra

  9. DeMorgan’s • DeMorgan’s axioms are especially important for circuit design. (x + y)’ = x’y’(xy)’ = x’ + y’ • We’ve already proved one of these axioms, but here are some rough examples in English. • “I am not rich-or-famous” • This is the same as “I am not rich, and I am not famous.” • In other words, I am nothing. • “I am not old-and-bald” • This is equivalent to “I am not old, or I am not bald.” • I could still be one of the other three possibilities: young and bald, old and hairy, or young and hairy. Boolean algebra

  10. Other differences with regular algebra • Finally, the red axiomsare completely different from regular algebra. • The first three make sense if you think about it logically: • “Blah or true” is always true, even if “blah” is false (x + 1 = 1) • “I am handsome or I am handsome” is redundant (x + x = x) • “I am handsome and I am handsome” is redundant (x  x = x) • The last one, x + yz = (x + y)(x + z), is the trickiest one of the bunch. Boolean algebra

  11. Duality • Look carefully at the left and right columns of axioms. • They are duals, where we’ve: • exchanged all AND operations with OR operations, and • exchanged all 0s with 1s. • The dual of any equation is always true. Boolean algebra

  12. Simplification with axioms • We can now start doing simplifications using these axioms: x’y’ + xyz + x’y = x’(y’ + y) + xyz [ Distributive: x’y’ + x’y = x’(y’ + y) ] = (x’  1) + xyz [ Axiom 7: y’ + y = 1 ] = x’ + xyz [ Axiom 2: x’  1 = x’ ] = (x’ + x)(x’ + yz) [ Distributive ] = 1  (x’ + yz) [ Axiom 7: x’ + x = 1 ] = x’ + yz [ Axiom 2 ] Boolean algebra

  13. Simpler expressions yield simpler hardware • Here are the circuits resulting from the original and simplified expressions on the previous page. Boolean algebra

  14. Some more laws • Here are some more useful equations. • These are usually called laws, because they can all be proven from the more fundamental axioms. • You can also prove them using truth tables. • Notice that each law also has a dual. • Feel free to use these laws in homeworks and exams, if you like. Boolean algebra

  15. The complement of a function • The complement of a function always outputs 0 where the original function output 1, and 1 where the original produced 0. • In a truth table, we can just exchange 0s and 1s in the output column. • On the left is a truth table for f(x,y,z) = x(y’z’ + yz) • On the right is the table for the complement, denoted f’(x,y,z). Boolean algebra

  16. Complementing a function algebraically • When you complement an expression algebraically, you can use DeMorgan’s axiom to keep “pushing” the complement operators inwards: • Another clever method to complement an expression is to take the dual of the expression, and then complement each literal: • If f(x,y,z) =x(y’z’ + yz)… • …the dual of f is x + (y’ + z’)(y + z)… • …then complementing each literal gives x’ + (y + z)(y’ + z’)… • …so f’(x,y,z) = x’ + (y + z)(y’ + z’) 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] Boolean algebra

  17. Standard forms of expressions • We can write expressions in many ways, but some ways are more useful than others. • A sum of products (SOP) expression is characterized by: • There are only OR (sum) operations at the “outermost” level. • Each term in the sum must be a product of literals. • For example: f(x,y,z) = y’ + x’yz’ + xz • The advantage is that a sum of products expression can be implemented using a fairly simple two-level circuit: • Literals are at the “0th” level. • ANDgates are at the first level. • A single OR gate is at the second level. Boolean algebra

  18. Hey! This looks like a truth table! Minterms • A minterm is a special product term, where each input variable appears exactly once. • A function with n variables has up to 2n minterms. For example, a three-variable function like f(x,y,z) has up to 8 minterms: • Each minterm is true for exactly one combination of inputs: x’y’z’ x’y’z x’yz’ x’yz xy’z’ xy’z xyz’ xyz Minterm Is true when… Shorthand x’y’z’ xyz = 000 m0 x’y’z xyz = 001 m1 x’yz’ xyz = 010 m2 x’yz xyz = 011 m3 xy’z’ xyz = 100 m4 xy’z xyz = 101 m5 xyz’ xyz = 110 m6 xyz xyz = 110 m7 Boolean algebra

  19. Sum of minterms form • Every function can be written as a sum of minterms, which is a special kind of sum of products form. • The sum of minterms form for any function is unique. • If you have a truth table for a function, you can write a sum of minterms expression just by picking out the rows of the table where the function output is 1. f = m0 + m1 + m2 + m3 + m6 = m(0,1,2,3,6) = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ f’ = m4 + m5 + m7 = m(4,5,7) = xy’z’ + xy’z + xyz f’ contains all the minterms not in f. Boolean algebra

  20. Summary • We can build complex functions from just the basic Boolean values “true” and “false,” and the operations AND, OR and NOT. • Any Boolean expression can be implemented with a circuit, which uses primitive logic gates to compute products, sums and complements. • We saw two ways to prove equivalence of expressions: • Truth tables show that all possible inputs yield the same results. • Boolean algebra is especially useful for simplifying expressions, and hence circuits. • Expressions can be written in many different ways, so it’s sometimes useful to use standard representations like sums of products or sums of minterms. • Next time we’ll study an alternative, graphical simplification method. Then we’ll start using all this stuff to build and analyze bigger, more useful, circuits. Boolean algebra

More Related