Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 1: Boolean Logic slide 1www.nand2tetris.org Building a Modern.

Slides:



Advertisements
Similar presentations
Chapter 4: Machine Language
Advertisements

CT455: Computer Organization Logic gate
Computer Science 210 Computer Organization Introduction to Logic Circuits.
Programmable Logic Controllers.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 1: Boolean Logic slide 1www.idc.ac.il/tecs Chapter 1: Boolean.
INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 5: Computer Architecture slide 1www.idc.ac.il/tecs Chapter.
CS 151 Digital Systems Design Lecture 7 More Logic Functions: NAND, NOR, XOR.
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 3: Sequential Logic slide 1www.idc.ac.il/tecs Chapter 3:
Functional Notation Addendum to Chapter 4. 2 Logic Notation Systems We have seen three different, but equally powerful, notational systems for describing.
Lecture 8 Topics –Switch –Transistor –CMOS transistor –Logic gates AND, OR, NOT Universal gates: NAND, NOR XOR.
22C:19 Discrete Math Boolean Algebra & Digital Logic Fall 2010 Sukumar Ghosh.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Introduction: Hello, World Below slide 1www.idc.ac.il/tecs Introduction:
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 10: Compiler I: Syntax Analysis slide 1www.idc.ac.il/tecs.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 2: Boolean Logic slide 1www.idc.ac.il/tecs Chapter 2: Boolean.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 10: Compiler I: Syntax Analysis slide 1www.idc.ac.il/tecs Compiler.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 4: Machine Language slide 1www.idc.ac.il/tecs Machine Language.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Elementary Digital Logic Apps O/S Arch  Arch Logic Digital Analog.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 6: Assembler slide 1www.idc.ac.il/tecs Assembler Elements of Computing.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 5: Computer Architecture slide 1www.idc.ac.il/tecs Computer Architecture.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 5: Computer Architecture slide 1www.nand2tetris.org Building a.
Slide 1/8Jack IDE Tutorial, Index This program is part of the software suite that accompanies the book The Elements of Computing.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
Digital Electronics Lecture 4 Simplification using Boolean Algebra, Combinational Logic Circuit Design.
Building a Modern Computer From First Principles
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 11: Compiler II: Code Generation slide 1www.idc.ac.il/tecs.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 1www.idc.ac.il/tecs Boolean Logic Elements.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 2: Boolean Arithmetic slide 1www.nand2tetris.org Building a Modern.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 11: Compiler II: Code Generation slide 1www.nand2tetris.org Building.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /05/2013 Lecture 4: Basics of Logic Design Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
Boolean Algebra & Logic Prepared by Dr P Marais (Modified by D Burford)
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 3: Sequential Logic slide 1www.idc.ac.il/tecs Sequential Logic.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 3: Sequential Logic slide 1www.nand2tetris.org Building a Modern.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 10: Compiler I: Syntax Analysis slide 1www.nand2tetris.org Building.
Boolean logic Introduction to Computer Yung-Yu Chuang with slides by Sedgewick & Wayne ( introcs.cs.princeton.edu ), Nisan & Schocken (
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 9: High-Level Language slide 1www.nand2tetris.org Building a Modern.
Building a Modern Computer From First Principles
CEC 220 Digital Circuit Design Boolean Algebra I Wed, Sept 2 CEC 220 Digital Circuit Design Slide 1 of 13.
Chapter 4 Fundamentals of Computer Logic 1 Chapter 4: Fundamental of Computer Logic - IE337.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 6: Assembler slide 1www.nand2tetris.org Building a Modern Computer.
Logic Simplification-Using Boolean Laws Logic Design Laboratory EE 2121 Lectures By Manesh T EE2121-In Charge
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.
NAND, NOR, and EXOR (more primitive logical gates) CS Computer Architecture David Mayer.
Logic Gates and Boolean Algebra Introduction to Logic II.
Dr. ClincyLecture Slide 1 CS6020- Chapter 3 (3A and ) Dr. Clincy Professor of CS First Exam - Tuesday, September 6th Coverage: All subjects up to.
Logic gates.
Computer Architecture & Operations I
Boolean Algebra & Logic Gates
Morgan Kaufmann Publishers
Computer Code.
Logic Gates and Boolean Algebra
Python: Logic Gates Damian Gordon.
CHAPTER 3 SETS AND BOOLEAN ALGEBRA
Basic Logical Operations (Fascinating)
Digital Signals Digital Signals have two basic states:
Compiler I: Sytnax Analysis
Computer Science 210 Computer Organization
CS Chapter 3 (3A and ) Part 3 of 8
CSC 220: Computer Organization Logic Gates and Functions
CS Chapter 3 (3A and ) – Part 2 of 5
GCSE Computer Science – Logic Gates & Boolean Expressions
Digital Logic Design Basics Combinational Circuits Sequential Circuits.
Agenda Lecture Content: Combinatorial Circuits Boolean Algebras
Presentation transcript:

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 1www.nand2tetris.org Building a Modern Computer From First Principles Boolean Logic

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 2www.nand2tetris.org Usage and Copyright Notice: Copyright © Noam Nisan and Shimon Schocken This presentation contains lecture materials that accompany the textbook “The Elements of Computing Systems” by Noam Nisan & Shimon Schocken, MIT Press, We provide both PPT and PDF versions. Our web site, a set of presentations, one for each book chapter. Each presentation is designed to support about 3 hours of classroom or self-study instruction. You are welcome to use or edit this presentation as you see fit for instructional and non- commercial purposes. If you use our materials, please include a reference to If you have any questions or comments, please write us at

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 3www.nand2tetris.org Boolean algebra Some elementary Boolean functions: Not(x) And(x,y) Or(x,y) Nand(x,y) x y z Boolean functions: A Boolean function can be expressed using a functional expression or a truth table expression Important observation: Every Boolean function can be expressed using And, Or, Not. x y Nand(x,y) x y Nand(x,y) x y And(x,y) x y And(x,y) x y Or(x,y) x y Or(x,y) x Not(x) x Not(x)

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 4www.nand2tetris.org All Boolean functions of 2 variables

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 5www.nand2tetris.org Boolean algebra Given: Nand(a,b), false We can build: Not(a) = Nand(a,a) true = Not(false) And(a,b) = Not(Nand(a,b)) Or(a,b) = Not(And(Not(a),Not(b))) Xor(a,b) = Or(And(a,Not(b)),And(Not(a),b))) Etc. George Boole, (“A Calculus of Logic”)

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 6www.nand2tetris.org Gate logic Gate logic – a gate architecture designed to implement a Boolean function Elementary gates: Composite gates: Important distinction: Interface (what) VS implementation (how).

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 7www.nand2tetris.org Gate logic Xor(a,b) = Or(And(a,Not(b)),And(Not(a),b))) Implementation Interface Claude Shannon, (“Symbolic Analysis of Relay and Switching Circuits” )

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 8www.nand2tetris.org Circuit implementations From a computer science perspective, physical realizations of logic gates are irrelevant.

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 9www.nand2tetris.org Project 1: elementary logic gates Given: Nand(a,b), false Build: Not(a) =... true =... And(a,b) =... Or(a,b) =... Mux(a,b,sel) =... Etc gates altogether. a b Nand(a,b) a b Nand(a,b) Q: Why these particular 12 gates? A: Since … They are commonly used gates They provide all the basic building blocks needed to build our computer.

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 10www.nand2tetris.org Multiplexer Proposed Implementation: based on Not, And, Or gates. a b sel out a b sel out sel out 0 a 1 b sel out 0 a 1 b

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 11www.nand2tetris.org a b out a b out And.cmp load And.hdl, output-file And.out, compare-to And.cmp, output-list a b out; set a 0,set b 0,eval,output; set a 0,set b 1,eval,output; set a 1,set b 0,eval,output; set a 1, set b 1, eval, output; load And.hdl, output-file And.out, compare-to And.cmp, output-list a b out; set a 0,set b 0,eval,output; set a 0,set b 1,eval,output; set a 1,set b 0,eval,output; set a 1, set b 1, eval, output; And.tstAnd.hdl CHIP And { IN a, b; OUT out; // implementation missing } CHIP And { IN a, b; OUT out; // implementation missing } Example: Building an And gate Contract: When running your.hdl on our.tst, your.out should be the same as our.cmp.

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 12www.nand2tetris.org Building an And gate CHIP And { IN a, b; OUT out; // implementation missing } CHIP And { IN a, b; OUT out; // implementation missing } And.hdl Interface: And(a,b) = 1 exactly when a=b=1

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 13www.nand2tetris.org Implementation: And(a,b) = Not(Nand(a,b)) Building an And gate CHIP And { IN a, b; OUT out; // implementation missing } CHIP And { IN a, b; OUT out; // implementation missing } And.hdl

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 14www.nand2tetris.org Implementation: And(a,b) = Not(Nand(a,b)) CHIP And { IN a, b; OUT out; // implementation missing } CHIP And { IN a, b; OUT out; // implementation missing } And.hdl Building an And gate

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 15www.nand2tetris.org CHIP And { IN a, b; OUT out; Nand(a = a, b = b, out = x); Not(in = x, out = out) } CHIP And { IN a, b; OUT out; Nand(a = a, b = b, out = x); Not(in = x, out = out) } Implementation: And(a,b) = Not(Nand(a,b)) Building an And gate And.hdl

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 16www.nand2tetris.org Hardware simulator (demonstrating Xor gate construction) test script HDL program

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 17www.nand2tetris.org Hardware simulator HDL program

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 18www.nand2tetris.org HDL program Hardware simulator output file

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 19www.nand2tetris.org Project materials: Project 1 web site And.hdl, And.tst, And.cmp files

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 20www.nand2tetris.org Project 1 tips Read the Introduction + Chapter 1 of the book Download the book’s software suite Go through the hardware simulator tutorial Do Project 0 (optional) You’re in business.

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 21www.nand2tetris.org Perspective Each Boolean function has a canonical representation The canonical representation is expressed in terms of And, Not, Or And, Not, Or can be expressed in terms of Nand alone Ergo, every Boolean function can be realized by a standard PLD consisting of Nand gates only Mass production Universal building blocks, unique topology Gates, neurons, atoms, …

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 22www.nand2tetris.org End notes: Canonical representation Whodunit story: Each suspect may or may not have an alibi (a), a motivation to commit the crime (m), and a relationship to the weapon found in the scene of the crime (w). The police decides to focus attention only on suspects for whom the proposition Not(a) And (m Or w) is true. Truth table of the "suspect" function Canonical form:

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 23www.nand2tetris.org End notes: Canonical representation (cont.)

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 24www.nand2tetris.org End notes: Programmable Logic Device for 3-way functions

Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Boolean Logic slide 25www.nand2tetris.org End notes: universal building blocks, unique topology