CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

Propositional Equivalences
Foundations of Computing I CSE 311 Fall 2014 Foundations of Computing I Fall 2014.
Microprocessors vs. Custom Digital Circuits
Logic: From Greeks to philosophers to circuits. COS 116: 3/11/2008 Sanjeev Arora.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
Discrete Mathematics Math 6A Instructor: M. Welling.
Discussion #10 1/16 Discussion #10 Logical Equivalences.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Calculus Math Foundations of Computer Science.
Propositional Equivalence Goal: Show how propositional equivalences are established & introduce the most important such equivalences.
Logic: From Greeks to philosophers to circuits. COS 116, Spring 2012 Adam Finkelstein.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
CSE 311 Foundations of Computing I Spring 2013, Lecture 3 Propositional Logic, Boolean Logic/Boolean Algebra 1.
Propositional Equivalences
Apr. 3, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 3: Review of Digital Circuits and Logic Design Jeremy R. Johnson Mon. Apr.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
Module Code MA1032N: Logic Lecture for Week Autumn.
+ CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CSE 311 Foundations of Computing I
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Chapter 1: The Foundations: Logic and Proofs
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Lecture 4 Boolean Algebra. Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements.
BOOLEAN ALGEBRA Kamrul Ahsan Teacher of
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Module Code MA0003NI: Computing mathematics Lecture for Week Autumn.
Computer Architecture & Operations I
Chapter 11 (Part 1): Boolean Algebra
Module 2: Conditionals and Logical Equivalences
The Foundations: Logic and Proofs
Advanced Algorithms Analysis and Design
Propositional Equivalence
CSE15 Discrete Mathematics 01/23/17
CSE 311 Foundations of Computing I
CHAPTER 2 Boolean Algebra
COT 3100, Spr Applications of Discrete Structures
Discussion #10 Logical Equivalences
Mathematics for Computing
Jeremy R. Johnson Wed. Sept. 29, 1999
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
CSE 311 Foundations of Computing I
Propositional Calculus: Boolean Algebra and Simplification
Administrivia Course Web:
Propositional Equivalences
Information Technology Department
Propositional Equivalence (§1.2)
CSE 370 – Winter Combinational Logic - 1
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Propositional Equivalences
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
CSE 321 Discrete Structures
Foundations of Discrete Mathematics
Discrete Structures Prepositional Logic 2
The Foundations: Logic and Proofs
Presentation transcript:

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra

announcements Reading assignments – Propositional Logic th Edition th Edition – Boolean Algebra 12.1 – th Edition 11.1 – th Edition

combinational logic circuits Design a circuit to compute the majority of 3 bits. What about majority of 5 bits?

some other gates X Y Z XYZ XYZ XYZ XYZ Z X Y X Y Z XYZ XYZ XYZ XYZ Z X Y

review: logical equivalence Terminology: A compound proposition is a Tautology if it is always true Contradiction if it is always false Contingency if it can be either true or false p   p p  p (p  q)  p (p  q)  (p   q)  (  p  q)  (  p   q)

review: logical equivalence p and q are logically equivalent if and only if p  q is a tautology i.e. p and q have the same truth table The notation p  q denotes p and q are logically equivalent Example:p   p p  p p   pp    p

review: De Morgan’s laws  (p  q)   p   q  (p  q)   p   q What are the negations of: The Yankees and the Phillies will play in the World Series. It will rain today or it will snow on New Year’s Day.

review: De Morgan’s laws pq  p p  q  q  p   q p  q  p  q)  p  q)  p   q) TT TF FT FF Example:  (p  q)  (  p   q)

review: Law of Implication pq p  q  p p  p  q (p  q)  (  p  q) T T T F F T F F (p  q)  (  p  q)

understanding connectives Reflect 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

review: properties of logical connectives Identity Domination Idempotent Commutative Associative Distributive Absorption Negation De Morgan’s Laws Textbook: th Edition/1.2 6 th Edition, Table 6

some equivalences related to implication p  q   p  q p  q   q   p p  q   p  q p  q   (p   q) p  q  (p  q)  (q  p) p  q   p   q p  q  (p  q)  (  p   q)  (p  q)  p   q

some equivalences related to implication p  q   q   p

logical proofs To show P is equivalent to Q – Apply a series of logical equivalences to subexpressions to convert P to Q To show P is a tautology – Apply a series of logical equivalences to subexpressions to convert P to T

prove this is a tautology (p  q)  (p  q)

prove this is a tautology (p  (p  q))  q

proving non-equivalence (p  q)  r p  (q  r)

boolean logic

a quick combinational logic example

implementation in software integer number_of_days (month, leap_year_flag){ switch (month) { case 1: return (31); case 2: if (leap_year_flag == 1) then return (29) else return (28); case 3: return (31);... case 12: return (31); default: return (0); } 20

implementation with combinatorial logic Encoding: - how many bits for each input/output? - binary number for month - four wires for 28, 29, 30, and 31 leap month d28 d29d30d31 monthleapd28d29d30d ––––– 0001– – – – – – – – – – – ––––– 1110––––– 1111–––––

implementation with combinatorial logic Truth-table to logic to switches to gates d28 = “1 when month=0010 and leap=0” d28 = m8'm4'm2m1'leap‘ d31 = “1 when month=0001 or month=0011 or... month=1100” d31 = (m8'm4'm2'm1) + (m8'm4'm2m1) (m8m4m2'm1') d31 = can we simplify more? monthleapd28d29d30d ––––– 0001– – – – ––––– 111––––––

implementation with combinatorial logic d28 = m8'm4'm2m1'leap’ d29 = m8'm4'm2m1'leap d30 = (m8'm4m2'm1') + (m8'm4m2m1') + (m8m4'm2'm1) + (m8m4'm2m1) = (m8'm4m1') + (m8m4'm1) d31 = (m8'm4'm2'm1) + (m8'm4'm2m1) + (m8'm4m2'm1) + (m8'm4m2m1) + (m8m4'm2'm1') + (m8m4'm2m1') + (m8m4m2'm1')

combinational logic Switches Basic logic and truth tables Logic functions Boolean algebra Proofs by re-writing and by truth table