Foundations of Computing I CSE 311 Fall 2014. 1-bit Binary Adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out A B Cin Cout S 000001010011100101110111000001010011100101110111.

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 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.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
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.
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.
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
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
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
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
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
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
 Seattle Pacific University EE Logic System DesignSOP-POS-1 The Connection: Truth Tables to Functions abcF abcF
Department of Computer Engineering
F = ∑m(1,4,5,6,7) F = A’B’C+ (AB’C’+AB’C) + (ABC’+ABC) Use X’ + X = 1.
1 Digital Logic Design Week 5 Simplifying logic expressions.
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.
ECE 2110: Introduction to Digital Systems PoS minimization Don’t care conditions.
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,
Venn Diagram – the visual aid in verifying theorems and properties 1 E.
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 Lecture 7 Logical Inference Autumn 2012 CSE
CSE 311 Foundations of Computing I
05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2.
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
CHAPTER 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs
© BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.
ECE 3110: Introduction to Digital Systems Chapter #4 Review.
Lecture 18: Boolean Algebra Boolean Functions. w = Chris is allowed to watch television x = Chris's homework is finished y = it is a school night z =
Review. Boolean Algebra.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. De Morgan’s Theorem De Morgan’s Theorem.
DE MORGAN’S THEOREM. De Morgan’s Theorem De Morgan’s Theorem.
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
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 140 : Components and Design Techniques for Digital Systems
CSE 311 Foundations of Computing I
CSE 370 – Winter Combinational Logic - 1
CSE 370 – Winter 2002 – Logic minimization - 1
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
Negations of quantifiers
Lecture 4 Logistics Last lecture --- Boolean algebra Today’s lecture
CSE 321 Discrete Structures
CSE 311: Foundations of Computing
Presentation transcript:

Foundations of Computing I CSE 311 Fall 2014

1-bit Binary Adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out A B Cin Cout S AB Cin CoutS 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

Apply Theorems to Simplify Expressions The theorems of Boolean algebra can simplify expressions – e.g., full adder’s carry-out function 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

Gates Again! XYZ XYZ XY0110XY0110 XYZ XYZ XY XYXY Z XYXY Z

More Gates! X Y Z XYZ XYZ XYZ XYZ Z X Y X Y Z XYZ XYZ XYZ XYZ Z X Y

A 2-bit Ripple-Carry Adder A Sum C out C in B 1-Bit Adder A0A0 B0B0 C out C in Sum 0 0 A1A1 B1B1 Sum 1 C out C in A2A2 B2B2 Sum 2 C out C in

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 ABC F F = A’BC’+A’BC+AB’C+ABC = A’B(C’+C)+AC(B’+B) = A’B+AC

CSE 311: Foundations of Computing Fall 2014 Lecture 5: Canonical Forms, Predicate Logic

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 ABCFF’ F = F = A’BC+ AB’C+ ABC’ + ABC A’B’C

Sum-of-Products Canonical Form 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) ABCminterms 000A’B’C’ 001A’B’C 010A’BC’ 011A’BC 100AB’C’ 101AB’C 110ABC’ 111ABC F in canonical form: F(A, B, C)= 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 (CNF) Also known as maxterm expansion ABCFF’ F = F = (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) – ORed sum of literals – input combination for which output is false – each variable appears exactly once, true or inverted (but not both) ABCmaxterms 000A+B+C 001A+B+C’ 010A+B’+C 011A+B’+C’ 100A’+B+C 101A’+B+C’ 110A’+B’+C 111A’+B’+C’ F in canonical form: F(A, B, C)= (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 Logic Propositional Logic – If the tortoise walks at a rate of one node per step, and the hare walks at a rate of two nodes per step,... Predicate Logic – If the tortoise is on node x, and the hare is on node 2x, then …

Predicate Logic Propositional 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…

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) “5 < x” Predicates will have variables or constants as arguments. Predicate Logic

Domain of Discourse We must specify a “domain of discourse”, which is the possible things we’re talking about. “ x is a cat” (e.g., mammals) “ x is prime” (e.g., numbers) student x has taken course y ” (e.g., students and courses)

Quantifiers  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”

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) (or “x > y”) Equal(x,y) (or “x = y”) Sum(x,y,z) Domain: Positive Integers

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)) Even(x) Odd(x) Prime(x) Greater(x,y) (or “x > y”) Equal(x,y) (or “x = y”) Sum(x,y,z) Domain: Positive Integers

Cat(x) Red(x) LikesTofu(x) English to Predicate Logic “Red cats like tofu” “Some red cats don’t like tofu”

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

Negations of Quantifiers  x PurpleFruit(x) “All fruits are purple”  x PurpleFruit(x) “Not all fruits are purple” How about  x PurpleFruit(x) ? “There is a purple fruit” If it’s the negation, all situations should be covered by a statement and its negation Consider the domain {Orange} : Neither statement is true! How about  x  PurpleFruit(x) ? “There is a fruit that isn’t purple” Domain: Fruit PurpleFruit(x)

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  y ( x ≥ y)   x   y ( x ≥ y)   x  y  ( x ≥ y)   x  y (y > x) “ There is no largest integer ” “ For every integer there is a larger integer ”  x P(x)   x  P(x)   x P(x)   x  P(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)