Presentation is loading. Please wait.

Presentation is loading. Please wait.

June 11, 2002©2000-2002 Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn.

Similar presentations


Presentation on theme: "June 11, 2002©2000-2002 Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn."— Presentation transcript:

1 June 11, 2002©2000-2002 Howard Huang1 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’

2 June 11, 2002Boolean algebra2 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?

3 June 11, 2002Boolean algebra3 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.

4 June 11, 2002Boolean algebra4 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.

5 June 11, 2002Boolean algebra5 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.

6 June 11, 2002Boolean algebra6 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.

7 June 11, 2002Boolean algebra7 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:

8 June 11, 2002Boolean algebra8 The complement operation The magenta axioms 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)

9 June 11, 2002Boolean algebra9 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.

10 June 11, 2002Boolean algebra10 Other differences with regular algebra Finally, the red axioms are 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.

11 June 11, 2002Boolean algebra11 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.

12 June 11, 2002Boolean algebra12 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 ]

13 June 11, 2002Boolean algebra13 Simpler expressions yield simpler hardware Here are the circuits resulting from the original and simplified expressions on the previous page.

14 June 11, 2002Boolean algebra14 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.

15 June 11, 2002Boolean algebra15 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).

16 June 11, 2002Boolean algebra16 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]

17 June 11, 2002Boolean algebra17 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. – AND gates are at the first level. – A single OR gate is at the second level.

18 June 11, 2002Boolean algebra18 Minterms A minterm is a special product term, where each input variable appears exactly once. A function with n variables has up to 2 n 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’zx’yz’x’yz xy’z’xy’zxyz’xyz MintermIs true when…Shorthand x’y’z’xyz = 000m 0 x’y’zxyz = 001m 1 x’yz’xyz = 010m 2 x’yzxyz = 011m 3 xy’z’xyz = 100m 4 xy’zxyz = 101m 5 xyz’xyz = 110m 6 xyzxyz = 110m 7 Hey! This looks like a truth table!

19 June 11, 2002Boolean algebra19 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= m 0 + m 1 + m 2 + m 3 + m 6 =  m(0,1,2,3,6) = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ f’= m 4 + m 5 + m 7 =  m(4,5,7) = xy’z’ + xy’z + xyz f’ contains all the minterms not in f.

20 June 11, 2002Boolean algebra20 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.


Download ppt "June 11, 2002©2000-2002 Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn."

Similar presentations


Ads by Google