Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI

Similar presentations


Presentation on theme: "Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI"— Presentation transcript:

1 Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI E-mail: droberts@cs.iupui.edu CSCI 240 Boolean Algebra

2 Dale Roberts Boolean Algebra We observed in our introduction that early in the development of computer hardware, a decision was made to use binary circuits because it greatly simplified the electronic circuit design. In order to work with binary circuits, it is helpful to have a conceptual framework to manipulate the circuits algebraically, building only the final “most simple” result. George Boole (1813-1864) developed a mathematical structure to deal with binary operations with just two values. Today, we call these structures Boolean Algebras.

3 Dale Roberts Boolean Algebra Defined A Boolean Algebra B is defined as a 5-tuple {B, +, *, ’, 0, 1} {B, +, *, ’, 0, 1} + and * are binary operators; they have two operands ’ is a unary operator; it has one operand The following five axioms must hold for any elements a, b, c  {0,1}

4 Dale Roberts Axioms Law Form 1 Form 2 Commutative a + b = b + a a * b = b * a Distributive a + (b * c) = (a + b)*(a + c) a * (b + c) = (a * b)+(a * c) Identity a + 0 = a a * 1 = a Complement a + a’ = 1 a * a’ = 0

5 Dale Roberts Boolean Algebra is not regular algebra! We recognize Form 2 of distributive law: a * (b + c) = (a * b)+(a * c) (Multiplication is distributive over addition) Is Form 1 of distributive law is true? a + (b * c) = (a + b)*(a + c) 4 + (3 * 2) =? (4 + 3)(4 + 2) 4 + 6 =? 7 * 6 10 ≠ 42

6 Dale Roberts Terminology Element 0 is called the zero element. In computer science, we’ll call the 0 element “FALSE”. Element 1 is called the unit element. In computer science, we’ll call the 1 element “TRUE”. In computer science, we’ll call the + operation “OR”. The result of + is called sum. In computer science, we’ll call the * operation “AND”. The result of * is called product. In computer science, we’ll call the ’ operation “NOT”. The result of ’ is called complement. Juxtaposition implies * operation: ab = a * b Operator order of precedence is: (), ’, *, +. a+bc = a+(b*c) ≠ (a+b)*c ab’ = a(b’) ≠ (a*b)’

7 Dale Roberts Single Bit Boolean Algebra Define a Boolean Algebra where 0 and 1 are bits. 1’ = 0 and 0’ = 1 +01 001 111 *01000 101

8 Dale Roberts Proof by Truth Table Consider Form 1 of the distributive theorem: a + (b * c) = (a + b)*(a + c). Is it true for a two bit Boolean Algebra? Can prove using a truth table. How many possible combinations of a, b, and c are there? Three variables, each with two values: 2*2*2 = 2 3 = 8 abcb*ca+(b*c)a+ba+c(a+b)*(a+c) 000 001 010 011 100 101 110 111

9 Dale Roberts Proof by Truth Table (cont) Consider Form 1 of the distributive theorem: a + (b * c) = (a + b)*(a + c). Is it true for a two bit Boolean Algebra? Can prove using a truth table. How many possible combinations of a, b, and c are there? Three variables, each with two values: 2*2*2 = 2 3 = 8 abcb*ca+(b*c)a+ba+c(a+b)*(a+c) 00000000 00100010 01000100 01111111 10001111 10101111 11001111 11111111

10 Dale Roberts n-bit Boolean Algebra Single bit Boolean Algebra can be extended to n-bit Boolean Algebra by define sum, product and complement as bit-wise operations Let a = 1101010, b = 1011011 a + b = 1101010 + 1011011 = 1111011 a * b = 1101010 * 1011011 = 1001010 a’ = 1101010’ = 0010101

11 Dale Roberts Principle Duality The dual of a statement S is obtained by interchanging * and +; 0 and 1. Write the dual of (a*1)*(0+a’) = 0. (a+0)+(1*a’) = 1 Did you notice that all the original axioms are duals of each other? Thus, the dual of any theorem in a Boolean Algebra is also a theorem. This is called the Principle of Duality.

