* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Computer Organization I
Birkhoff's representation theorem wikipedia , lookup
Linear algebra wikipedia , lookup
Complexification (Lie group) wikipedia , lookup
Universal enveloping algebra wikipedia , lookup
Homological algebra wikipedia , lookup
Congruence lattice problem wikipedia , lookup
Propositional calculus wikipedia , lookup
Exterior algebra wikipedia , lookup
Geometric algebra wikipedia , lookup
Boolean satisfiability problem wikipedia , lookup
Clifford algebra wikipedia , lookup
Computer Organization I Lecture 5: Boolean Algebra Overview Why Studying Boolean Algebra in Circuit? Basic Operation Rules in Boolean Algebra How to Simplify Logic Expression? Objectives Understand Boolean algebra is the theoretic foundation to analyze the operation of logic circuits Familiar with the rules and theorems of Boolean algebra Know how to simplify the logic expression Why Studying Boolean Algebra? • Boolean algebra used to simplify or optimize logic circuit given logic expression Y = A + B C, truth table is unique, however, the expression and logic circuit diagram are not…for example: Truth Table Y =A + B· C is equivalent to Y = AB +AB + B· C ABC Y = A + B 000 0 001 1 010 0 011 0 100 1 101 1 110 1 111 1 ·C Why Studying Boolean Algebra? • Boolean algebra used to simplify or optimize logic circuit A B Logic Diagram Y = A + B· C Y C A Logic Diagram Y = AB +AB + B· C Y B C Comparing these two diagrams, it is obvious that the circuit of the second expression is more complex than the circuit in the first expression even though both expressions implement the same function. Using boolean algebra can get the simplest expression and thus get the optimized circuit Basic Operations in Boolean Algebra - Boolean Addition? In Boolean algebra, a variable is a symbol used to represent an action, a condition, or data. A single variable can only have a value of 1 or 0. The complement represents the inverse of a variable and is indicated with an overbar. Thus, the complement of A is A. A literal is a variable or its complement. Addition is equivalent to the OR operation. The sum term is 1 if one or more of the literals are 1. The sum term is zero only if each literal is 0. Determine the values of A, B, and C that make the sum term of the expression A + B + C = 0? Each literal must = 0; therefore A = 1, B = 0 and C = 1. Basic Operations in Boolean Algebra - Boolean Multiplication? In Boolean algebra, multiplication is equivalent to the AND operation. The product of literals forms a product term. The product term will be 1 only if all of the literals are 1. What are the values of the A, B and C if the product term of A.B.C = 1? Each literal must = 1; therefore A = 1, B = 0 and C = 0. Operation Rules in Boolean Algebra - Basic Rules? • Existence of 0-1 1. A + 0 = A A=1 0 Y=1 A=0 0 Y=0 Y=1 A=0 1 Y=1 2. A + 1 = 1 A=1 1 3. A . 0 = 0 A=1 0 Y=0 A=0 0 Y=0 Y=1 A=0 1 Y=0 4. A . 1 = A A=1 1 Operation Rules in Boolean Algebra - Basic Rules? • Idempotence 5. A + A = A A=1 A=1 Y=1 A=0 A=0 Y=0 A=0 A=0 Y=0 6. A . A = A A=1 A=1 Y=1 Operation Rules in Boolean Algebra - Basic Rules? • Existence of Complement 7. A + A = 1 A=1 A=0 Y=1 A=0 A=1 Y=1 8. A . A = 0 A=1 A=0 Y=0 A=0 A=1 Y=0 Operation Rules in Boolean Algebra - Basic Rules? • Involution = 9. A = A A=0 A=1 A=0 A=1 A=0 A=1 Operation Rules in Boolean Algebra - Commutative Laws? The commutative laws are applied to addition and multiplication. For addition, the commutative law states In terms of the result, the order in which variables are ORed makes no difference. A+B=B+A A B is equivalent to A+B B A B+A Operation Rules in Boolean Algebra - Commutative Laws? For multiplication, the commutative law states In terms of the result, the order in which variables are ANDed makes no difference. AB = BA A B is equivalent to AB B A BA Operation Rules in Boolean Algebra - Associative Laws? The associative laws are also applied to addition and multiplication. For addition, the associative law states When ORing more than two variables, the result is the same regardless of the grouping of the variables. A + (B +C) = (A + B) + C A+(B+C) A B C B+C A B C is equivalent to A+B (A+B)+C Operation Rules in Boolean Algebra - Associative Laws? For multiplication, the associative law states When ANDing more than two variables, the result is the same regardless of the grouping of the variables. A(BC) = (AB)C A(BC) A B C BC A B C is equivalent to AB (AB)C Operation Rules in Boolean Algebra - Distributive Laws? The distributive law is the factoring law. A common variable can be factored from an expression just as in ordinary algebra. That is AB + AC = A(B+ C) The distributive law can be illustrated with equivalent circuits: B C A B B+ C X X A A(B+ C) AB A C AC AB + AC Operation Rules in Boolean Algebra - Boolean Operator Precedence? The order of evaluation in a Boolean expression is: 1. 2. 3. 4. Parentheses NOT AND OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D) Operation Rules in Boolean Algebra - Absorption Theorem? A + AB = A Proof Steps A + A·B = A·1+A·B = A · ( 1 + B) = A·1 = A Justification (identity or theorem) X=X·1 X·Y+X·Z= X ·(Y + Z) (Distributive Law) 1+X=1 X·1=X • Our primary reason for doing proofs is to learn: – Careful and efficient use of the identities and theorems of Boolean algebra, and – How to choose the appropriate identity or theorem to apply to make forward progress, irrespective of the application. Operation Rules in Boolean Algebra - Absorption Theorem? According to absorption theorem A + A·B = A, we can derive: Rule 1: A · (A + B) = A Rule 2: A · (A + B) = A · B Rule 3: (A + B) · (A + C) = A + B · C (A + B)(A + C) = AA + AC + AB + BC = A + AC + AB + BC = A(1 + C + B) + BC = A . 1 + BC = A + BC Rule 4: A + A · B = A + B Operation Rules in Boolean Algebra - DeMorgan’s Theorem? DeMorgan’s 1st Theorem The complement of a product of variables is equal to the sum of the complemented variables. AB = A + B Inputs A 0 0 1 1 B 0 1 0 1 Output AB A + B 1 1 1 1 1 1 0 0 Operation Rules in Boolean Algebra - DeMorgan’s Theorem? Proof of DeMorgan’s 1st Theorem In order to prove AB = A + B we need to prove: (1) A + B + AB = 1 and (2) (A + B ) · AB = 0 A + B + AB = (A + B + A) (A + B +B) = (1 + B) (1 + A) =1 (A + B ) · AB = A AB + B AB = 0 Operation Rules in Boolean Algebra - DeMorgan’s Theorem? DeMorgan’s 2nd Theorem The complement of a sum of variables is equal to the product of the complemented variables. A+B=A.B Inputs A 0 0 1 1 B 0 1 0 1 Output A + B AB 1 1 0 0 0 0 0 0 Operation Rules in Boolean Algebra - DeMorgan’s Theorem? Proof of DeMorgan’s 2nd Theorem In order to prove A + B = A . B we need to prove: (1) A · B + A + B = 1 and (2) (A · B ) · (A + B) = 0 A · B + A + B = (A + B + A) (B + A +B) = (1 + B) (1 + A) =1 (A · B ) · (A + B) = A (A · B) + B (A · B) = 0 Operation Rules in Boolean Algebra - DeMorgan’s Theorem? Apply DeMorgan’s theorem to remove the overbar covering both terms from the expression X = C + D. To apply DeMorgan’s theorem to the expression, you can break the overbar covering both terms and change the sign between the terms. This results in = X = C . D. Deleting the double bar gives X = C . D. Boolean Analysis of Logic Circuits Combinational logic circuits can be analyzed by writing the expression for each gate and combining the expressions according to the rules for Boolean algebra. Apply Boolean algebra to derive the expression for X. Write the expression for each gate: A B (A + B ) C (A + B ) X = C (A + B )+ D C D Applying DeMorgan’s theorem and the distribution law: X = C (A B) + D = A B C + D Logic Expression Simplification • An application of Boolean algebra • Simplify to contain the smallest number of literals (complemented and uncomplemented variables): A B + A C D + A BD + A C D + A BC D = AB + ABCD + A C D + A C D + A B D = AB + AB(CD) + A C (D + D) + A B D = AB + A C + A B D = B(A + AD) +AC = B (A + D) + A C, there are 5 literals How to Calculate Complementing Functions • Use DeMorgan's Theorem to complement a function: 1. Interchange AND and OR operators 2. Complement each constant value and literal • Example: Complement F = xy z + xyz F = (x + y + z)(x + y + z) • Example: Complement G = (a + bc)d + e G= Chapter 2 - Part 1 27 Summary • Basic Operation Rules and Laws in Boolean Algebra • How to Simplify Logic Expression Thank you Q&A