Boolean Algebra. Sungho Kang. Yonsei University

Similar documents
CHAPTER III BOOLEAN ALGEBRA

CHAPTER III BOOLEAN ALGEBRA

Chapter 2 Combinational Logic Circuits

Chapter 2 : Boolean Algebra and Logic Gates

CHAPTER 2 BOOLEAN ALGEBRA

Midterm1 Review. Jan 24 Armita

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Boolean Algebra CHAPTER 15

MC9211 Computer Organization

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

Chapter 2. Boolean Algebra and Logic Gates

UNIT 5 KARNAUGH MAPS Spring 2011

Unit 2 Boolean Algebra

Logic Synthesis and Verification

Chapter 2 Combinational Logic Circuits

Boolean Algebra and Logic Gates

Unit 2 Boolean Algebra

Chapter 2 Combinational Logic Circuits

Digital Circuit And Logic Design I. Lecture 3

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Boolean Algebra & Logic Gates. By : Ali Mustafa

Sets and Motivation for Boolean algebra

Chapter 2 Boolean Algebra and Logic Gates

CHAPTER 3 BOOLEAN ALGEBRA

Combinational Logic Design Principles

Combinational Logic. Review of Combinational Logic 1

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Boolean Algebra and Logic Design (Class 2.2 1/24/2013) CSE 2441 Introduction to Digital Logic Spring 2013 Instructor Bill Carroll, Professor of CSE

Chapter 3. Boolean Algebra. (continued)

Boolean Algebra. Examples: (B=set of all propositions, or, and, not, T, F) (B=2 A, U,, c, Φ,A)

Heuristic Minimization of Two Level Circuits

UNIT 3 BOOLEAN ALGEBRA (CONT D)

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

Number System conversions

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

BOOLEAN ALGEBRA TRUTH TABLE

Chapter 2: Boolean Algebra and Logic Gates

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

In Module 3, we have learned about Exclusive OR (XOR) gate. Boolean Expression AB + A B = Y also A B = Y. Logic Gate. Truth table

Chapter-2 BOOLEAN ALGEBRA

Tutorial Obtain the principal disjunctive normal form and principal conjunction form of the statement

Week-I. Combinational Logic & Circuits

Chap 2. Combinational Logic Circuits

Combinational Logic Fundamentals

Gate-Level Minimization

ENG2410 Digital Design Combinational Logic Circuits

Digital Logic Design. Malik Najmus Siraj

CHAPTER 5 KARNAUGH MAPS

ECE 238L Boolean Algebra - Part I

Digital Logic Design. Combinational Logic

Fundamental Algorithms for System Modeling, Analysis, and Optimization

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

LATTICE AND BOOLEAN ALGEBRA

CHAPTER 12 Boolean Algebra

3. Abstract Boolean Algebras

BASIC MATHEMATICAL TECHNIQUES

Chapter 2: Switching Algebra and Logic Circuits

Binary Logic and Gates

Advanced Digital Design with the Verilog HDL, Second Edition Michael D. Ciletti Prentice Hall, Pearson Education, 2011

Logic Design. Chapter 2: Introduction to Logic Circuits

Boolean Algebra, Gates and Circuits

Logic Gate Level. Part 2

DIGITAL ELECTRONICS & it0203 Semester 3

Computer Organization I

Karnaugh Maps Objectives

3 Boolean Algebra 3.1 BOOLEAN ALGEBRA

ELC224C. Karnaugh Maps

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Binary logic consists of binary variables and logical operations. The variables are

Chapter 2 Boolean Algebra and Logic Gates

EEA051 - Digital Logic 數位邏輯 吳俊興高雄大學資訊工程學系. September 2004

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

1 Take-home exam and final exam study guide

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

The least element is 0000, the greatest element is 1111.

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Chapter 2 Boolean Algebra and Logic Gates

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Hardware Design I Chap. 2 Basis of logical circuit, logical expression, and logical function

Chapter 2 Boolean Algebra and Logic Gates

Chapter 1. Sets and Numbers

CHAPTER 7. Exercises 17/ / /2 2 0

0 Sets and Induction. Sets

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

CSE 140, Lecture 2 Combinational Logic CK Cheng CSE Dept. UC San Diego

Review for Test 1 : Ch1 5

If f = ABC + ABC + A B C then f = AB C + A BC + AB C + A BC + A B C

ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

Administrative Notes. Chapter 2 <9>

Section Summary. Relations and Functions Properties of Relations. Combining Relations

2 Application of Boolean Algebra Theorems (15 Points - graded for completion only)

1. Prove: A full m- ary tree with i internal vertices contains n = mi + 1 vertices.

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 1 Gate Circuits and Boolean Equations

