CSE 311 Foundations of Computing I Lecture 5, Boolean Logic and Predicates Autumn 2012 CSE 3111.

Slides:



Advertisements
Similar presentations
1 CK Cheng CSE Dept. UC San Diego CS 140, Lecture 2 Combinational Logic.
Advertisements

II - Combinational Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Combinational logic Basic logic  Boolean algebra, proofs by re-writing,
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
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
EECS Components and Design Techniques for Digital Systems Lec 05 – Boolean Logic 9/4-04 David Culler Electrical Engineering and Computer Sciences.
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.
CK Cheng Tuesday 10/2/02 CS 140 Lecture 2. Part I. Combinational Logic I) Specification –a. Language –b. Truth Table –c. Boolean Algebra –d. Incompletely.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Canonical Forms and Logic Miniminization
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
Propositional Calculus Math Foundations of Computer Science.
1 CK Cheng CSE Dept. UC San Diego CSE 140, Lecture 2 Combinational Logic.
Boolean Algebra and Logic Simplification. Boolean Addition & Multiplication Boolean Addition performed by OR gate Sum Term describes Boolean Addition.
Chapter 2: Boolean Algebra and Logic Functions
Lecture 4 Logic gates and truth tables Implementing logic functions
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
4.1 Conversion of English Sentences to Boolean Equations
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
 Seattle Pacific University EE Logic System DesignSOP-POS-1 The Connection: Truth Tables to Functions abcF abcF
CSE 311 Foundations of Computing I Spring 2013, Lecture 3 Propositional Logic, Boolean Logic/Boolean Algebra 1.
F = ∑m(1,4,5,6,7) F = A’B’C+ (AB’C’+AB’C) + (ABC’+ABC) Use X’ + X = 1.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
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 Autumn 2011 Lecture 29 Course Summary Autumn 2011CSE 3111.
CSE 311 Foundations of Computing I Lecture 5 Predicate Logic Spring
Logic Design CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
1 Chapter 2 Combinational logic. 2 Combinational logic Basic logic  Boolean algebra, proofs by re-writing, proofs by perfect induction  logic functions,
Unit 1 Minimization Techniques and Logic Gates. Introduction to Digital Systems Analog devices and systems process time-varying signals that can take.
Test Slide SAT MCAT GRE. CSE 370 Spring 2006 Introduction to Digital Design Lecture 5: Canonical Forms Last Lecture Logic Gates Different Implementations.
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.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
1 EENG 2710 Chapter 2 Algebraic Methods For The Analysis and Synthesis of Logic circuits.
CHAPTER 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs
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.
Karnaugh Maps (K-Maps)
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
CSE 311 Foundations of Computing I Lecture 4, Boolean Logic Autumn 2011 CSE 3111.
1 CSE370, Lecture 4 Lecture 4 u Logistics n HW1 due now n HW2 posted now and is due one week from today n Lab1 going on this week n Feedback on lectures,
Lecture 4 Logistics Last lecture --- Boolean algebra Today’s lecture
Logic Gates and Boolean Algebra
CS 105 Digital Logic Design
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
ECE 331 – Digital System Design
CSE 140 : Components and Design Techniques for Digital Systems
Karnaugh Maps (K-Maps)
CSE 311 Foundations of Computing I
Boolean Algebra.
Boolean Algebra.
CSE 370 – Winter Combinational Logic - 1
Combinatorial Logic Circuit
January 19 W’05 Yutao He 4532B Boelter Hall CSM51A/EEM16-Sec.1 W’05
CSE 311 Foundations of Computing I
Chapter 2 Introduction to Logic Circuits
Lecture 4 Minterm and Maxterm
Lecture 4 Logistics Last lecture --- Boolean algebra Today’s lecture
CSE 321 Discrete Structures
CSE 321 Discrete Structures
CSE 311: Foundations of Computing
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 5, Boolean Logic and Predicates Autumn 2012 CSE 3111

Announcements Homework 2 available (Due October 10) Autumn 2012CSE 3112

