CSE 311: Foundations of Computing

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
ECE 301 – Digital Electronics Minterm and Maxterm Expansions and Incompletely Specified Functions (Lecture #6) The slides included herein were taken from.
ECE 331 – Digital System Design
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
1 CK Cheng CSE Dept. UC San Diego CS 140, Lecture 2 Combinational Logic.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
CSE 321 Discrete Structures Winter 2008 Lecture 1 Propositional Logic.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
28/06/041 CSE-221 Digital Logic Design (DLD) Lecture-5: Canonical and Standard forms and Integrated Circuites.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
Propositional Calculus Math Foundations of Computer Science.
Chapter 2: Boolean Algebra and Logic Functions
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Lecture 4 Logic gates and truth tables Implementing logic functions
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
ECE 331 – Digital System Design
Foundations of Computing I CSE 311 Fall bit Binary Adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out A B Cin Cout S
CSE 311 Foundations of Computing I Lecture 5, Boolean Logic and Predicates Autumn 2012 CSE 3111.
CSE 311 Foundations of Computing I Lecture 5 Predicate Logic Spring
Fallacies The proposition [(p  q)  q]  p is not a tautology, because it is false when p is false and q is true. This type of incorrect reasoning is.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Logic Functions: XOR, XNOR
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
CSE 311 Foundations of Computing I
1 Boolean Algebra  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean.
Discrete Mathematics CS 2610 September Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B.
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
DE MORGAN’S THEOREM. De Morgan’s Theorem De Morgan’s Theorem.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
CSE 311 Foundations of Computing I Lecture 4, Boolean Logic Autumn 2011 CSE 3111.
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 & Logic Gates
Lecture 4 Logistics Last lecture --- Boolean algebra Today’s lecture
Chapter 2: Boolean Algebra and Logic Functions
CSE15 Discrete Mathematics 01/23/17
CS 105 Digital Logic Design
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CHAPTER 3 SETS AND BOOLEAN ALGEBRA
Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn how to how use Boolean algebra to.
ECE 331 – Digital System Design
Lecture 3: Boolean Algebra
CSE 311 Foundations of Computing I
Boolean Algebra.
Boolean Algebra.
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
CSE 311 Foundations of Computing I
Combinatorial Logic Circuit
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
January 19 W’05 Yutao He 4532B Boelter Hall CSM51A/EEM16-Sec.1 W’05
CSE 311: Foundations of Computing
CSE 311 Foundations of Computing I
Chapter 2 Introduction to Logic Circuits
Lecture 5 Logistics Last lecture Today’s lecture
Negations of quantifiers
From now on: Combinatorial Circuits:
CSE 321 Discrete Structures
CSE 321 Discrete Structures
Presentation transcript:

CSE 311: Foundations of Computing Fall 2013 Lecture 5: Canonical forms, predicate Logic

announcements Reading assignment Predicates and Quantifiers 1.4, 1.5 7th Edition 1.3, 1.4 6th Edition

review: boolean algebra Boolean algebra to circuit design Boolean algebra a set of elements B containing {0, 1} binary operations { + , • } and a unary operation { ’ } such that the following axioms hold: 1. the set B contains at least two elements: a, b 2. closure: a + b is in B a • b is in B 3. commutativity: a + b = b + a a • b = b • a 4. associativity: a + (b + c) = (a + b) + c a • (b • c) = (a • b) • c 5. identity: a + 0 = a a • 1 = a 6. distributivity: a + (b • c) = (a + b) • (a + c) a • (b + c) = (a • b) + (a • c) 7. complementarity: a + a’ = 1 a • a’ = 0

review: mapping truth tables to logic gates A B C F 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 Given a truth table: Write the Boolean expression Minimize the Boolean expression Draw as gates Map to available gates 1 F = A’BC’+A’BC+AB’C+ABC = A’B(C’+C)+AC(B’+B) = A’B+AC 2 3 4

review: canonical forms Truth table is the unique signature of a Boolean function The same truth table can have many gate realizations we’ve seen this already depends on how good we are at Boolean simplification Canonical forms standard forms for a Boolean expression we all come up with the same expression

sum-of-products canonical form also known as Disjunctive Normal Form (DNF) also known as minterm expansion F = 001 011 101 110 111 A’B’C + ABC’ + ABC + A’BC + AB’C F = F’ = A’B’C’ + A’BC’ + AB’C’ A B C F F’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 0

sum-of-products canonical form Product term (or minterm) AND-ed product of literals – input combination for which output is true each variable appears exactly once, true or inverted (but not both) A B C minterms 0 0 0 A’B’C’ m0 0 0 1 A’B’C m1 0 1 0 A’BC’ m2 0 1 1 A’BC m3 1 0 0 AB’C’ m4 1 0 1 AB’C m5 1 1 0 ABC’ m6 1 1 1 ABC m7 F in canonical form: F(A, B, C) = m(1,3,5,6,7) = m1 + m3 + m5 + m6 + m7 = A’B’C + A’BC + AB’C + ABC’ + ABC canonical form  minimal form F(A, B, C) = A’B’C + A’BC + AB’C + ABC + ABC’ = (A’B’ + A’B + AB’ + AB)C + ABC’ = ((A’ + A)(B’ + B))C + ABC’ = C + ABC’ = ABC’ + C = AB + C short-hand notation for minterms of 3 variables

product-of-sums canonical form also known as Conjunctive Normal Form (CNF) also known as maxterm expansion F = 000 010 100 F = (A + B’ + C) (A’ + B + C) (A + B + C) A B C F F’ 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 0 F’ = (A + B + C’) (A + B’ + C’) (A’ + B + C’) (A’ + B’ + C) (A’ + B’ + C’)

s-o-p, p-o-s, and de Morgan’s theorem Complement of function in sum-of-products form: F’ = A’B’C’ + A’BC’ + AB’C’ Complement again and apply de Morgan’s and get the product-of-sums form: (F’)’ = (A’B’C’ + A’BC’ + AB’C’)’ F = (A + B + C) (A + B’ + C) (A’ + B + C)

product-of-sums canonical form Sum term (or maxterm) OR-ed sum of literals – input combination for which output is false each variable appears exactly once, true or inverted (but not both) A B C maxterms 0 0 0 A+B+C M0 0 0 1 A+B+C’ M1 0 1 0 A+B’+C M2 0 1 1 A+B’+C’ M3 1 0 0 A’+B+C M4 1 0 1 A’+B+C’ M5 1 1 0 A’+B’+C M6 1 1 1 A’+B’+C’ M7 F in canonical form: F(A, B, C) = M(0,2,4) = M0 • M2 • M4 = (A + B + C) (A + B’ + C) (A’ + B + C) canonical form  minimal form F(A, B, C) = (A + B + C) (A + B’ + C) (A’ + B + C) = (A + B + C) (A + B’ + C) (A + B + C) (A’ + B + C) = (A + C) (B + C) short-hand notation for maxterms of 3 variables

predicate logic propositional logic predicate logic allows us to analyze complex propositions in terms of their simpler constituent parts joined by connectives predicate logic lets us analyze them at a deeper level… Prime(65353)

predicate or propositional function predicate logic predicate or propositional function a function that returns a truth value, e.g., “x is a cat” “x is prime” “student x has taken course y” “x > y” “x + y = z” or Sum(x, y, z) Predicates will have variables or constants as arguments. Prime(65353)

quantifiers  x P(x) x P(x) P(x) is true for every x in the domain read as “for all x, P of x” x P(x) There is an x in the domain for which P(x) is true read as “there exists x, P of x” Relate  and  to  and 

statements with quantifiers  x Even(x)  x Odd(x)  x (Even(x)  Odd(x))  x (Even(x)  Odd(x))  x Greater(x+1, x)  x (Even(x)  Prime(x)) Domain: Positive Integers Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y)

