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

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
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.
Logic: From Greeks to philosophers to circuits. COS 116: 3/11/2008 Sanjeev Arora.
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
1 Digital Logic
Chapter 4 Gates and Circuits.
Memory; Sequential & Clocked Circuits; Finite State Machines COS 116: 3/25/2008 Sanjeev Arora.
1 Lecture 11: Digital Design Today’s topics:  Evaluating a system  Intro to boolean functions.
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.
Self-reproducing programs. And Introduction to logic. COS 116: 3/6/2008 Sanjeev Arora.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Digital Design.
Propositional Calculus Math Foundations of Computer Science.
Logic Gates Circuits to manipulate 0’s and 1’s. 0’s and 1’s used for numbers Also to make decisions within the computer. In that context, 1 corresponds.
Logic Gate A logic gate is an electronic circuit which makes logic decisions. It has one output and one or more inputs. The output signal appears only.
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.
Logic: From Greeks to philosophers to circuits. COS 116, Spring 2012 Adam Finkelstein.
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.
Digital Systems Presented by Prof Tim Johnson
Digital Logic Circuits – Chapter 1 Section 1-3, 1-2.
Boolean Logic By: Arthur Brooks February 25, 2003 Think, Speak, and Write Computer Science.
Memory; Sequential & Clocked Circuits; Finite State Machines
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
CPSC 171 Introduction to Computer Science Boolean Logic, Gates, & Circuits.
CS 1308 – Computer Literacy and the Internet. It’s Not Magic  The goal of the next series of lectures is to show you exactly how a computer works. 
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Chapter 2: Binary Logic.
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.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
Computer Organization 1 Logic Gates and Adders. Propositions –Venn Diagrams.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Chapter 10 (Part 2): Boolean Algebra  Logic Gates (10.3) (cont.)  Minimization of Circuits (10.4)
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
Apr. 3, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 3: Review of Digital Circuits and Logic Design Jeremy R. Johnson Mon. Apr.
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.
A-Level Computing#BristolMet Session Objectives#6 MUST understand and produce simple logic diagrams using the operations NOT, AND and OR SHOULD explain.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Some basic electronics and truth tables Some material on truth tables can be found in Chapter 3 of Digital Principles (Tokheim)
June 11, 2002© Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn.
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
CS 1308 – Computer Literacy and the Internet Building the CPU.
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
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.
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,
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.
WORKING PRINCIPLE OF DIGITAL LOGIC
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Boolean Algebra Learning Objectives Learn that Boolean algebra produces a result that equals TRUE or FALSE Learn how truth tables are used to represent.
CS231: Computer Architecture I Laxmikant Kale Fall 2002.
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
Logic gates.
Computer Architecture & Operations I
Morgan Kaufmann Publishers
Computer Architecture CST 250
Jeremy R. Johnson Wed. Sept. 29, 1999
Boolean Logic Boolean Logic is considered to be the basic of digital electronics. We know that a computer’s most basic operation is based on digital electronics.
CMSC250 Fall 2018 Circuits 1 1.
XOR Function Logic Symbol  Description  Truth Table 
Presentation transcript:

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

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 Funny arithmetic Will provide readings on this…

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 low. (implicit extra wires for power)

Claude Shannon ( ) Founder of many fields (circuits, information theory, artificial intelligence…) With “Theseus” mouse A Symbolic Analysis of Relay and Switching Circuits, [1938]

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.

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?

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

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 In groups of three try to simplify: O·R·E + O·R·E + O·R·E

Simplifying Ben’s circuit …

Boole’s reworking of Clarke’s “proof” of existence of God (see handout) 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 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.”

The Kalam argument for god’s existence (arose in many world traditions) Whatever that begins to exist has a cause. The universe began to exist. If there is no original cause (i.e., God) then there must be an infinite chain of causal events, which is impossible. Does this remind you of other issues studied in the course?

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

Combinational circuit for binary addition? Want to design a circuit to add any two N- bit integers (say N =64) Is the truth table method useful? Ideas?

Modular design Have small number of basic components. Put them together to achieve desired functionality Basic principle of modern industrial design; recurring theme in next few lectures.

1-bit adder (Carry from previous adder) Hand in on Mar 22: Truth table, circuit for 1-bit adder. akak bkbk ckck 1-ADD c k+1 sksk Carry bit for next adder.

Modular Design for boolean circuits An N-bit adder using N 1-bit adders (will do Mar 22)

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?

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

(1) A waveform is sampled at a rate of 4 Hz and 4-bit samples. The following is the sequence of samples. Draw the waveform (hand it in). Is your answer unique? If not, Draw another waveform consistent with the samples. 10, 11, 11, 11, 5, 0, 8, 11, 11, 11, 15. (2) Suppose variable i has value 4 and j has the value 8. What values do they have after the following instruction is executed: i  j/i? (3)Your computer runs at 3Ghz. How may operations per sec (roughly) does it do?