12 Dale Roberts Named Theorems All of the following theorems can be proven based on the axioms. They are used so often that they have names. Idempotent a + a = a a * a = a Boundedness a + 1 = 1 a * 0 = 0 Absorption a + (a*b) = a a*(a+b) = a Associative(a+b)+c=a+(b+c)(a*b)*c=a*(b*c) The theorems can be proven for a two-bit Boolean Algebra using a truth table, but you must use the axioms to prove it in general for all Boolean Algebras.

13 Dale Roberts More Named Theorems Involution (a’)’ = a DeMorgan’s (a+b)’ = a’ * b’ (a*b)’=a’ + b’ DeMorgan’s Laws are particularly important in circuit design. It says that you can get rid of a complemented output by complementing all the inputs and changing ANDs to ORs. (More about circuits coming up…)

14 Dale Roberts Proof using Theorems Use the properties of Boolean Algebra to reduce (x + y)(x + x) to x. Warning, make sure you use the laws precisely. (x + y)(x + x) Given (x + y)x Idempotent x(x + y) Commutative xAbsorption Unlike truth tables, proofs using Theorems are valid for any boolean algebra, but just bits.

15 Dale Roberts Standard Form Like regular algebra, Boolean equations can be expressed as a sum of products. Each product is a term of the equation. Consider the term xyx’z. We define a term to be a Fundamental Product (FP) if it does not repeat any literal. Since our term repeats x, is it not FP. You call always minimize a term to make it FP. xyx’z = xx’yz = 0yz (which law) = 0 (which law?) An expression E is sum-of-products form if it is the sum of one ore more FPs, none of which is included in another.

16 Dale Roberts Sum-of-Products Form 1. Consider E=xz’ + y’z + xyz ’. This is a sum of products, but is not sum-of-products form because xz’ is contained within xyz’. i.e. it can be reduced. (which law?) 2. Consider E=xz’ + x’yz’ + xy’z. This is already sum-of-products form. Any non-zero Boolean expression can be changed to sum- of-products form. (By duality, there is also a product-of- sums form, but it is used less often.)

17 Dale Roberts Converting to Sum-of-Products Form 1. Use DeMorgan’s Laws and Involution to move complements inside parenthesis until only variables are complemented. 2. Use distributive law to transform in to sum of products 3. Use commutative, idempotent, and complement laws to transform each term into 0 or FP. 4. Use absorption law to make sum-of- products form.

18 Dale Roberts Example of conversion to sum-of-products form Consider E=((ab)’c)’((a’+c)(b’+c’))’ E=((ab)’’+c’)((a’+c)’+(b’+c’)’) – DeMorgan’s Law E=(ab+c’)(ac’+bc) – DeMorgan’s and Involution Laws E=abac’ + abbc +ac’c’ + bcc’ – Distributive Law E=abc’ + abc + ac’ + 0 – Idempotent and Complement E=ac’ + abc – Absorption Law

19 Dale Roberts Complete Sum-of-Products Form A complete sum-of-products form is a sum-of- products form where each term involves all the variables. (Each term will have the same number of literals. You can add missing variables by multiplying by 1, where 1 is of the form x + x’. Theorem: Every non-zero Boolean expression can be placed in complete sum-of-products form, and it is unique.

20 Dale Roberts Complete Sum-of-Products Example Express E(x,y,z) = (x’ + y)’ + x’y in complete sum- of-products form. E = xy’ + x’y – DeMorgan’s Law. If we didn’t know z was involved, we’d think we were done. E=xy’(z + z’) + x’y(z + z’) E=xy’z + xy’z’ + x’yz + x’yz’ – Distributive Law (Don’t simplify using Absorption, or you’ll take it back out of Complete S-O-P form)

21 Dale RobertsSources Lipschutz, Discrete Mathematics Mowle, A Systematic Approach to Digital Logic Design


Download ppt "Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI"

Similar presentations


Ads by Google