From Greek philosophers to circuits: An introduction to boolean logic. COS 116, Spring 2011 Sanjeev Arora

Similar documents
Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein

Computing via boolean logic. COS 116: 3/8/2011 Sanjeev Arora

COMP 2600: Formal Methods for Software Engineeing

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

THE LOGIC OF COMPOUND STATEMENTS

Doc112: Hardware. Department of Computing, Imperial College London. Doc112: Hardware Lecture 1 Slide 1

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

Chapter 1: The Logic of Compound Statements. January 7, 2008

MAT2345 Discrete Math

IST 4 Information and Logic

CS Module 1. Ben Harsha Apr 12, 2017

cse541 LOGIC FOR COMPUTER SCIENCE

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

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. February 9, :30 pm Duration: 1:50 hs. Closed book, no calculators

02 Propositional Logic

CS 173 Lecture 2: Propositional Logic

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

IST 4 Information and Logic

Logic for Computer Science - Week 5 Natural Deduction

Chapter 4, Logic using Propositional Calculus Handout

Intro To Digital Logic

Boolean Algebra, Gates and Circuits

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

CS 226: Digital Logic Design

Chapter 2: Introduction to Propositional Logic

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

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC

Logical Form 5 Famous Valid Forms. Today s Lecture 1/26/10

Propositional Logic. Fall () Propositional Logic Fall / 30

CSE 20: Discrete Mathematics

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

The Arithmetic of Reasoning. Chessa Horomanski & Matt Corson

CSC9R6 Computer Design. Practical Digital Logic

CSE 311 Lecture 28: Undecidability of the Halting Problem. Emina Torlak and Kevin Zatloukal

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

CSC 125 :: Final Exam December 14, 2011

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

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

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

MODULE- 07 : FLUIDICS AND FLUID LOGIC

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Topic 1: Propositional logic

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

Compound Propositions

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

CSE 20 DISCRETE MATH. Fall

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

CPSC 121 Midterm 1 Tuesday, October 11th, 2011

Propositional Logic. Spring Propositional Logic Spring / 32

What is logic, the topic of this course? There are at least two answers to that question.

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

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

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Computability and Complexity

INTRODUCTION. Tomoya Sato. Department of Philosophy University of California, San Diego. Phil120: Symbolic Logic Summer 2014

Building a Computer Adder

Logic Overview, I. and T T T T F F F T F F F F

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

Chapter 1: Formal Logic

Fundamentals of Digital Design

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

Math.3336: Discrete Mathematics. Propositional Equivalences

S C F F F T T F T T S C B F F F F F T F T F F T T T F F T F T T T F T T T

Combinatorial Logic Design Multiplexers and ALUs CS 64: Computer Organization and Design Logic Lecture #13

Lab 1 starts this week: go to your session

From Sequential Circuits to Real Computers

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Examples. Example (1) Example (2) Let x, y be two variables, and denote statements p : x = 0 and q : y = 1. Solve. x 2 + (y 1) 2 = 0.

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Logic and Proofs. (A brief summary)

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

Section 1.1: Logical Form and Logical Equivalence

8. Reductio ad absurdum

CS/COE0447: Computer Organization

Inference and Proofs (1.6 & 1.7)

Computation. Some history...

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

cis32-ai lecture # 18 mon-3-apr-2006

MATH 2001 MIDTERM EXAM 1 SOLUTION

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

Victoria Gitman and Thomas Johnstone. New York City College of Technology, CUNY

Boolean Algebra & Digital Logic

Logic Review Solutions

Symbolic Logic. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February 5 6,

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

Announcements. Exam 1 Review

Propositional Logic: Equivalence

Review: Additional Boolean operations

Symbolic Logic Outline

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

20. Combinational Circuits

Propositional Logic: Bottom-Up Proofs

Boolean algebra. Values

Complexity Theory. Ahto Buldas. Introduction September 10, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

CS 730/730W/830: Intro AI

Transcription:

From Greek philosophers to circuits: An introduction to boolean logic. COS 116, Spring 2011 Sanjeev Arora

Midterm One week from today in class Mar 10 Covers lectures, labs, homework, readings to date You can use the pseudocode handout during exam; no other material.

Recap: Self-Reproduction Fallacious argument for impossibility: Blueprint Blueprint Blueprint

Droste Effect

Fallacy Resolved: Blueprint can involve computation; need not be an exact copy! Print the following sentence twice, the second time in quotes. Print the following sentence twice, the second time in quotes.

High-level view of self-reproducing program A B Print 0 Go Right Print 1...Print 0........................ } Prints binary code of B }Takes binary string on tape, and in its place prints (in English) the sequence of statements that produce it, followed by the translation of the binary string into English.