Answer: A. Answer: C. 3. If (G,.) is a group such that a2 = e, a G, then G is A. abelian group B. non-abelian group C. semi group D.

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

Lecture 2 Review on Digital Logic (Part 1)

Transcription:

Boolean Algebra Sungho Kang Yonsei University

Outline Set, Relations, and Functions Partial Orders Boolean Functions Don t Care Conditions Incomplete Specifications 2

Set Notation $09,3/#0,9 438 v V Element is a member of set v V v V S V S V Element is not a member of set v Cardinality (number of members) of set V Set is a subset of S The empty set (a member of all sets) V The complement of set S U The universe: S = U S U V S V 3

Set Notation $09,3/#0,9 438 Inclusion ( ) Proper Inclusion ( ) Complementation Intersection ( ) Union ( ) Difference 4

Power Sets $09,3/#0,9 438 2 V = { S S V } 2 V The power set of set V (the set of all subsets of set V V V 2 = 2 The cardinality of a power set is a power of 2 5

Power Sets $09,3/#0,9 438 V = {0,1,2} 3-member set 2 V = {, {},{},{}, 0 1 2 { 01, },{ 02, },{ 12, }, {,,} 012 } 1 subset with 0 members 3 subsets with 1 members 3 subsets with 2 members 1 subset with 3 members V V 3 2 = 2 = 2 = 8 Power sets are Boolean Algebras 6

Cartesian Products $09,3/#0,9 438 The Cartesian Product of sets A and B is denoted A x B Suppose A = { 012,,}, B = { ab, }, then A B ={( 0, a),( 0, b),( 1, a),( 1, b),( 2, a),( 2, b)} A = {,,} 012 Set A is unordered (, 1 b) ( ) denotes Ordered Set 7

Binary Relations $09,3/#0,9 438 The Cartesian Product of sets A and B is denoted A x B A x B consists of all possible ordered pairs (a,b) such that a A and b B A subset R A Bis called a Binary Relation Graphs, Matrices, and Boolean Algebras can be viewed as binary relations 8

Binary Relations as Graphs or Matrices $09,3/#0,9 438 E = { ab, cb, cd, cf} A B A = {,}B ac = { bd,, f} a c b d f a b c d 1 0 0 1 1 1 f Bipartite Graph Rectangular Matrix 9

Binary Relations as Graphs or Matrices $09,3/#0,9 438 E = { ab, ac, ad, bd, cd} { aa, bb, cc, dd} V V V = {, a b,, c d} b a d c a 1 1 1 1 b 0 1 0 1 c 0 0 1 1 d 0 0 0 1 Directed Graph Square Matrix 10

Properties of Binary Relations $09,3/#0,9 438 R V V A binary relation can be reflexive, and/or transitive, and/or symmetric, and/or antisymmetric We illustrate these properties on the next few slides 11

Notation for Binary Relations $09,3/#0,9 438 If R A B, we say that A is the domain of the relation R, and that B is the range. If ( ab, ) R, we say that the pair is in the relation R, or arb. 12

Missing Figure 3.2, Page 80 3.1.3 $09,3/#0,9 438 = {, 1234,, } A 2 2 1 2 3 4 1 2 3 4 Graph View 13

Example: Less than or Equal $09,3/#0,9 438 A = B = {,,, 012}, R A B= " " 0 1 2 3 0 1 2 3 0 0 0 0 0 0 14

Example: a times b = 12 $09,3/#0,9 438 V = {,,, 012f}, R V V = {( u, v) u v= 12} R = {( 112, ),( 2, 6),( 3, 4),( 4, 3),( 6, 2),( 121, )} 1 2 3 12 6 4 15

Reflexive Binary Relations V $09,3/#0,9 438 = {, a b,, c d} R V V v V vrv b a c d A binary relation R V V is reflexive if and only if (,) vv R for every vertex v V a b c d 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 1 16

Non-Reflexive Binary Relations V $09,3/#0,9 438 = {, a b,, c d} R V V a v V vrv b c d Non-Reflexivity implies that there exists v V such that (,) vv R. Here d is such a v. a b c d 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 0 17

Transitive Binary Relations $09,3/#0,9 438 If uvw,, V, and urv, and vrw, then urw. b a d c e A binary relation is transitive if and only if every (u,v,w) path is triangulated by a direct (u,w) edge. This is the case here, so R is transitive. 18

Non-Transitive Binary Relations $09,3/#0,9 438 R V V uvw,, V, such that urv, vrw, but urw b a d c e A binary relation is not transitive if there exists a path from u to w,, through v that is not triangulated by a direct (u,w) edge Here (a,c,e) is such a path. Edge (a,e) is missing 19