statements with quantifiers  x  y Greater (y, x)  x  y Greater (x, y)  x  y (Greater(y, x)  Prime(y))  x (Prime(x)  (Equal(x, 2)  Odd(x))  x  y(Sum(x, 2, y)  Prime(x)  Prime(y)) Domain: Positive Integers Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) Sum(x,y,z)

statements with quantifiers “There is an odd prime” “If x is greater than two, x is not an even prime” xyz ((Sum(x, y, z)  Odd(x)  Odd(y)) Even(z)) “There exists an odd integer that is the sum of two primes” Domain: Positive Integers Even(x) Odd(x) Prime(x) Greater(x,y) Sum(x,y,z)

english to predicate logic “Red cats like tofu” Cat(x) Red(x) LikesTofu(x)

goldbach’s conjecture “Every even integer greater than two can be expressed as the sum of two primes” Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) xyz ((Greater(x, 2)  Even(x))  (Equal(x, y+z)  Prime(y)  Prime(z)) Domain: Positive Integers

example: Notlargest(x)   y Greater (y, x)   z Greater (z, x) scope of quantifiers example: Notlargest(x)   y Greater (y, x)   z Greater (z, x) truth value: doesn’t depend on y or z “bound variables” does depend on x “free variable” quantifiers only act on free variables of the formula they quantify  x ( y (P(x,y)   x Q(y, x)))

scope of quantifiers x (P(x)  Q(x)) vs. x P(x)  x Q(x)

nested quantifiers bound variable names don’t matter  x  y P(x, y)   a  b P(a, b) positions of quantifiers can sometimes change  x (Q(x)   y P(x, y))   x  y (Q(x)  P(x, y)) but: order is important...

quantification with two variables expression when true when false x  y P(x, y)  x  y P(x, y)  x  y P(x, y)  y  x P(x, y)

negations of quantifiers not every positive integer is prime some positive integer is not prime prime numbers do not exist every positive integer is not prime

de morgan’s laws for quantifiers x P(x)  x P(x)  x P(x)  x P(x)

de morgan’s laws for quantifiers x P(x)  x P(x)  x P(x)  x P(x) “There is no largest integer”   x  y ( x ≥ y)  x  y ( x ≥ y)  x  y  ( x ≥ y)  x  y (y > x) “For every integer there is a larger integer”