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

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

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

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

Logic Gate Level. Part 2

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

Boolean Algebra, Gates and Circuits

EECS 1028 M: Discrete Mathematics for Engineers

Chapter 2 (Lect 2) Canonical and Standard Forms. Standard Form. Other Logic Operators Logic Gates. Sum of Minterms Product of Maxterms

Chapter 2: Switching Algebra and Logic Circuits

1. Name the person who developed Boolean algebra

CSE 20 DISCRETE MATH WINTER

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Digital Circuit And Logic Design I. Lecture 3

Propositional Logic:

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Logical Design of Digital Systems

Combinational Logic. Review of Combinational Logic 1

Unit 2 Session - 6 Combinational Logic Circuits

Boolean Algebra. Philipp Koehn. 9 September 2016

MC9211 Computer Organization

University of California, San Diego Department of Computer Science and Engineering CSE 20. Solutions to Midterm Exam Winter 2018

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

CSE 20 DISCRETE MATH WINTER

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

Combinatorial Logic Design Principles

AMTH140 Lecture 8. Symbolic Logic

CS206 Lecture 03. Propositional Logic Proofs. Plan for Lecture 03. Axioms. Normal Forms

Gate-Level Minimization

ELCT201: DIGITAL LOGIC DESIGN

Chapter 2 Boolean Algebra and Logic Gates

Chapter 2 Combinational Logic Circuits

Packet #1: Logic & Proofs. Applied Discrete Mathematics

CHAPTER 12 Boolean Algebra

EEE130 Digital Electronics I Lecture #4

CSE 20 DISCRETE MATH. Fall

Boolean Algebra and Logic Gates

We last time we began introducing equivalency laws.

Unit 8A Computer Organization. Boolean Logic and Gates

CHAPTER1: Digital Logic Circuits Combination Circuits

software design & management Gachon University Chulyun Kim

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

Boolean Algebra CHAPTER 15

Chapter 2 Combinational Logic Circuits

Logic Design. Chapter 2: Introduction to Logic Circuits

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

Tautologies, Contradictions, and Contingencies

Solutions to Homework I (1.1)

2.2: Logical Equivalence: The Laws of Logic

Propositional Logic: Equivalence

CS 226: Digital Logic Design

Computer Organization I. Lecture 13: Design of Combinational Logic Circuits

Tecniche di Verifica. Introduction to Propositional Logic

Lecture 2 Review on Digital Logic (Part 1)

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

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Computer Organization I

CSCI 1010 Models of Computa3on. Lecture 02 Func3ons and Circuits

Chapter 2 Combinational Logic Circuits

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

NAND, NOR and XOR functions properties

WEEK 2.1 BOOLEAN ALGEBRA

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Chapter 2. Boolean Algebra and Logic Gates

Topic 1: Propositional logic

Week-I. Combinational Logic & Circuits

Boolean Algebra and Logic Simplification

CSC Discrete Math I, Spring Propositional Logic

Computer Organization: Boolean Logic

Digital Circuit And Logic Design I. Lecture 4

Fundamentals of Computer Systems

Digital Logic Design ABC. Representing Logic Operations. Dr. Kenneth Wong. Determining output level from a diagram. Laws of Boolean Algebra

Chapter 2 Boolean Algebra and Logic Gates

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

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

Digital Logic Design. Combinational Logic

CHAPTER III BOOLEAN ALGEBRA

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Number System conversions

. T SHREE MAHAPRABHU PUBLIC SCHOOL & COLLEGE NOTES FOR BOARD EXAMINATION SUBJECT COMPUTER SCIENCE (Code: 083) Boolean Algebra

CS/EE 181a 2010/11 Lecture 4

Hardware Design I Chap. 2 Basis of logical circuit, logical expression, and logical function

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

02 Propositional Logic

Chapter 2 Boolean Algebra and Logic Gates

L2: Combinational Logic Design (Construction and Boolean Algebra)

Digital Logic. Lecture 5 - Chapter 2. Outline. Other Logic Gates and their uses. Other Logic Operations. CS 2420 Husain Gholoom - lecturer Page 1

Signals and Systems Digital Logic System

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Chapter 2 Combinational Logic Circuits

CPE100: Digital Logic Design I

Combinational Logic Fundamentals

CHAPTER III BOOLEAN ALGEBRA

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

Unit 2 Boolean Algebra

ECE473 Lecture 15: Propositional Logic

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

EEA051 - Digital Logic 數位邏輯 吳俊興高雄大學資訊工程學系. September 2004

In Module 3, we have learned about Exclusive OR (XOR) gate. Boolean Expression AB + A B = Y also A B = Y. Logic Gate. Truth table

