CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

Similar documents
CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CSC Discrete Math I, Spring Propositional Logic

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Propositional Logic: Equivalence

2.2: Logical Equivalence: The Laws of Logic

Tautologies, Contradictions, and Contingencies

cse 311: foundations of computing Spring 2015 Lecture 3: Logic and Boolean algebra

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Chapter 1, Section 1.1 Propositional Logic

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Packet #1: Logic & Proofs. Applied Discrete Mathematics

EGC221: Digital Logic Lab

The Logic of Compound Statements cont.

Part I: Propositional Calculus

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Compound Propositions

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

A statement is a sentence that is definitely either true or false but not both.

Definition 2. Conjunction of p and q

CSE 311 Lecture 02: Logic, Equivalence, and Circuits. Emina Torlak and Kevin Zatloukal

Switches: basic element of physical implementations

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

COS 140: Foundations of Computer Science

Consider the following propositions: p: lecture has started q: If I have a banana, then I have a pear r: I finished this problem

EECS 1028 M: Discrete Mathematics for Engineers

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Recitation Week 3. Taylor Spangler. January 23, 2012

CISC-102 Winter 2016 Lecture 17

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

EEE130 Digital Electronics I Lecture #4

KP/Worksheets: Propositional Logic, Boolean Algebra and Computer Hardware Page 1 of 8

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Propositional Equivalence

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

EECS 1028 M: Discrete Mathematics for Engineers

Boolean Algebra & Logic Gates. By : Ali Mustafa

CHAPTER1: Digital Logic Circuits Combination Circuits

Proving Things. Why prove things? Proof by Substitution, within Logic. Rules of Inference: applying Logic. Using Assumptions.

1.1 Statements and Compound Statements

Introduction to Decision Sciences Lecture 2

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Truth-Functional Logic

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

We last time we began introducing equivalency laws.

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Computer Organization: Boolean Logic

Propositional Logic 1

Cs302 Quiz for MID TERM Exam Solved

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Unit 4: Computer as a logic machine

Solutions to Homework I (1.1)

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

CS61c: Representations of Combinational Logic Circuits

Unit 8A Computer Organization. Boolean Logic and Gates

CS 173 Lecture 2: Propositional Logic

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Math.3336: Discrete Mathematics. Propositional Equivalences

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

AMTH140 Lecture 8. Symbolic Logic

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

CSE 20: Discrete Mathematics

PROPOSITIONAL CALCULUS

Propositional Logic: Semantics

Chapter 2 Combinational Logic Circuits

Logic Gates and Boolean Algebra

1 Boolean Algebra Simplification

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Section 1.2: Propositional Logic

211: Computer Architecture Summer 2016

Math Final Exam December 14, 2009 Page 1 of 5

Digital Logic (2) Boolean Algebra

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Propositional Logic. Spring Propositional Logic Spring / 32

CS 226: Digital Logic Design

The Foundations: Logic and Proofs. Part I

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

Logic Design. Chapter 2: Introduction to Logic Circuits

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

THE LOGIC OF COMPOUND STATEMENTS

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

CISC-102 Fall 2018 Week 11

CS1800: Hex & Logic. Professor Kevin Gold

Logic Propositional logic; First order/predicate logic

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

ANS: If you are in Kwangju then you are in South Korea but not in Seoul.

Section 1.1 Propositional Logic. proposition : true = T (or 1) or false = F (or 0) (binary logic) the moon is made of green cheese

CSE 20 DISCRETE MATH WINTER

Logic and Boolean algebra

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

Circuits & Boolean algebra.

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Transcription:

CSE 311: Foundations of Computing Lecture 3: Digital Circuits & Equivalence

Homework #1 You should have received An e-mail from [cse311a/cse311b] with information pointing you to look at Canvas to submit HW An e-mail from UW Canvas with a notification about the homework assignment. Click on Assignments to see all the questions If you haven t received one, send e-mail to cse311-staff@cs.washington.edu

Last class: Logical Equivalence A B A B is an assertion that two propositionsaand B always have the same truth values. A B and (A B) T have the same meaning. p q q p p q q p tautology p q p q q p (p q) (q p) T T T T T T F F F T F T F F T F F F F T When p=t andq=f, p qis false, butq p is true

Last class: De Morgan s Laws De Morgan s Laws

Last class: Equivalences Related to Implication Law of Implication Contrapositive Biconditional ( ) ()

Last class: Properties of Logical Connectives