Self-reproducing programs MyDoom Reproduce program send to someone else! Crash user s computer! Fact: for every program P, there exists a program P that has the exact same functionality except at the end it also prints code(p ) on the tape

Self-reproducing machines [John von Neumann, 1940s] 2-D and 3-D cellular automata (with a moving arm controlled by the automaton itself) that makes a precise copy of itself. Accidental changes during copying --> mutations, evolution This and related ideas of Pauli motivated discovery of the molecular basis of life on earth (DNA, RNA etc.)

Moving on to part 2 Upcoming lectures: Computational Hardware Boolean logic and Boolean circuits Sequential circuits (circuits with memory) Clocked circuits and Finite State Machines CPUs Operating System Networks, Internet

Discussion Time Ben only rides to class if he overslept, but even then if it is raining he ll walk and show up late (he hates to bike in the rain). But if there s an exam that day he ll bike if he overslept, even in the rain. It is raining today, Ben overslept, and there s an exam. Will Ben bike today? Logical reasoning, Propositional logic.

Propositional Logic: History Aristotle Law of excluded middle, Law of contradiction. Stoic Philosophers (3 rd century BC) Basic inference rules (modus ponens etc.) Some work by medieval philosophers De Morgan and Boole (19 th century): Symbolic logic automated, mechanical C. Shannon (1930s) Proposal to use digital hardware

Example Ed goes to the party if Dan does not and Stella does. Choose Boolean variables for 3 events: { Each E: Ed goes to party D: Dan goes to party S: Stella goes to party} E = S AND (NOT D) Alternately: E = S AND D is either TRUE or FALSE

Logical OR Ed goes to the party if Dan goes or Stella goes E = D OR S E is TRUE if one or both of D and S are TRUE Note: Different from everyday meaning of OR! Example: You can eat an orange or an apple

Boolean expressions Composed of boolean variables, AND, OR, NOT Examples: D AND ( P OR (NOT Q)) C OR D OR E

Truth table Lists the truth value of the Boolean expression for all combinations of values for the variables. Boolean Expression E = S AND D Truth table 0 = FALSE 1 = TRUE For all possible values of D, S, write corresponding value of E D 0 0 1 1 S 0 1 0 1 E 0 1 0 0

Let s work an example Boolean Expression E = D OR S What are x and y?!? D S E Possible answers: x=0, y=0 x=0, y=1 x=1, y=0 X=1, y=1 0 0 1 1 0 1 0 1 1 x y 1

Ben Revisited Ben only rides to class if he overslept. But even then if it is raining he ll walk and show up late (he hates to bike in the rain). But if there s an exam that day he ll bike if he overslept, even in the rain. B: Ben Bikes R: It is raining E: There is an exam today O: Ben overslept Break up in groups of three and come up with (a) Truth table for B in terms of values of R, E, O (b) Boolean expression for B in terms of R, E and O.

Fail-safe method to work out the expression: the truth table Expression for O = OR of all input combinations that make O TRUE O R E B 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1

Boolean algebra A AND B written as A B A OR B written as A + B 0 0 = 0 0 1 = 0 1 1 = 1 0 + 0 = 0 1 + 0 = 1 1 + 1 = 1 Will provide readings on this Funny arithmetic

Truth table Boolean expression Use OR of all input combinations that lead to TRUE B = O R E + O R E + O R E O R E B 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1 Note: AND, OR, and NOT gates suffice to implement every Boolean function (basis of the implementation of universal computer in silicon chips)!

Sizes of representations For k variables: A B X k 10 20 30 2 k 1024 1048576 1073741824 For an arbitrary function, expect roughly half of X s to be 1 (for 30 inputs roughly 1/2 billion!) 2 k 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 Tools for reducing size: (a) circuit optimization (b) modular design k + 1

Boolean circuit Pictorial representation of Boolean expression using special symbols for AND, OR and NOT A AND B A OR B A

Three Equivalent Representations Boolean Expression E = S AND D Boolean Circuit D S E D S E 0 0 0 0 1 1 TRUE=1; FALSE= 0. 1 0 0 1 1 0 Truth table: Value of E for every possible D, S.

Next time: Boolean circuits, the basic components of the digital world Midterm will have a question on boolean logic.

Ed goes to the party if Dan doesn t AND Stella doesn t E = D AND S Is this equivalent to:.? Ed goes to the party if NOT (Dan goes OR Stella goes) (De Morgan s Laws)

Readings for Tues on website Theory of everything. Boole s reformulation of Clarke s proof of existence of God To hand in next time (participation grade): What you understood from boole s proof and your reaction to it. (1 para)