Transcription:

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

Disjunctive normal form Example: Let f (x, y, z) =xy z. Write this function in DNF. Minterm xy z xyz xȳz takes the value 1 only when x = 1, 0, y = 1, 0, z = 0 1 x y z xy 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 f P 1 P 2 P 3 P 4 P 5 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 P 1 = xȳz P 2 = xyz P 3 = xȳz P 4 = xy z P 5 = xyz DNF: f (x, y, z) = xȳz xyz xȳz xy z xyz Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 2

Conjunctive normal form Example: Let f (x, y, z) =xy z. Write this function in CNF. Maxterm takes the value 0 only when x y z x = y = z = 0 x y z xy f M 1 M 2 M 3 0 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 M 1 = x y z 0 1 0 0 0 1 0 1 M 2 = x ȳ z 0 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 M 3 = x y z 1 0 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 CNF: f (x, y, z) = x y z x ȳ z x y z Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 3

Canonical forms of boolean functions Summary: Disjunctive normal form (DNF) is OR of ANDs of all the variables or their negations. Conjunctive normal form (CNF) is AND of ORs of all the variables or their negations. Which of the following is in disjunctive normal form? A: p\/ q B: (p\/ q) \/ (p /\ q) C: (p\/ q) /\ (p\/ q) D: E: (p /\ q) \/ ( p /\ q) More than one of the above Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 4

Canonical forms of boolean functions Summary: Disjunctive normal form (DNF) is OR of ANDs of all the variables or their negations. Conjunctive normal form (CNF) is AND of ORs of all the variables or their negations. Which of the following is in conjunctive normal form? A: p /\ q B: (p\/ q) \/ (p /\ q) C: (p\/ q) /\ (p\/ q) D: E: (p /\ q) \/ ( p /\ q) None of the above Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 5

Simple two-input logic gates Here are the common symbols for some simple logic gates, along with the functions they implement: NOT gate AND gate OR gate f (x) = x f (x, y) =x f (x, y) =x y y NAND gate NOR gate XOR gate f (x, y) =(x y) = x ȳ f (x, y) =(x y) = x ȳ f (x, y) =x y = xy xȳ Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 6

Equivalent circuits and simplification Definition: Two logic circuits are logically equivalent if they implement the same boolean function. Is there a simpler circuit equivalent to the one below? xy f (x,y) y x f (x,y) x y x y f (x, y) = xy (x y) = xy ( xy xȳ) =(xy xy) xȳ = y(x x) xȳ = y xȳ = y x Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 7

Designing logic circuits Example: There are three light switches in a room. Design a circuit so that each switch is a toggle: moving it to the opposite position turns the lights on if they were off, and off is they were on. x y z ~f f 0 0 0 1 0 0 0 1 0 1 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 0 1 x y z Circuit? f (x,y,z) Disjunctive normal form for f (x,y,z): f (x, y, z) = xȳz xy z xȳ z xyz We need six NOT gates, eight AND gates, and three OR gates. Is it possible to simplify this? Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 8

Functionally complete set of gates For every statement form (compound proposition, propositional formula), there is a logically equivalent statement form that can be implemented using... A: only AND gates and OR gates B: only AND gates C: only NAND gates D: only NOT gates E: None or more than one of the above Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 9

Contrapositive, converse, and inverse Example: Consider the following implication statement: If you study hard, then you get an A in CSE20 Write down the contrapositive, the inverse, and the converse of this implication statement. Solution: Let us define: p = study hard and q = get an A in CSE20 Contrapositive (~q ~p): If you do not get an A in CSE20, then you did not study hard. Inverse (~p ~q): If you do not study hard, then you will not get an A in CSE20. Converse (q p): If you get an A in CSE20, then you did study hard. Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 10

Contrapositive, converse, and inverse The following chart summarizes the relationships between an implication, its contrapositive, its converse, and its inverse: p q Converse q p Contrapositive. ~q ~p Logically Equivalent Inverse Inverse Converse ~p ~q Contrapositive. Logically Equivalent Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 11

Contrapositive, converse, and inverse Example: Consider the following implication statement: If the program is running, then there is at least 64KB of RAM Which of the following is logically equivalent to this statement? a: b: c: d: e: f: If there is at least 64KB of RAM, then the program is running. If there is less than 64KB of RAM, then the program is running. The program will run only if there is at least 64KB or RAM. If the program is not running, there is less than 64KB of RAM. A necessary condition for the program to run is that there is at least 64KB of RAM. A sufficient condition for the program to run is that there is at least 64KB of RAM. Lecture Unit 1 CSE 20: Discrete Mathematics for Computer Science 12