Sungho Kang Yonsei University

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Presented by: Ms. Maria Estrellita D. Hechanova, ECE
Relations Relations on a Set. Properties of Relations.
Chapter 2 Logic Circuits.
Chapter 7 Relations : the second time around
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Lecture 3. Boolean Algebra, Logic Gates
Algebra Algebra – defined by the tuple:  A, o 1, …, o k ; R 1, …, R m ; c 1, …, c k  Where: A is a non-empty set o i is the function, o i : A p i  A.
Fall 2002CMSC Discrete Structures1 Yes, No, Maybe... Boolean Algebra.
Partially Ordered Sets (POSets)
Relations Chapter 9.
Chapter 6. Order Relations and Structure
Chapter 2: Boolean Algebra and Logic Functions
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
Boolean Algebra Computer Organization 1 © McQuain Boolean Algebra A Boolean algebra is a set B of values together with: -two binary operations,
CSE 460: Switching Theory David M. Zar
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Relations and their Properties
Sets, Relations, and Lattices
--- outputs logical functions of inputs --- new outputs appear shortly after changed inputs (propagation delay) --- no feedback loops --- no clock Sequential.
Mathematical Preliminaries
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
Advanced Digital Designs Jung H. Kim. Chapter 1. Sets, Relations, and Lattices.
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
Boolean Algebra.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
CHAPTER 2 Boolean algebra and Logic gates
Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation is a relation on.
Relations and Their Properties
Review: Discrete Mathematics and Its Applications
Chapter 5 Relations and Operations
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Chapter 11 (Part 1): Boolean Algebra
Unit-III Algebraic Structures
Relations Binary relations represent relationships between the elements of two sets. A binary relation R from set A to set B is defined by: R  A 
Equivalence Relations
Relations Chapter 9.
Chapter 2: Boolean Algebra and Logic Functions
Unit 2 Boolean Algebra.
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
Set, Combinatorics, Probability & Number Theory
Relations and Digraphs
CS 105 Digital Logic Design
… and now for the Final Topic:
SLIDES FOR CHAPTER 2 BOOLEAN ALGEBRA
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CSCE 355 Foundations of Computation
17-Nov-18 Logic Algebra 1 Combinational logic.
Boolean Algebra.
Boolean Algebra.
CMSC Discrete Structures
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
Yes, No, Maybe... BooleanAlgebra 12/10/2018.
Sungho Kang Yonsei University
Review: Discrete Mathematics and Its Applications
Logic Circuits I Lecture 3.
Heuristic Minimization of Two Level Circuits
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Foundations of Discrete Mathematics
CMSC Discrete Structures
Presentation transcript:

Sungho Kang Yonsei University Boolean Algebra Sungho Kang Yonsei University

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

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:

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

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

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

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

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

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

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

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

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 .

Missing Figure 3.2, Page 80 3.1.3 Set and Relations

Example: “Less than or Equal” Set and Relations

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

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

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

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.

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)

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

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

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

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

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)

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”

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

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:

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

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

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

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

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

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

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

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

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 , .

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 , .

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

Theorem 3.2.1 If and have a greatest lower bound (meet), then POSET Properties Partial Orders Theorem 3.2.1 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.

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

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

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

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)

Examples of Lattices Partial Orders

“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 ( ) ( )

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

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

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

Examples of Lattices Partial Orders Complemented? yes no yes

Semi-distributivity: Partial Orders Semi-distributivity: Proof : 1. (def. of meet) 2. (def. of meet, join) 3. (def. of meet) 4. (mutatis mutandis: ) 5. (def. of join)

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

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

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

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:

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

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!

Examples of Boolean Algebras Partial Orders 3 atoms

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

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

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

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 3.2.2 again to prove the lemma.

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:

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

Other Theorems Partial Orders DeMorgan’s Laws Consensus

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

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

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

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

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

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.

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

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.

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

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

Cofactors Boolean Functions Example:

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

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.

Boole’s Expansion (Sum Form) Boolean Functions

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

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}

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

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

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

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 Ý Ý Ý Ý

2-Variable Boolean Functions Minterms 2-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

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

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

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

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)

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)

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

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

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

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

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

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

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

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

Intervals and Don’t Cares Incomplete Specifications

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

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.

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 .

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)

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.

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

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.

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 .