Lecture 3 Boolean Algebra u Logistics n Class
Lecture 3: Boolean Algebra u Logistics n Class email sign up n Homework 1 due on Wednesday n Lab 1 starts this week: go to your session u Last lecture --- Numbers n Binary numbers n Base conversion n Number systems for negative numbers n A/D and D/A conversion u Today’s lecture n Boolean algebra í Axioms í Useful laws and theorems í Examples CSE 370, Lecture 3 1
The “WHY” slide u Boolean Algebra n When we learned numbers like 1, 2, 3, we also then learned how to add, multiply, etc. with them. Boolean Algebra is operations that we can do with 0’s and 1’s. Computers do these operations ALL THE TIME and they are basic building blocks of computation inside your computer program. u Axioms, laws, theorems n We need to know some rules about how those 0’s and 1’s can be operated together. There are similar axioms to decimal number algebra, and there are some laws and theorems that are good for you to use to simplify your operation. CSE 370, Lecture 3 2
How does Boolean Algebra fit into the big picture? u It is part of the Combinational Logic topics (memoryless) n Different from the Sequential logic topics (can store information) u Learning Axioms and theorems of Boolean algebra í Allows you to do design logic functions í Allows you to know how to combine different logic gates í Allows you to simplify or optimize on the complex operations CSE 370, Lecture 3 3
Boolean algebra u A Boolean algebra comprises. . . n A set of elements B n Binary operators {+ , • } Boolean sum and _ product _ n A unary operation { ' } (or { }) example: A’ or A u …and the following axioms n n n n 1. 2. 3. 4. 5. 6. 7. The set B contains Closure: Commutative: Associative: Identity: Distributive: Complementarity: CSE 370, Lecture 3 at least two elements {a a+b is in B a+b = b+a a+(b+c) = (a+b)+c a+0 = a a+(b • c)=(a+b) • (a+c) a+a' = 1 b} with a b a • b is in B a • b = b • a a • (b • c) = (a • b) • c a • 1 = a a • (b+c)=(a • b)+(a • c) a • a' = 0 4
Digital (binary) logic is a Boolean algebra u Substitute n {0, 1} for B n AND for • Boolean Product n OR for + Boolean Sum n NOT for ' u All the axioms hold for binary logic u Definitions n Boolean function í Maps inputs from the set {0, 1} to the set {0, 1} n Boolean expression í An algebraic statement of Boolean variables and operators CSE 370, Lecture 3 5
Logic Gates (AND, OR, Not) & Truth Table u AND X • Y u OR X+Y u NOT X CSE 370, Lecture 3 XY X Y X' X Z Z Y X 0 0 1 1 Y 0 1 Z 0 0 0 1 X 0 0 1 1 Y 0 1 Z 0 1 1 1 X 0 1 Y 1 0 6
Logic functions and Boolean algebra u Any logic function that is expressible as a truth table can be written in Boolean algebra using +, • , and ' X 0 0 1 1 Y 0 1 Z 0 0 0 1 X 0 0 1 1 Y 0 1 CSE 370, Lecture 3 Z=X • Y X' 1 1 0 0 Y' 1 0 X 0 0 1 1 X • Y X' • Y' 0 1 0 Z 1 0 0 1 Y 0 1 X' 1 1 0 0 Z 0 1 0 0 Z=X' • Y Z=(X • Y)+(X' • Y') 7
Some notation u Priorities: u Variables are sometimes called literals CSE 370, Lecture 3 8
Two key concepts u Duality (a meta-theorem— a theorem about theorems) n All Boolean expressions have logical duals n Any theorem that can be proved is also proved for its dual n Replace: • with +, + with • , 0 with 1, and 1 with 0 n Leave the variables unchanged u de Morgan’s Theorem n Procedure for complementing Boolean functions n Replace: • with +, + with • , 0 with 1, and 1 with 0 n Replace all variables with their complements CSE 370, Lecture 3 9
Useful laws and theorems Identity: X+0=X Dual: X • 1 = X Null: X+1=1 Dual: X • 0 = 0 Idempotent: X+X=X Dual: X • X = X Involution: (X')' = X Complementarity: X + X' = 1 Dual: X • X' = 0 Commutative: X+Y=Y+X Dual: X • Y = Y • X Associative: (X+Y)+Z=X+(Y+Z) Dual: (X • Y) • Z=X • (Y • Z) Distributive: X • (Y+Z)=(X • Y)+(X • Z) Dual: X+(Y • Z)=(X+Y) • (X+Z) Uniting: X • Y+X • Y'=X CSE 370, Lecture 3 Dual: (X+Y) • (X+Y')=X 10
Useful laws and theorems (con’t) Absorption: X+X • Y=X Dual: X • (X+Y)=X Absorption (#2): (X+Y') • Y=X • Y Dual: (X • Y')+Y=X+Y de Morgan's: Duality: (X+Y+. . . )'=X' • Y' • . . . (X+Y+. . . )D=X • Y • . . . Multiplying & factoring: Consensus: CSE 370, Lecture 3 Dual: (X • Y • . . . )'=X'+Y'+. . . Dual: (X • Y • . . . )D=X+Y+… (X+Y) • (X'+Z)=X • Z+X' • Y Dual: X • Y+X' • Z=(X+Z) • (X'+Y) (X • Y)+(Y • Z)+(X' • Z)= X • Y+X' • Z Dual: (X+Y) • (Y+Z) • (X'+Z)=(X+Y) • (X'+Z) 11
Proving theorems u Example 1: Prove the uniting theorem-- X • Y+X • Y'=X Distributive Complementarity Identity X • Y+X • Y' = X • (Y+Y') = X • (1) =X u Example 2: Prove the absorption theorem-- X+X • Y=X Identity Distributive Null Identity CSE 370, Lecture 3 X+X • Y = (X • 1)+(X • Y) = X • (1+Y) = X • (1) =X 12
Proving theorems u Example 3: Prove the consensus theorem-(XY)+(YZ)+(X'Z)= XY+X'Z Complementarity Distributive XY+YZ+X'Z = XY+(X+X')YZ + X'Z = XYZ+XY+X'YZ+X'Z íUse absorption {AB+A=A} with A=XY and B=Z Rearrange terms = XY+X'YZ+X'Z = XY+X'Z íUse absorption {AB+A=A} with A=X'Z and B=Y XY+YZ+X'Z = XY+X'Z CSE 370, Lecture 3 13
de Morgan’s Theorem u Use de Morgan’s Theorem to find complements u Example: F=(A+B) • (A’+C), so F’=(A’ • B’)+(A • C’) A B 0 0 0 1 0 1 1 1 1 CSE 370, Lecture 3 C 0 1 0 1 F 0 0 1 1 0 1 A 0 0 1 1 B 0 0 1 1 C 0 1 0 1 F’ 1 1 0 0 1 0 14
- Slides: 14