Symmetric Binary Relations $09,3/#0,9 438 A binary relation is symmetric if and only if every ( uv, ) edge is reciprocated by a (, vu) edge R V V (,) uv R (,) vu R ( urv vru) 1 12 2 3 6 4 20

Non-Symmetric Binary Relations $09,3/#0,9 438 R V V (,) uv Rsuch that (,) vu R A binary relation is non-symmetric if there exists an edge ( uv, ) not reciprocated by an edge (, vu) b a d Edge (c,a) is missing c e 21

Antisymmetric Binary Relations $09,3/#0,9 438 ( u, v) R, ( urv, vru) ( v = u) A binary relation is antisymmetric if and only if no ( uv, ) edge is reciprocated by a (, vu) edge v = u b a d c e Not antisymmetric if any such edge is reciprocated : here b d, d b 22

Functions $09,3/#0,9 438 A function f are binary relations from set A (called the domain) to B (called the range) But, it is required that each a in A be associated with exactly 1 b in B For functions, it cannot be true that both (a,b) in R and (a,c) in R, b different from c 23

The Binary Relation $09,3/#0,9 438 The Binary Relation of Relations to Synthesis/Verification Partial Orders Equivalence Relations Compatibility Relations *DC=don t care Combinational Logic (no DCs) => (0,1) Boolean Algebra Combinational Logic (with DCs) => Big Boolean Algebras Sequential Logic (no DCs) Sequential Logic (with DCs) 24

The Path Relation * $09,3/#0,9 438 b G a d =( V, E) This graph defines path relation c e a b c d e * * * * * {,,, abcd,} e {, cd,} e {,} ce {,} ce {,} ce Relation * is sometimes called Reachability 25

Equivalence Relations $09,3/#0,9 438 b a d c e Note R is reflexive, symmetric, and transitive 26

Equivalence Relations b G a d =( V, E) This graph defines path relation * c e NOT an equivalence relation: E b a d $09,3/#0,9 438 R= {( uv, ) v u u v *, * } G= ( V, R) c e This graph defines R An equivalence relati on: R 27

The Cycle Relation b G a d =( V, E) This graph defines path relation * c e C= {( uv, ) v u} * G= ( V, R) a c b d e $09,3/#0,9 438 These are called the Strongly Connected Components of G 28

Refinement $09,3/#0,9 438 Given any set B a partition of B is a set of subsets B i B with two properties Bi B j = φ for all i j i B i = B Given two partitions P 1 and P 2 of a set S, P 1 is a refinement of P 2 if each block B 1 i of P 1 is a subset of some block of π2 29

Other Binary Relations $09,3/#0,9 438 Partial Orders (Includes Lattices, Boolean Algebras) Reflexive Transitive Antisymmetric Compatibility Relations Reflexive Not Transitive--Almost an equivalence relation Symmetric 30

Functions $09,3/#0,9 438 A function f from A to B written f : A B is a rule that associates exactly one element of B to each element of A A relation from A to B is a function if it is right-unique and if every element of A appears in one pair of the relation A is called the domain of the function B is called the co-domain (range) If y=f(x) : A B, y is image of x Given a domain subset C A IMG(f,C) = { y B x C y = f(x) } preimage of C under f PRE(f,C) = { x A y C y = f(x) } A function f is one-to-one (injective) if x y implies f(x) f(y) A function f is onto (surjective) if for every y B, there exists an element x A, such that f(x) = y 31

Algebraic Systems!,79, 7/078 ( V, ) The pair is called an algebraic system V is a set, called the carrier of the system is a relation on V V = V 2 (, are similar to ) This algebraic system is called a partially ordered set, or poset for short 32

Partially Ordered Sets!,79, 7/078 A poset has two operations, and +, called meet and join (like AND and OR) Sometimes written or ( V,, + ) ( V, +,, ) ( V 2, +,, ) even, since is implied 33

Posets and Hasse Diagrams!,79, 7/078 Integers (Totally Ordered): Missing Figure 3.2 1 2 3 4 1 2 3 4 = {, 1234,, } A 2 2 4 3 2 1 Matrix View Graph View Hasse Diagram Hasse Diagram obtained deleting arrowheads and redundant edges 34

Posets and Hasse Diagrams!,79, 7/078 ( V, +,, ) V = = { a, b, c, d} {( aa, ),( ab, ),( ac, ),( ad, ), ( bb, ),( bd, ), ( cc, ),( cd, ),( dd, )} :distance from top is refelxive, antisymmetric, and transitive: a partial order b a d b c, c b c \ \ Relation Hasse Diagram b d c a 35

