Logic: From Greeks to philosophers to circuits. COS 116, Spring 2012 Adam Finkelstein.

Slides:



Advertisements
Similar presentations
INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Administrivia Any new students?
Logic: From Greeks to philosophers to circuits. COS 116: 3/11/2008 Sanjeev Arora.
Memory; Sequential & Clocked Circuits; Finite State Machines COS 116: 3/25/2008 Sanjeev Arora.
Section 10.3 Logic Gates.
1 Boolean Algebra & Logic Design. 2 Developed by George Boole in the 1850s Mathematical theory of logic. Shannon was the first to use Boolean Algebra.
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Self-reproducing programs. And Introduction to logic. COS 116: 3/6/2008 Sanjeev Arora.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Calculus Math Foundations of Computer Science.
Boolean Algebra. Introduction 1854: Logical algebra was published by George Boole  known today as “Boolean Algebra” 1854: Logical algebra was published.
22C:19 Discrete Math Boolean Algebra & Digital Logic Fall 2010 Sukumar Ghosh.
From Greek philosophers to circuits: An introduction to boolean logic. COS 116, Spring 2011 Sanjeev Arora.
How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora.
Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein.
Boolean Algebra – I. Outline  Introduction  Digital circuits  Boolean Algebra  Two-Valued Boolean Algebra  Boolean Algebra Postulates  Precedence.
Memory; Sequential & Clocked Circuits; Finite State Machines
CPSC 171 Introduction to Computer Science Boolean Logic, Gates, & Circuits.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Logic gates & Boolean Algebra. Introduction Certain components (called logic elements) of the computer combine electric pulses using a set of rules. Electric.
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
CSE 311 Foundations of Computing I Spring 2013, Lecture 3 Propositional Logic, Boolean Logic/Boolean Algebra 1.
Computer Organization 1 Logic Gates and Adders. Propositions –Venn Diagrams.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
1 EG 32 Digital Electronics Thought for the day You learn from your mistakes..... So make as many as you can and you will eventually know everything.
Logic Gates & Boolean Algebra Chin-Sung Lin Eleanor Roosevelt High School.
Teaching Computing to GCSE Level with Python Session 3.
June 11, 2002© Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn.
Computing via boolean logic. COS 116: 3/8/2011 Sanjeev Arora.
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.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Laws of Boolean Algebra Commutative Law Associative Law Distributive Law Identity Law De Morgan's Theorem.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
1 GCSE Computing Binary Logic. GCSE Computing 2 Candidates should be able to understand and produce simple logic diagrams using the operations NOT, AND,
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
DIGITAL ELECTRONICS. Everything in digital world is based on binary system. Numerically it involves only two symbols 0 or 1. –0 = False = No –1 = True.
WORKING PRINCIPLE OF DIGITAL LOGIC
L OGIC G ATES Computer Organization – week 3. W HAT ’ S ALU? 1. ALU stands for: Arithmetic Logic Unit 2. ALU is a digital circuit that performs Arithmetic.
Abstraction. Not real, not concrete A view that is removed from the reality Definitely has a "base" in reality – the "base" may be non-intuitive and not.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
Computer Architecture & Operations I
Computer Architecture & Operations I
GCSE OCR Computing A451 Binary logic Computing hardware 6.
Morgan Kaufmann Publishers
Component 1 Logical operators.
Logic Gates and Boolean Algebra
Computer Science 210 Computer Organization
Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn how to how use Boolean algebra to.
Administrivia Course Web:
For OCR GCSE Computing Unit 1 - Theory
CSE 311 Foundations of Computing I
Computer Science 210 Computer Organization
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Digital Logic.
Logic Circuits I Lecture 3.
XOR Function Logic Symbol  Description  Truth Table 
Truth tables Mrs. Palmer.
Presentation transcript:

Logic: From Greeks to philosophers to circuits. COS 116, Spring 2012 Adam Finkelstein

High-level view of self-reproducing program Print 0 Print 1. Print 0... } Prints binary code of B } Takes binary string on tape, and … A B SEE HANDOUT ON COURSE WEB

Binary arithmetic Q: How do we add two binary numbers?

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

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

Boolean “algebra” A AND B written as A  B A OR B written as A + B = = = 1 0  0 = 0 0  1 = 0 1  1 = 1 Funny arithmetic

Claude Shannon ( ) Founder of many fields (circuits, information theory, artificial intelligence…) With “Theseus” mouse

Boolean gates Output voltage is high if both of the input voltages are high; otherwise output voltage low. High voltage = 1 Low voltage = 0 Shannon (1939) x y x · y x y x + y Output voltage is high if either of the input voltages are high; otherwise output voltage low. xx Output voltage is high if the input voltage is low; otherwise output voltage high. (implicit extra wires for power)

Let’s try it out… Boolean Expression E = S AND D Truth table: Value of E for every possible D, S. TRUE=1; FALSE= ESD Boolean Circuit E S D

Combinational circuit Boolean gates connected by wires Important: no cycles allowed Wires: transmit voltage (and hence value)

Examples (Sometimes we use this for shorthand) 4-way AND More complicated example  Crossed wires that are not connected are sometimes drawn like this.  (or this)

Combinational circuits and control “If data has arrived and packet has not been sent, send a signal” Data arrived? Packet sent? S D P Send signal S = D AND (NOT P)

Circuits compute functions Every combinational circuit computes a Boolean function of its inputs InputsOutputs

Ben Revisited B: Ben Bikes R: It is raining E: There is an exam today O: Ben overslept 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. How to write a boolean expression for B in terms of R, E, O?

Ben’s truth table OREB

Truth table  Boolean expression Use OR of all input combinations that lead to TRUE (1) B = O·R·E + O·R·E + O·R·E OREB Note: AND, OR, and NOT gates suffice to implement every Boolean function!

Sizes of representations For k variables: AB…X 00…0 00…0 01…0 01…1 ………… ………… 11…1 k + 1 2k2k k k2k For an arbitrary function, expect roughly half of X’s to be 1 (for 30 inputs roughly 1/2 billion!) Tools for reducing size: (a) circuit optimization (b) modular design

Expression simplification Some simple rules: x + x = 1 x · 1 = x x · 0 = 0 x + 0 = x x + 1 = 1 x + x = x · x = x x · (y + z) = x · y + x · z x + (y · z) = (x+y) · (x+z) x · y + x · y = x · (y + y) = x · 1 = x De Morgan’s Laws: x · y = x + y x + y = x · y

Simplifying Ben’s circuit …

Something to think about: How hard is Circuit Verification? Given a circuit, decide if it is “trivial” (no matter the input, it either always outputs 1 or always outputs 0) Alternative statement: Decide if there is any setting of the inputs that makes the circuit evaluate to 1. Time required?

Boole’s reworking of Clarke’s “proof” of existence of God (see handout – after midterm) General idea: Try to prove that Boolean expressions E 1, E 2, …, E k cannot simultaneously be true Method: Show E 1 · E 2 · … · E k = 0 Discussion for after Break: What exactly does Clarke’s “proof” prove? How convincing is such a proof to you? Also: Do Google search for “Proof of God’s Existence.”

Beyond combinational circuits … Need 2-way communication (must allow cycles!) Need memory (scratchpad) CPU Ethernet card

Circuit for binary addition? Want to design a circuit to add any two N-bit integers. Q: Is the truth table method useful for N=64?

After Break: Modular Design Design an N-bit adder using N 1-bit adders After midterm, read: (a) handout on boolean logic. (b) Boole’s “proof” of existence of God.