Highlights from last lecture Boolean algebra to circuit design Boolean algebra – a set of elements B = {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 Ba b is in B 3. commutativity:a + b = b + aa b = b a 4. associativity:a + (b + c) = (a + b) + ca (b c) = (a b) c 5. identity:a + 0 = aa 1 = a 6. distributivity:a + (b c) = (a + b) (a + c)a (b + c) = (a b) + (a c) 7. complementarity:a + a’ = 1a a’ = 0 Autumn 2012CSE George Boole – 1854

A simple example: 1-bit binary adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out Autumn 2012 CSE 3114 A B Cin Cout S ABCinCoutS Cout = A’ B Cin + A B’ Cin + A B Cin’ + A B Cin S = A’ B’ Cin + A’ B Cin’ + A B’ Cin’ + A B Cin AAAAAAAAAA BBBBBBBBBB SSSSSSSSSS Cin Cout

Cout = A’ B Cin + A B’ Cin + A B Cin’ + A B Cin Autumn 2012CSE 3115

Apply the theorems to simplify expressions The theorems of Boolean algebra can simplify expressions – e.g., full adder’s carry-out function Autumn 2012CSE 3116 Cout = A’ B Cin + A B’ Cin + A B Cin’ + A B Cin = A’ B Cin + A B’ Cin + A B Cin’ + A B Cin + A B Cin = A’ B Cin + A B Cin + A B’ Cin + A B Cin’ + A B Cin = (A’ + A) B Cin + A B’ Cin + A B Cin’ + A B Cin = (1) B Cin + A B’ Cin + A B Cin’ + A B Cin = B Cin + A B’ Cin + A B Cin’ + A B Cin + A B Cin = B Cin + A B’ Cin + A B Cin + A B Cin’ + A B Cin = B Cin + A (B’ + B) Cin + A B Cin’ + A B Cin = B Cin + A (1) Cin + A B Cin’ + A B Cin = B Cin + A Cin + A B (Cin’ + Cin) = B Cin + A Cin + A B (1) = B Cin + A Cin + A B adding extra terms creates new factoring opportunities

S = A’ B’ Cin + A’ B Cin’ + A B’ Cin’ + A B Cin Autumn 2012CSE 3117

A simple example: 1-bit binary adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out Autumn 2012CSE 3118 A B Cin Cout S ABCinCoutS Cout = B Cin + A Cin + A B S = A xor (B xor Cin) AAAAAAAAAA BBBBBBBBBB SSSSSSSSSS Cin Cout

A 2-bit ripple-carry adder Autumn 2012CSE 3119 A1A1 B1B1 C out C in Sum 1 A Sum C out C in B 1-Bit Adder A2A2 B2B2 Sum 2 C out C in 0

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

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 Autumn 2012CSE

Sum-of-products canonical forms Also known as disjunctive normal form Also known as minterm expansion Autumn 2012CSE ABCFF’ F = F’ = A’B’C’ + A’BC’ + AB’C’ F = A’BC+ AB’C+ ABC’ + ABC A’B’C

Sum-of-products canonical form (cont) Product term (or minterm) – ANDed product of literals – input combination for which output is true – each variable appears exactly once, true or inverted (but not both) Autumn 2012CSE short-hand notation for minterms of 3 variables ABCminterms 000A’B’C’m0 001A’B’Cm1 010A’BC’m2 011A’BCm3 100AB’C’m4 101AB’Cm5 110ABC’m6 111ABCm7 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

Product-of-sums canonical form Also known as conjunctive normal form Also known as maxterm expansion Autumn 2012CSE ABCFF’ F = F = 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)

Product-of-sums canonical form (cont) Sum term (or maxterm) – ORed sum of literals – input combination for which output is false – each variable appears exactly once, true or inverted (but not both) Autumn 2012CSE ABCmaxterms 000A+B+CM0 001A+B+C’M1 010A+B’+CM2 011A+B’+C’M3 100A’+B+CM4 101A’+B+C’M5 110A’+B’+CM6 111A’+B’+C’M7 short-hand notation for maxterms of 3 variables 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)

Predicate Calculus Predicate or Propositional Function – A function that returns a truth value “x is a cat” “x is prime” “student x has taken course y” “x > y” “x + y = z” Autumn 2012CSE 31116

Quantifiers  x P(x) : P(x) is true for every x in the domain  x P(x) : There is an x in the domain for which P(x) is true Autumn 2012CSE 31117

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)) Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) Domain: Positive Integers Autumn 2012CSE 31118

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(Equal(x, y + 2)  Prime(x)  Prime(y)) Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) Domain: Positive Integers Autumn 2012CSE 31119

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

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) Domain: Positive Integers Autumn 2012CSE 31121