Meet!,79, 7/078 An element m of a poset P is a lower bound of elements a and b of P, if and. m a m b m is the greatest lower bound or meet of elements a and b if m is a lower bound of a and b and, for any m such that and also,. m a m b m m a m m b 36

Join: the Dual of Meet!,79, 7/078 m P b a m b m An element of a poset is a upper bound of elements and of P, if and. a m is the least upper bound or join of elements and if m is an upper bound of a and b and, for any m such that and also,. a m b m m m m m a b a b 37

Meet ( ) and Join (+)!,79, 7/078 posets: d d d b b c b c b d a a a a c ab = a cb = a cb = a c a=? a+ b= b c+ b=? c+ b= d d+ b=? 38

POSET Properties!,79, 7/078 Theorem 3.2.1 If x and y have a greatest lower bound (meet), then x x y x j y Similarly, if x and y have a least upper bound (join), then m x x + y Proof: Since meet exists, x x y by definition. Also, since join exists, by definition. x x+ y 39

More POSET Properties!,79, 7/078 Theorem 3.2.2 x y x y = x Proof ( ): This means assume x y. x is a lower bound of x and y (by Def.) x y m x is also the meet of x and y Proof: by contradiction. Suppose x x y. Then m x such that x m where m= x y. But since m was a lower bound of x and y, m x as well. Thus m = x, by the anti-symmetry of posets. Proof ( ): From Definition of meet 40

Well-Ordered!,79, 7/078 If all pairs of elements of a poset are comparable, then the set is totally ordered If every non-empty subset of a totally ordered set has a smallest element, then the set is well-ordered e.g.) Natural numbers Mathematical Induction Given, for all n N, propositions P(n), if P(0) is true for all n>0, if P(n-1) is true then P(n) is true then, for all n N, P(n) is true 41

Lattices!,79, 7/078 Lattice: a poset with both meet and join for every pair of elements of the carrier set Boolean Algebra: a distributed and complemented lattice Every lattice has a unique minimum element and a unique maximum element 42

Lattices and Not Lattices!,79, 7/078 ab = a cb = a a+ b= b c (lattice) d d d b b c b c b d a a a a c + b=? cb = a c a=? c+ b= d d+ b=? (lattice) (Boolean algebra) 43

Examples of Lattices!,79, 7/078 d = 1 b c a = 0 g = 1 e f d b c a = 0 e = 1 b c d a = 0 44

More Notation!,79, 7/078 There Exists a vin set V is denoted by v V The following are equivalent: a b ( ab + a b ) a b and a b ( a + b)( a+ b )) a is true if and only if b is true Does ( a + b)( a+ b ) make sense in a poset? No--Complement is defined for lattices but not for posets 45

Properties of Lattices!,79, 7/078 Meet, Join, Unique maximum (1), mi nimum (0) element are always defin ed Idempotent: Commutative: Associative: Absorptive: x + x = x x x = x x+ y= y+ x x y= y x x+ ( y+ z) = ( x+ y) + z x ( y z) = ( x y) z x ( x+ y) = x x+ ( x y) = x Absorptive properties are fundamental to op timization 46

Duality!,79, 7/078 Every lattice identity is transformed into another identity by interchanging: + and and 0and 1 Example: x ( x+ y) = x x+ ( x y) = x 47

Complementation If x+y=1 and xy=0 then x is the complement of y and vice versa A lattice is complemented if all elements have a complement 48

Examples of Lattices!,79, 7/078 Complemented? yes no yes d = 1 b c a = 0 bc = a= 0 b+ c= d = 1 g = 1 e f d b c a = 0 bc = a= 0 b+ c= d 1 e = 1 b c d a = 0 bc = a= 0 b+ c= e= 1 49

Distributivity!,79, 7/078 Semi-distributivity: x ( y+ z) ( x y) + ( x z) x+ ( y z) ( x+ y) ( x+ z) Proof : 1. x y x (def. of meet) 2. x y y y+ z (def. of meet, join) 3. x y x ( y+ z) (def. of meet) 4. x z x ( y+ z) (mutatis mutandis: y z) 5. x ( y+ z) ( x y) + ( x z) (def. of join) 50

Distributivity!,79, 7/078 Boolean Algebras have full distributivity: x ( y + z) = ( x y) + ( x z) x+ ( y z) = ( x+ y) ( x+ z) Boolean Algebras are complemented. That is, x = y ( x y = 0) and ( x + y = 1) must hold for every x in the carrier of the poset 51

Definition of Boolean Algebra!,79, 7/078 A complemented, distributive lattice is a Boolean lattice or Boolean algebra Idempotent x+x=x xx=x Commutative x+y=y+x xy = yx Associative x+(y+z)=(x+y)+z x(yz) = (xy)z Absorptive x(x+y)=x x+(xy) = x Distributive x+(yz)=(x+y)(x+z) x(y+z) = xy +xz Existence of the complement 52