One more easy equivalence Double Negation p p p p p T F T T F T F T

Last class: Digital Circuits Computing With Logic T corresponds to 1 or high voltage F corresponds to 0 or low voltage Gates Take inputs and produce outputs (functions) Several kinds of gates Correspond to propositional connectives (most of them)

Last class: AND, OR, NOT Gates AND Gate p q AND OUT p q OUT 1 1 1 1 0 0 0 1 0 0 0 0 p q p q T T T T F F F T F F F F OR Gate p q OUT p q OR OUT 1 1 1 1 0 1 0 1 1 0 0 0 NOT Gate p OUT p NOT OUT 1 0 0 1 p q p q T T T T F T F T T F F F p p T F F T

Combinational Logic Circuits p NOT AND OUT q NOT AND r s OR Values get sent along wires connecting gates

Combinational Logic Circuits p NOT AND OUT q NOT AND r s OR Values get sent along wires connecting gates

Combinational Logic Circuits p AND q NOT OR OUT r AND Wires can send one value to multiple gates!

Combinational Logic Circuits p AND q NOT OR OUT r AND Wires can send one value to multiple gates! ( )

Other Useful Gates NAND ( ) p q out p q out 0 0 1 0 1 1 1 0 1 1 1 0 NOR ( ) p q out p q out 0 0 1 0 1 0 1 0 0 1 1 0 XOR p q out p q out 0 0 0 0 1 1 1 0 1 1 1 0 XNOR p q out p q out 0 0 1 0 1 0 1 0 0 1 1 1

Understanding logic and circuits When do two logic formulas mean the same thing? When do two circuits compute the same function? What logical properties can we infer from other ones?

Basic rules of reasoning and logic Allow manipulation of logical formulas Simplification Testing for equivalence Applications Query optimization Search optimization and caching Artificial Intelligence Program verification

Computing Equivalence Given two propositions, can we write an algorithm to determine if they are equivalent? What is the runtime of our algorithm?

Computing Equivalence Given two propositions, can we write an algorithm to determine if they are equivalent? Yes! Generate the truth tables for both propositions and check if they are the same for every entry. What is the runtime of our algorithm? Every atomic proposition has two possibilities (T, F). If there are atomic propositions, there are rows in the truth table.

Another approach: Logical Proofs To show A is equivalent to B Apply a series of logical equivalences to sub-expressions to convert A to B To show A is a tautology Apply a series of logical equivalences to sub-expressions to convert A to T

Another approach: Logical Proofs To show A is equivalent to B Apply a series of logical equivalences to sub-expressions to convert A to B Example: Let A be ( ), and B be. Our general proof looks like: ( )

Another approach: Logical Proofs Example: Let A be ( ), and B be. Our general proof looks like: ( )

Logical Proofs Example: Let A be ( ), and B be. Our general proof looks like: ( ) Idempotent Idempotent

Logical Proofs To show A is a tautology Apply a series of logical equivalences to sub-expressions to convert A to T Example: Let A be ( ). Our general proof looks like: ( ) T

Logical Proofs Example: Let A be ( ). Our general proof looks like: ( ) T

Logical Proofs Example: Let A be ( ). Our general proof looks like: ( ) T Idempotent Negation

Prove these propositions are equivalent: Option 1 Prove: p (p q) p q Make a Truth Table and show: ( ) T ( ) ( ) T T T T T T T F F F F T F T T F F T F F T F F T

Prove these propositions are equivalent: Option 2 Prove: p (p q) p q

Prove these propositions are equivalent: Option 2 Prove: p (p q) p q ( ) ( ) F ( ) F Law of Implication Distributive Negation Commutative Identity

Prove this is a Tautology: Option 1 (p q) (q p) Make a Truth Table and show: T T T T T T T F F T T F T F T T F F F F T

Prove this is a Tautology: Option 2 Use a series of equivalences like so: T (p q) (q p)

Prove this is a Tautology: Option 2 (p q) (q p) Use a series of equivalences like so: ( ) ( ) ( ) ( ) ( ) ( ) ( ) T T T Law of Implication DeMorgan Associative Associative Commutative Associative Commutative (twice) Negation (twice) Domination/Identity

Logical Proofs of Equivalence/Tautology Not smaller than truth tables when there are only a few propositional variables......but usually much shorterthan truth table proofs when there are many propositional variables A big advantage will be that we can extend them to a more in-depth understanding of logic for which truth tables don t apply.