Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sungho Kang Yonsei University

Similar presentations


Presentation on theme: "Sungho Kang Yonsei University"— Presentation transcript:

1 Sungho Kang Yonsei University
Boolean Algebra Sungho Kang Yonsei University

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

3 Element is a member of set
Set Notation Set and Relations Element is a member of set Element is not a member of set Cardinality (number of members) of set Set is a subset of The empty set (a member of all sets) The complement of set The universe:

4 Set Notation Inclusion () Proper Inclusion () Complementation
Set and Relations Inclusion () Proper Inclusion () Complementation Intersection () Union () Difference

5 The power set of set (the set of all subsets of set
Power Sets Set and Relations The power set of set (the set of all subsets of set The cardinality of a power set is a power of 2

6 Power sets are Boolean Algebras
Set and Relations 3-member set 1 subset with 0 members 3 subsets with 1 members 3 subsets with 2 members 1 subset with 3 members Power sets are Boolean Algebras

7 Set is unordered ( ) denotes Ordered Set Cartesian Products
Set and Relations The Cartesian Product of sets A and B is denoted A x B Suppose , then Set is unordered ( ) denotes Ordered Set

8 Binary Relations Set and Relations 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 and A subset is called a Binary Relation Graphs, Matrices, and Boolean Algebras can be viewed as binary relations

9 Binary Relations as Graphs or Matrices
Set and Relations a b b d f c d a 1 0 0 1 1 1 f c Bipartite Graph Rectangular Matrix

10 Directed Graph Square Matrix Binary Relations as Graphs or Matrices a
Set and Relations a a b c d c b d Directed Graph Square Matrix

11 Properties of Binary Relations
Set and Relations A binary relation can be reflexive, and/or transitive, and/or symmetric, and/or antisymmetric We illustrate these properties on the next few slides

12 Notation for Binary Relations
Set and Relations If , we say that is the domain of the relation , and that is the range. If , we say that the pair is in the relation , or

13 Missing Figure 3.2, Page Set and Relations

14 Example: “Less than or Equal”
Set and Relations

15 Example: “a times b = 12” Set and Relations 1 2 3 12 6 4

16 reflexive if and only if for every vertex
Reflexive Binary Relations Set and Relations a c c b d a A binary relation is reflexive if and only if for every vertex b c d

17 Non-Reflexive Binary Relations
Set and Relations a c b d Non-Reflexivity implies that there exists such that . Here is such a . a b c d

18 Transitive Binary Relations
Set and Relations a c b d 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.

19 A binary relation is not transitive if there
Non-Transitive Binary Relations Set and Relations a c Edge (a,e) is missing b d e A binary relation is not transitive if there exists a path from to , through v that is not triangulated by a direct (u,w) edge Here is such a path. u w, (a,c,e)

20 Symmetric Binary Relations
Set and Relations A binary relation is symmetric if and only if every edge is reciprocated by a edge 1 2 3 12 6 4

21 non-symmetric if there exists an edge not reciprocated by an edge a c
Non-Symmetric Binary Relations Set and Relations Edge (c,a) is missing A binary relation is non-symmetric if there exists an edge not reciprocated by an edge a c b d e

22 Antisymmetric Binary Relations
Set and Relations A binary relation is anti- symmetric if and only if no edge is reciprocated by a edge a c b d e Not antisymmetric if any such edge is reciprocated : here

23 Functions Set and Relations 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

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

25 This graph defines path relation
The Path Relation Set and Relations e d c b a This graph defines path relation Relation is sometimes called “Reachability”

26 Equivalence Relations
Set and Relations a c b d e Note R is reflexive, symmetric, and transitive

27 This graph defines path relation This graph defines R
Equivalence Relations Set and Relations e d c b a e d c b a This graph defines path relation This graph defines R NOT an equivalence relation: An equivalence relation:

28 This graph defines path relation
The Cycle Relation Set and Relations e d c b a e d c b a This graph defines path relation These are called the “Strongly Connected Components” of G

29 Refinement Set and Relations Given any set B a partition of B is a set of subsets Bi B with two properties Bi  Bj =  for all i  j i Bi = B Given two partitions P1 and P2 of a set S, P1 is a refinement of P2 if each block B1i of P1 is a subset of some block of 2

30 Other Binary Relations
Set and Relations Partial Orders (Includes Lattices, Boolean Algebras) Reflexive Transitive Antisymmetric Compatibility Relations Not Transitive--Almost an equivalence relation Symmetric

31 Functions Set and Relations 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

32 Algebraic Systems The pair is called an algebraic system
Partial Orders The pair is called an algebraic system is a set, called the carrier of the system is a relation on ( , are similar to ) This algebraic system is called a partially ordered set, or poset for short

33 Partially Ordered Sets
Partial Orders A poset has two operations, and , called meet and join (like AND and OR) Sometimes written or even , since is implied

34 Posets and Hasse Diagrams
Partial Orders Integers (Totally Ordered): Missing Figure 3.2 4 3 2 1 Matrix View Hasse Diagram Hasse Diagram obtained deleting arrowheads and redundant edges

35 is refelxive, antisymmetric, and transitive: a partial order
Posets and Hasse Diagrams Partial Orders a \ d c b b c a d Relation Hasse Diagram :distance from top is refelxive, antisymmetric, and transitive: a partial order

36 An element m of a poset P is a lower bound of elements
Meet Partial Orders An element m of a poset P is a lower bound of elements a and b of P, if and 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 such that and also ,

37 An element of a poset is a upper bound of elements and of , if and .
Join: the Dual of Meet Partial Orders An element of a poset is a upper bound of elements and of , if and is the least upper bound or join of elements and if is an upper bound of and and, for any such that and also ,

38 d d d b c b b c b d a a a a c Meet ( ) and Join (+) posets:
Partial Orders posets: d d d b c b b c b d a a a a c

39 Theorem 3.2.1 If and have a greatest lower bound (meet), then
POSET Properties Partial Orders Theorem If and have a greatest lower bound (meet), then Similarly, if and have a least upper bound (join), then Proof: Since meet exists, by definition. Also, since join exists, by definition.

40 is a lower bound of and (by Def.)
More POSET Properties Partial Orders Theorem 3.2.2 Proof ( ): This means assume is a lower bound of and (by Def.) is also the meet of and Proof: by contradiction. Suppose . Then where But since was a lower bound of and , as well. Thus , by the anti-symmetry of posets. Proof ( ): From Definition of meet

41 Well-Ordered Partial Orders 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

42 Lattices Partial Orders 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

43 d d d b c d b b c b a a a a c (lattice) (lattice) (Boolean algebra)
Lattices and Not Lattices Partial Orders d d d b c d b b c b a a a a c (lattice) (lattice) (Boolean algebra)

44 Examples of Lattices Partial Orders

45 “There Exists a in set ” is denoted by
More Notation Partial Orders “There Exists a in set ” is denoted by The following are equivalent: Does make sense in a poset? No--Complement is defined for lattices but not for posets ( ) ( )

46 Properties of Lattices
Partial Orders Meet, Join, Unique maximum (1), minimum (0) element are always defined Idempotent: Commutative: Associative: Absorptive: Absorptive properties are fundamental to optimization

47 Every lattice identity is transformed into another
Duality Partial Orders Every lattice identity is transformed into another identity by interchanging: and Example:

48 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

49 Examples of Lattices Partial Orders Complemented? yes no yes

50 Semi-distributivity:
Partial Orders Semi-distributivity: Proof : (def. of meet) (def. of meet, join) (def. of meet) (mutatis mutandis: ) (def. of join)

51 Boolean Algebras have full distributivity:
Partial Orders Boolean Algebras have full distributivity: Boolean Algebras are complemented. That is, must hold for every in the carrier of the poset

52 Definition of Boolean Algebra
Partial Orders 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

53 Are these Lattices Boolean Algebras?
Partial Orders Complemented and distributed? yes no no

54 Fundamental Theorem of Boolean Algebras
Partial Orders Every poset which is a Boolean Algebra has a power of 2 elements in its carrier All Boolean Algebras are isomorphic to the power set of the carrier. Example:

55 Examples of Boolean Algebras
Partial Orders 1-cube 2-cube

56 Atoms of a Boolean Algebra
Partial Orders A Boolean Algebra is a Distributive, Complemented Lattice The minimal non-zero elements of a Boolean Algebra are called “atoms” 1-atom 2-atoms Can a Boolean Algebra have 0 atoms? NO!

57 Examples of Boolean Algebras
Partial Orders 3 atoms

58 Level 4--1 elt* Level 3--4 elts Level 2--6 elts Level 1--4 elts
Examples of Boolean Algebras Partial Orders Level 4--1 elt* Level 3--4 elts Level 2--6 elts Level 1--4 elts Level 0--1 elts * “elt” = element

59 Theorem 3.2.6 Complementation is unique.
Boolean Algebras Partial Orders Theorem Complementation is unique. proof: Suppose and are both complements of ( ). Hence Note we used distributivity. Similarly, we have Theorem (Involution):

60 Properties of Boolean Algebra
Partial Orders x + x’y = x+y x(x’+y) = xy

61 Lemma: The Isotone Property
Partial Orders Proof: By Theorem 3.2.2, , so we get Note we used idempotence, commutativity, and associativity. Then we use Theorem again to prove the lemma.

62 Duality for Boolean Algebras
Partial Orders Every Boolean Algebra identity is transformed into another valid identity by interchanging: and This rule not valid for lattices Example:

63 Proof: By the isotone property we have
Theorem Partial Orders Proof: By the isotone property we have The second identity follows by duality.

64 Other Theorems Partial Orders DeMorgan’s Laws Consensus

65 Consensus Examples Partial Orders 1. 3. Note use of DeMorgan’s Law

66 5. Is wrong. Replace by Consensus Example
Partial Orders 5. Is wrong. Replace by 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

67 Functions and Boolean Functions
Ordinary functions of 1 variable: Ordinary functions of 2 real variables:

68 Boolean functions of variables:
Functions and Boolean Functions Boolean Functions Boolean functions of variables:

69 Boolean Formulae Boolean Functions Boolean Formulae: Meets and Joins of Variables and Constants

70 n-variable Boolean Formulae
Boolean Functions The elements of are Boolean formulae. Each variable is a Boolean formula. If and are Boolean formulae, then so are A string is a Boolean formula if and only if it derives from finitely many applications of these rules.

71 Distinct Formulas, Same Function
Boolean Functions Truth Table for 0000 aaaa bbbb 1111 0ab1 0ab1 0ab1 0ab1 0ab1 aa11 b1b1 1111

72 Boolean Functions on Boolean Algebra
is a Boolean function is also If and are Boolean, functions then so are A function is Boolean if and only if it derives from finitely many applications of these rules.

73 Positive Cofactor WRT :
Cofactors Boolean Functions Positive Cofactor WRT : Negative Cofactor WRT : Note: prime denotes complement

74 Positive Cofactor WRT :
Cofactors Boolean Functions Positive Cofactor WRT : Negative Cofactor WRT : This term drops out when is replaced by Example: This term is unaffected

75 Cofactors Boolean Functions Example:

76 Boole’s Expansion Theorem
Boolean Functions Example: Sum form: Product form:

77 Variables and Constants
Boolean Functions In the previous slide and were constants, and the were variables. But we can also use letters like and as variables, without explicitly stating what the elements of the Boolean Algebra are.

78 Boole’s Expansion (Sum Form)
Boolean Functions

79 Boole’s Expansion (Product Form)
Boolean Functions Note application of absorptive law

80 Thus some texts refer to f as {0,1,3,4,5,6,7}
Minterm Canonical Form Boolean Functions The minterm canonical form is a canonical, or standard way of representing functions. From p100, is represented by millions of distinct Boolean formulas, but just 1 minterm canonical form. Note Thus some texts refer to f as {0,1,3,4,5,6,7}

81 Minterm Canonical Form
Boolean Functions levels of recursive cofactoring create constants These elementary functions are called minterms

82 Thus a Boolean function is uniquely determined by
Minterm Canonical Form Boolean Functions Thus a Boolean function is uniquely determined by its values at the corner points These constants are aptly called discrimants

83 This function is Boolean (from Boolean Formula)
Minterm Canonical Form Boolean Functions This function is Boolean (from Boolean Formula) 0000 aaaa bbbb 1111 0ab1 0ab1 0ab1 0ab1 aa11 00bb aa11 00bb Ý Ý Ý Ý Thus all 16 cofactors match--not just discriminants

84 Here we change 15th cofactor, but leave the 4 discriminants unchanged
Now Suppose Truth Table is Given Boolean Functions 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 0000 aaaa bbbb 1111 0ab1 0ab1 0ab1 0ab1 aa11 00bb aa11 001b aa11 00bb aa11 00bb Ý Ý Ý Ý

85 2-Variable Boolean Functions
Minterms variable functions 4 3 2 1 Note that the minterms just depend on the number and names of the variables, independent of the particular Boolean Algebra

86 Boolean Function Algebras
Boolean Functions The notation Fn(B) means “the Boolean Algebra whose carrier is the set of all n-variable Boolean Functions” which map B into Fn(B): Bn |-> B minterms If the atoms of Fn(B) are its n-variable B is called the “Base Algebra” of the Boolean Function algebra The atoms of B are called Base Atoms

87 When you design an optimal circuit, each gate
Large Boolean Algebras? Boolean Functions 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 are equivalence preserving replacements for gate Optimal Design: pick best such replacement

88 Note: base atoms act like 2 extra literals
Boolean Algebra Boolean Functions Level (= # of atoms) 4 3 2 1 Each element has 3 Atoms Each element has 2 Atoms Each element has 1 Atom Note: base atoms act like 2 extra literals

89 Level (= # of atoms) 4 3 2 3 minterms (3 atoms) 1 2 minterms (2 atoms)
Boolean Algebra Boolean Functions Level (= # of atoms) 4 3 2 1 3 minterms (3 atoms) 2 minterms (2 atoms) 1 minterm (1 atom)

90 3 Atoms 2 Atoms 1 Atom Boolean Algebra
Boolean Functions Boolean Algebra of 1-Variable Functions 3 Atoms 2 Atoms 1 Atom Subalgebras are incompletely specified Boolean Functions (most important)

91 The 3-Atom element is ONE of subalgebra 2-Atom elements are
Boolean Subalgebra Boolean Functions Boolean Subalgebra: Interval of 2-Variable Function Lattice The 3-Atom element is ONE of subalgebra 2-Atom elements are atoms of subalgebra 1-Atom element is ZERO of subalgebra

92 An algebra (or subalgebra) with levels has exactly elements, because
More On Counting Boolean Functions Level (= # of atoms) 4 3 2 1 An algebra (or subalgebra) with levels has exactly elements, because levels implies atoms

93 ONE of algebra (4-Atoms) is also one of this subalgebra
A larger Subalgebra Boolean Functions 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

94 Counting Elements of Boolean Functions For each of the minterms, the discriminant can be chosen as any of the elements of . Therefore, the number of elements of is Examples

95 Counting Elements of Fn(B)
Boolean Functions Examples with Note 2(4) base atoms act like 1(2) extra variables

96 Boolean Difference (Sensitivity)
Boolean Functions A Boolean function depends on if and only if Thus is called the Boolean Difference, or Sensitivity of with respect to

97 Boolean Difference (Sensitivity)
Boolean Functions Example: Note the formula depends on , but the implied function does not

98 Don’t Care Don't Cares 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

99 Intervals and Don’t Cares
Incomplete Specifications

100 The complete don’t care set for gate is
if and only if for all possible . if and only if local input never occurs Input Filter Output Filter The complete don’t care set for gate is

101 For this circuit, local input combinations
Don’t Cares Don't Cares Local inputs For this circuit, local input combinations do not occur. That is, the local minterm is don’t care.

102 For this circuit, global input combination 10 sets
Don’t Cares Don't Cares For this circuit, global input combination 10 sets which makes insensitive to However, local input pair 10 ( ) is NOT don’t care, since also gives , and in this case

103 does not occur for any row in the truth table. Here, ( does not occur)
Computing ALL Don’t Cares Don't Cares if and only and does not occur for any row in the truth table. Here, ( does not occur)

104 Similarly if and only for every row such that and ,
Computing ALL Don’t Cares Don't Cares Note these differ! Similarly if and only for every row such that and , Here 10 ( ) is NOT don’t care since in the first row.

105 Computing ALL Don’t Cares
Note these differ! Thus the exclusive OR gate can be replaced by a NAND

106 Don’t Cares and Function Subalgebras
Suppose we are given a Boolean Function and a don’t care set Then any function in the interval (subalgebra) is an acceptable replacement for in the environment that produced Here is the 0 of the subalgebra and is the 1.

107 Suppose we are given a Boolean Function and
Incompletely Specified Functions Incomplete Specifications Suppose we are given a Boolean Function and a don’t care set Then the triple where , , and is called an Incompletely specified function. Note


Download ppt "Sungho Kang Yonsei University"

Similar presentations


Ads by Google