Are these Lattices Boolean Algebras?!,79, 7/078 Complemented and distributed? yes no no d = 1 g = 1 e = 1 e f b c d b c d b c a = 0 a = 0 a = 0 bc = a= 0 b ( c+ d) = b b+ c= d= 1 bc = a= 0 ab ( + c) = ( bc ) + ( bd ) = a ab + = ac a= 0 b+ c= d 1 53

Fundamental Theorem of Boolean Algebras!,79, 7/078 Every poset which is a Boolean Algebra has a power of 2 elements in its carrier All Boolean Algebras are isomorphic to the p ower set of the carrier. Example: V V = {}, 1 2 = {,} 1 = { 01, } 1 ( = 1) 0 ( = ) 54

Examples of Boolean Algebras!,79, 7/078 V {}, 1 2 {,} 1 { 01,} = V = = 1 ( = 1) 0 ( = ) 1-cube V = {,}, 01 2V = {, 01,,{ 01,}} = {,,,} 0011 1 ( = { 01, } = V) 0 1 0 ( = ) 2-cube 55

Atoms of a Boolean Algebra!,79, 7/078 A Boolean Algebra is a Distributive, Comple mented Lattice The minimal non-zero elements of a Boolean Algebra are called atoms 1 1-atom V n = 2 n atoms 0 0 Can a Boolean Algebra have 0 atoms? 1 0 1 2-atoms NO! 56

Examples of Boolean Algebras!,79, 7/078 A V = {, abc,} = 2 A = { A, { ab, },{ ac, },{ bc, }, abc,,, 3 atoms } 1 ( = V) {,} ab {,} ac {,} bc {} a {} b {} c 0 ( = ) 57

Examples of Boolean Algebras!,79, 7/078 n= A = 4 atoms, n+ 1= 5levels, 2 = 16 elts n A V Level 4--1 elt* Level 3--4 elts Level 2--6 elts Level 1--4 elts Level 0--1 elts = {, abcd,, } = 2 A = { A, {, abc,},{, abd, },{,, acd},{,, bcd}, { ab, },{ ac, },{ ad, },{ bc, },{ bd, },{ cd, } { a},{ b},{ c},{ d} } * elt = element C 4 4 C 4 3 C 4 2 C 1 4 C 0 4 58

Boolean Algebras!,79, 7/078 Theorem 3.2.6 Complementation is unique. proof: Suppose x and y are both complements of ( ). Hence x x + y = 1, xy = 0 y = y( x+ x ) = x y + xy = x y = xy + xx = x ( y+ x) = x Note we used distributivity. Similarly, we have Theorem 3.2.7 (Involution): ( x = ) x 59

Properties of Boolean Algebra!,79, 7/078 x + x y = x+y x(x +y) = xy 60

Lemma: The Isotone Property!,79, 7/078 x y xz yz Proof: By Theorem 3.2.2, x y x = xy, so we get xz = xyz = xyzz =( xz)( yz). Note we used i dempotence, commutativity, and associativity. Then we use Theorem 3.2.2 again to prove the lemma. y x xz yz xz yz z 61

Duality for Boolean Algebras!,79, 7/078 Every Boolean Algebra identity is transformed into another valid identity by interchanging: + and and 0 and 1 and () () This rule not valid for lattices Example: xx = 0 x + x = 1 62

Theorem!,79, 7/078 x y xy = x + y= 1 0 y x Proof: By the isotone property we have x y xy yy xy 0 xy = 0 The second identity follows by duality. 63

Other Theorems!,79, 7/078 DeMorgan s Laws Consensus ( x + y) = x y ( xy) = x + y xy + x z + yz = xy + x z ( x+ y)( x + z)( y+ z) = ( x+ y)( x + z) 64

Consensus Examples!,79, 7/078 1. 3. a bc + abd + bcd = abc + a bd abe + bce + bde + ac' d = abe + be( c + d) + a( c + d) = be( c + d) + a( c + d) Note use of DeMorgan s Law = bce + bde + ac' d 65

Consensus Example!,79, 7/078 5. Is wrong. Replace by a c d+ b c d+ acd+ bcd = ( abd ) + acd + bcd + acd+ bcd = abd + bcd + acd Uphill Move: Note addition of redundant consensus term enables deletion of two other terms by consensus This avoids local minima--a crucial part of the logic minimization paradigm 66

Functions and Boolean Functions 44 0,3:3.9 438 Ordinary functions of 1 variable: f ( x): D R f D R Ordinary functions of 2 real variables: f ( xy, ): D D R f ( D D ) R x y x y 67

Functions and Boolean Functions 44 0,3:3.9 438 1 Boolean functions of n variables: a b f ( x,, x ): B B, B= { 0,, 1} 1 n n f ( x,, x ) ( B B) B 1 n 0 68

Boolean Formulae 44 0,3:3.9 438 Boolean Formulae: Meets and Joins of Variables and Constants F 1 = 0 F = x x + x x 2 1 2 1 2 F = xxx + xx 3 1 1 2 1 2 F = ax + b??? 3 1 a 1 0 b 69

n-variable Boolean Formulae 44 0,3:3.9 438 B = { 0, l, 1} The elements of B are Boolean formulae. Each variable x 1, l, x n is a Boolean formula. If g and h are Boolean formulae, then so are g + h g h g A string is a Boolean formula if and only if it derives from finitely many applications of these rules. 70

Distinct Formulas, Same Function 44 0,3:3.9 438 B = {, 0 a, b,} 1 x x F = x + x G = x + x x 1 2 1 2 1 1 2 Truth Table for f: B 2 B 0000 aaaa bbbb 1111 0ab1 0ab1 0ab1 0ab1 0ab1 aa11 b1b1 1111 0ab1 aa11 b1b1 1111 71

Boolean Functions on Boolean Algebra 44 0,3:3.9 438 B = { 0, l, 1} f ( x1, l, xn) = xi is a Boolean function f( x1, l, xn ) = e B is also If g and h are Boolean, functions then so are g+ h g h g A function is Boolean if and only if it derives from finitely many applications of these rules. 72

Cofactors 44 0,3:3.9 438 Positive Cofactor WRT x 1 : Negative Cofactor WRT x 1 : f = f (, 1 x,, x ) x 1 f = f( 0, x,, x ) x 1 Note: prime denotes complement 2 2 n n f = f (, 1 x,, x ) = f x 2 n x 1 1 f = f ( 0, x,, x ) = f x 2 n x = 0 1 1 = 1 73

Cofactors 44 0,3:3.9 438 Positive Cofactor WRT x 1 : Negative Cofactor WRT x 1 : Example: f = abc d + a cd + bc f = bc d + bc a f = + cd + bc a f = f (, 1 x,, x ) x 1 f = f( 0, x,, x ) x 1 2 2 This term drops out when a is replaced by 1 This term is unaffected n n 74

Cofactors 44 0,3:3.9 438 B= {, 0 a, b,}, 1 f( x): B B f = f( a, x,, x ) x = a 2 n f = f(, 1 x,, x ) x 1 1 Example: 2 f = ax + bx f = aa + bx = 0 + bx = bx x 1 = a 1 2 n n 2 2 2 75

Boole s Expansion Theorem 44 0,3:3.9 438 f = ax + bx f = a0+ bx = bx, f = a1+ bx = a + bx x Example: f ( x1, x2,, xn ) = x f + x f = [ x + f ] [ x + f ] i x i x i x i x i i i i 1 2 2 2 x 2 2 1 1 Sum form: f = x1( bx2) + x1 ( a + bx2) Product form: f = [ x + ( a+ bx )] [ x + ( bx )], 1 2 1 2 76

Variables and Constants 44 0,3:3.9 438 In the previous slide a and b were constants, and the x 1, l, x n were variables. But we can also use letters like a and b as variables, without explicitly stating what the elements of the Bo olean Algebra are. 77

Boole s Expansion (Sum Form) 44 0,3:3.9 438 f = abc d + a cd + bc f = bc d + bc a f = + cd + bc a f = afa + a fa = a( bc d + bc) + a ( cd + bc) 78

Boole s Expansion (Product Form) 44 0,3:3.9 438 f = [ a+ f ][ a + f ] a f = abc d + a cd + bc = [ a+ ( cd + bc)][ a + ( bc d + bc)] = aa + a( bc d + bc) + a ( cd + bc) + ( cd + bc)( bc d + bc) Note application = abc d + a cd + bcd + bc = abc d + a cd + bc a of absorptive law 79

Minterm Canonical Form 44 0,3:3.9 438 The minterm canonical form is a canonical, or st andard way of representing functions. From p10 0, f = x + y + is z represented by millions of distinct Boolean formulas, but just 1 minterm canonical form. Note f = x+ y + z= ( x yz ) Thus some texts refer to f as {0,1,3,4,5,6,7} f = x + y z x + y z x yz+ xy z+ ( 0, 1, 3, 4, ) 80

Minterm Canonical Form 44 0,3:3.9 438 f ( x1, x2, l, xn) xf + xf 1 x 1 x 1 1 xx f + xx f + xx f + xx f 1 2 xx 1 2 xx 1 2 xx 1 2 xx 1 2 1 2 1 2 1 2 r x mx f + x mx x f + m 1 n x mx 1 n 1 n x mx x 1 n 1 n 1 n + xx mx f + xmx f 1 2 n x x mx 1 n x mx 1 2 n 1 n levels of recursive cofactoring create constants 2 n These elementary functions are called minterms n 81

Minterm Canonical Form 44 0,3:3.9 438 Thus a Boolean function is uniquely determined by its values at the corner points 0m00, m01, l, 1m1 f ( x1, x2, l, xn) = xf + xf 1 x 1 x 1 1 xx f + xx f + xx f + xx f 1 2 xx 1 2 xx 1 2 xx 1 2 xx 1 2 1 2 1 2 1 2 r = x mx f + x mx x f + m 1 n x mx 1 n 1 n x mx x 1 n 1 n 1 n + xx mx f + xmx f 1 2 n x x mx 1 n x mx These 2 n constants are aptly called discrimants 1 2 n 1 n 82

Minterm Canonical Form 44 0,3:3.9 438 f = ax + bx, f = a+ bx, f = bx 1 2 x 2 x 2 1 1 = xxa + xx ( a+ b) + xx 0 + xxb x x2 F = ax1 + bx2 xxa + xx + xxb 1 2 1 2 1 2 f: B 2 v B B= {, 0 a, b,} 1 1 2 1 2 1 2 1 2 This function is Boolean (from Boolean Formula) 1 0000 aaaa bbbb 1111 0ab1 0ab1 0ab1 0ab1 aa11 00bb aa11 00bb aa11 00bb aa11 00bb Thus all 16 cofactors match--not just discriminants 83

Now Suppose Truth Table is Given 44 0,3:3.9 438 Here we change 15th cofactor, but leave the 4 discriminants unchanged Since the given function doesn t match at all 16 cofactors, is not Boolean F x x2 F xxa + xx + xxb 1 2 1 2 1 2 1 0000 aaaa bbbb 1111 0ab1 0ab1 0ab1 0ab1 aa11 00bb aa11 001b aa11 00bb aa11 00bb 84

2-Variable Boolean Functions 44 0,3:3.9 438 Minterms 2-variable functions 15 4 f = 1 11 14 3 f = x + y, x + y, x+ y, x+ y 5 10 2 f = x, y, xyxy,, + xyxy, + xy 1 4 1 f = x y, xy, x y, xy 0 0 f = 0 Note that the minterms just depend on the number and names of the variables, independent of the particular Boolean Algebra 85

Boolean Function Algebras 44 0,3:3.9 438 The notation Fn(B) means the Boolean Algebra whose ca rrier is the set of all n-variable Boolean Functions which map B into Fn(B): Bn -> B minterms n B = { 01, } If the atoms of Fn(B) are its n-variable B is called the Base Algebra of the Boolean Function al gebra The atoms of B are called Base Atoms F ( B): B B n 86

Large Boolean Algebras? 44 0,3:3.9 438 When you design an optimal circuit, each gate must be optimized with respect to its Don t Cares Because of Don t Cares, 4 functions of ( xy, ) are equivalence preserving replacements for gate g Optimal Design: pick best such replacement 87

Boolean Algebra F1({ 0, ab,, 1}) Level (= # of atoms) 4 3 2 44 0,3:3.9 438 atoms of F1{ 0, ab,, 1}) are base atoms minterms Each element has 3 Atoms Each element has 2 Atoms 1 Each element has 1 Atom Note: base atoms act like 2 extra literals a y, a = b y 88

Boolean Algebra F ({ 0, 1}) 2 Level (= # of atoms) 4 3 2 1 44 0,3:3.9 438 0 15 poset: { f,, f } i j f f i j minterms(f ) minterms(f ) 3 minterms (3 atoms) 2 minterms (2 atoms) 1 minterm (1 atom) 89

Boolean Algebra 44 0,3:3.9 438 F1({ 0, ab,, 1}) Boolean Algebra of 1-Variable Functions atoms of F1{ 0, ab,,}) 1 base atoms minterms 3 Atoms are 2 Atoms 1 Atom Subalgebras are incompletely specified Boolean Functions (most important) 90

Boolean Subalgebra 44 0,3:3.9 438 Boolean Subalgebra: Interval of 2-Variable Function Lattice The 3-Atom element x + y = xy + xy + x y is ONE of subalgebra 2-Atom elements are atoms of subalgebra 1-Atom element xy is ZERO of subalgebra 91

More On Counting 44 0,3:3.9 438 Level (= # of atoms) 4 3 An algebra (or subalgebra) with n + 1 levels has exactly 2 n elements, because n + 1 levels implies n atoms 2 1 92

A larger Subalgebra 44 0,3:3.9 438 Interval of 2-Variable Function Lattice ONE of algebra (4-Atoms) is also one of this subalgebra 2-Atom elements are atoms of subalgebra 1-Atom element is ZERO of subalgebra 93

Counting Elements of Fn ( B) 44 0,3:3.9 438 For each of the 2 n minterms, the discriminant can be chosen as any of the B elements of B. Therefore, the number of elements of is Examples ( 2 ) A( B) ( 2 ) ( A( B) 2 ) = ( 2 ) = 2 B = { 01, }, A( B) = 1 B n n n n n ( 2 ) 2 4 = 2 B = 2 = 2 = 16 2 F n ( B) n n ( 2 ) 2 8 = 3 B = 2 = 2 = 256 3 94

Counting Elements of Fn(B) 44 0,3:3.9 438 Examples with B = {, 0 a,,}, b1 A( B) = {,} a b n n ( A( B) 2 ) 22 16 = 2 2 = 2 = 2 3 n Examples with ( A( B) 2 ) 22 32 = 3 2 = 2 = 2 Note 2(4) base atoms act like 1(2) extra variables n A( B ) = 4 4 n n n ( A( B) 2 ) 42 32 = 2 2 = 2 = 2 n ( A( B) 2 ) 42 64 = 3 2 = 2 = 2 3 4 95

Boolean Difference (Sensitivity) 44 0,3:3.9 438 A Boolean function f depends on a if and only if f f. Thus a a f / a = fa fa is called the Boolean Difference, or Sensitivity of f with respect to a 96

Boolean Difference (Sensitivity) 44 0,3:3.9 438 Example: f = abc + a bc f / a = f f = ( bc) ( bc) = a a f / b= f f = ( ac) ( a c) = c b b Note the formula depends on a, but the implied function does not 0 97

Don t Care 43 9,708 An interval [L, U] in a Boolean algebra B is the subset of B defined by [L,U] = { x B : L x U } Satisfiability don t cares Observability don t cares 98

Intervals and Don t Cares 3.425 090$50. 1.,9 438 D = D Obs + D Sat = xy L = g D = gd = ( xy + xy )( x+ y) = ( xy + xy ) = g U = g + D = ( x y + xy ) + x' y' = x' + y' 99

Don t Cares 43 9,708 Input Filter Output Filter xy if and only if x y f = x, f = y z/ w= 0 for all possible xy. D Obs xy if and only if local input xy never occurs D Sat The complete don t care set for gate g is g Sat Obs D = D + D 100

Don t Cares Local inputs 43 9,708 x = u + v, y= v ( y= 0) ( x = 1) For this circuit, local input combinations x y ( x = 0, y = 0) do not occur. That is, the local minterm xy is don t care. 101

Don t Cares 43 9,708 z= w + t z/ w= z z = t 1 = t For this circuit, global input combination 10 sets z t = uv = 1 which makes insensitive to w. However, local input pair 10 ( xy ) is NOT don t care, since uv also gives xy, and in this case. t u v = 1 w w 102

Computing ALL Don t Cares 43 9,708 u v x y w t z z/ w 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 xy D Sat if and only f x (,)= u v x and f y (,)= u v y does not occur for any row uv, in the truth table. Here, D Sat = x y ( 00 does not occur) 103

Computing ALL Don t Cares 43 9,708 Note these differ! u v x y w t z z/ w 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 Similarly xy if and only for every row uv, such that f x (,)= u v x and f y (,)= u v y, z/ w= zw zw = 0 Here 10 ( xy ) is NOT don t care since z/ w= 1 in the first row. D Obs 104

Computing ALL Don t Cares 43 9,708 Note these differ! u v x y w t z z/ w 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 g Sat Obs D = D + D = x y g = xy + xy ( + xy ) x + y Thus the exclusive OR gate can be replaced by a NAND 105

Don t Cares and Function Subalgebras 43 9,708 Suppose we are given a Boolean Function f and a don t care set D. Then any function in the interval (subalgebra) [ fl, fu ] = [ fd, f + D] is an acceptable replacement for f in the environment that produced D. Here fd is the 0 of the subalgebra and f + D is the 1. 106

Incompletely Specified Functions 3.425 090$50. 1.,9 438 Suppose we are given a Boolean Function g and a don t care set D. Then the triple ( f, dr, ) where f = gd, d = D, and r = ( f + D) is called an Incompletely specified function. Note f + d+ r = gd + D+ ( g + D) = 1. 107