The Elements of Computing Systems (From NAND to Tetris) Building a Modern Computer from First Principles.

Slides:



Advertisements
Similar presentations
Chapter 4: Machine Language
Advertisements

Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 1: Boolean Logic slide 1www.idc.ac.il/tecs Chapter 1: Boolean.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Computer Hardware Introduction. Computer System Components Input Keyboard, Mouse, Camera, Touch Pad Processing CPU Output Monitor, Printer Storage Floppy,
Introduction to Computer Programming I CSE 113
COSC 120 Computer Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
CSC 171 – FALL 2004 COMPUTER PROGRAMMING LECTURE 0 ADMINISTRATION.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Combinational Logic1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 8: VM II: Program Control slide 1www.idc.ac.il/tecs Chapter.
Games and Simulations O-O Programming in Java The Walker School
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Intro to CS – Honors I Introduction GEORGIOS PORTOKALIDIS
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.
CMPT 300: Operating Systems
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 2: Boolean Logic slide 1www.idc.ac.il/tecs Chapter 2: Boolean.
1. Fundamentals of Computer Systems Define a computer system Computer Systems in the modern world Professional standards for computer systems Ethical,
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
CS 1 •This is Computer Science 1. •Who is Professor Adams?
Computer Hardware and Software Chapter 1. Overview Brief History of Computers Hardware of a Computer Binary and Hexadecimal Numbers Compiling vs. Interpreting.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 4: Machine Language slide 1www.idc.ac.il/tecs Machine Language.
CSC1401: Introductory Programming Steve Cooper
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
ELE22MIC Lecture 3 Paul Main’s Office Location has moved to Pysical Sciences 2 Room 107 Will be available for 2 hours consultation 10am - 12am after Tuesday.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
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.
CISC105 General Computer Science Class 1 – 6/5/2006.
CHAPTER FOUR COMPUTER SOFTWARE.
Introduction to Interactive Media Interactive Media Tools: Software.
Computer Parts. Two Basic Parts Hardware & Software.
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.nand2tetris.org Building a Modern.
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.
Building a Modern Computer From First Principles
Lecture 2 Programming life cycle. computer piano analogy Piano + player - computer hardware Musical score/notes - software or program Composer - programmer.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 6: Assembler slide 1www.nand2tetris.org Building a Modern Computer.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 4: Machine Language slide 1www.nand2tetris.org Building a Modern.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Java Programming: From the Ground Up
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Assembly Language for x86 Processors 6th Edition
Assembly Language (CSW 353)
Introduction: From Nand to Tetris
Microprocessor Systems Design I
Microprocessor Systems Design I
Introduction to Computer Yung-Yu Chuang
Computer Hardware Introduction.
Virtual Machine Emulator Tutorial
CS190/295 Programming in Python for Life Sciences: Lecture 1
ASIC 120: Digital Systems and Standard-Cell ASIC Design
Computers: Hardware and Software
CPU Emulator Tutorial This program is part of the software suite
Introduction to computers
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

The Elements of Computing Systems (From NAND to Tetris) Building a Modern Computer from First Principles

Authors Professor Shimon Schocken  Information Technologies and Dean of the Efi Arazi School of Computer Science, Interdisciplinary Center Herzliya Professor Noam Nisan  Institute of Computer Science and Engineering, Hebrew University of Jerusalem

introduction  students start with the primitive NAND gate, and using a hardware simulator and HDL, they build basic gates, using which they build an ALU (Arithmatical Logic Unit), going on to building an actual computer (in simulation). Then they create an assembly language for this computer, followed by a high level language, an operating system, and finally a game using the language they created, on the machine they created.

characters  Designed to support one- or two-semester courses  each chapter presents a key hardware or software abstraction  the only pre-requisite being a programming experience  es/course/the-elements-of-computing- systems

contents  Designing elementary logic gates from a NAND gate using Hardware Description Language  Building an ALU (Arithmatic Logic Unit)  Designing Registers, RAM, etc  Designing an assembly language  Building the entire computer (in simulation) with the ALU, Registers, RAM, and the assembly language  Building an Assembler for the assembly language we created  Building a Virtual Machine (similar to the JVM - though much smaller in scope)  Introducing a high level, object oriented programming language  Writing a compiler for the high level language  Writing an Operating System for our computer, using the high level language we created  Some more fun (discussing improvements, and future directions)

1.Designing elementary logic gates from a NAND gate using Hardware Description Language  Resources  The hardware simulator  HDL  Activities

Activities  Download and install the TECS Hardware Simulator  TECS - Build a NOT gate(NAND )  TECS - Build an AND gate(NAND)  TECS - Build an OR gate(NAND)  TECS - Build an XOR gate(NAND, AND, OR)  TECS - Build a MUX(NAND, AND, OR, XOR)  TECS - Build a DMUX(NAND, AND, OR, XOR, MUX)  TECS - Build a 16 bit NOT(NAND, AND, OR, XOR, MUX, DMUX)  TECS - Build a 16 bit AND (NAND, AND, OR, XOR, MUX, DMUX)  TECS - Build a 16 bit OR (NAND, AND, OR, XOR, MUX, DMUX)  TECS - Build a 16 bit MUX (NAND, AND, OR, XOR, MUX, DMUX, 16-NOT, 16-AND, 16-OR)  TECS - Build an 8 Way OR  TECS - Build a 16 bit / 4 Way MUX  TECS - Build a 16 bit / 8 Way MUX  TECS - Build a 4 Way DMUX  TECS - Build an 8 Way DMUX

2.Building an ALU (Arithmatic Logic Unit)  Activities  TECS - Build a Half Adder  TECS - Build a Full Adder  TECS - Build a 16 bit Adder  TECS - Build a 16 bit Incrementer  TECS - Build an ALU

3.Designing Registers, RAM, etc  Activities  TECS - Build a 1 bit binary cell(DFF)  TECS - Build a 16 bit register(DFF)  TECS - Build a 16-bit / 8-register memory(DFF)  TECS - Build a 16-bit / 64-register memory(DFF)  TECS - Build a 16-bit / 512-register memory(DFF)  TECS - Build a 16-bit / 4096-register memory(DFF)  TECS - Build a 16-bit / register memory(DFF)  TECS - Build a 16-bit Program Counter(DFF)

4.Designing an assembly language  Activities  TECS - Get familiar with the assembler and CPU emulator  TECS - Write a assembly language program to multiply two numbers  TECS - Write an IO bound program using our assembly language IO handling: This program runs an infinite loop that listens to the keyboard input. When a key is pressed (any key), the program blackens the screen, i.e. writes "black" in every pixel. When no key is pressed, the screen should be cleared.

5. Building the entire computer (in simulation) with the ALU, Registers, RAM, and the assembly language  Activities  TECS - Create a (simulated) memory chip The Memory chip should be composed from three chips: RAM16K, Screen, and Keyboard.  TECS - Build a (simulated) CPU chip using the ALU and register chips  TECS - Build a (simulated) Computer chip  using the Memory, and CPU chips we created in the past two activities.  Add.hack Adds the two constants 2 and 3 and writes the result in RAM[0]. Add.hack  Max.hack: Computes the maximum of RAM[0] and RAM[1] and writes the result in RAM[2]. Max.hack  Rect.hack: Draws a rectangle of width 16 pixels and length RAM[0] at the top left of the screen. Rect.hack

6. Building an Assembler for the assembly language we created  Activities  TECS - Build an assembler  Develop an assembler that translates programs written in Hack assembly language into the binary code understood by the Hack hardware platform.  write a symbol-less assembler, then extend your assembler with symbol handling capabilities.  use the following *.asm programs for testing your assembler, such as add, max, rect, ping-pong game

7. Building a Virtual Machine (similar to the JVM - though much smaller in scope)  Activities  TECS - Build the Stack Arithmatical part of the VM  TECS - Build the Program Control part of the VM

8. Introducing a high level, object oriented programming language  Activities  TECS - Write a program using Jack

9. Writing a compiler for the high level language  Activities  TECS - Build a Compiler (Syntax Analysis)  TECS - Build a Compiler (Code Generation)

10. Writing an Operating System for our computer, using the high level language we created  Activities  TECS - Build an operating system

11. Some more fun (discussing improvements, and future directions)  Activities  More fun to go

Stanford Computer Science 101 Stanford Online class

Instructor  Nick Parlante  has been teaching Computer Science at Stanford for over 20 years  teaches programming best practices at Google  produced the Google Python Class and codingbat.com code practice site, and the infamous Binky Pointer Fun videoGoogle Python Classcodingbat.comBinky Pointer Fun

Introduction  teaches the essential ideas of Computer Science for a zero-prior-experience audience.  uses small coding experiments in the browser to play with the nature of computers, understanding their strengths and limitations  an excellent first step for someone who then wants to take a full programming course

Syllabus  The nature of computers and code, what they can and cannot do  How computer hardware works: chips, cpu, memory, disk  Necessary jargon: bits, bytes, megabytes, gigabytes  How software works: what is a program, what is "running"  How digital images work  Computer code: loops and logic  Big ideas: abstraction, logic, bugs  How structured data works  How the internet works: ip address, routing, ethernet, wi-fi  Computer security: viruses, trojans, and passwords, oh my!  Analog vs. digital  Digital media, images, sounds, video, compression

 Workload  3-5 hours/week  Registration  Sign up for the "To be announced" session to be notified by when the class is next run  sign up for "Self-Study" to start browsing the class materials right away

Content Organization  lecture videos  eight and twelve minutes /chunk, two hours worth of video content /week  Quiz  programming assignments  does not look like full, professional Javascript code  written document

Lectures  Week1  Introduction to Computing Principles(19 mins)  Variables(6 mins)  Introduction to digital images(13 mins)  Image code(9 mins)  Week2  For Loops(10 mins)  Expressions(14 mins)  Puzzies(4 mins)  Graysclae(14 mins)  Week3  If Logic(16 mins)  Bluescreen( 12 mins)  Hardware(15 mins)  Optional Viedo:hard-drive  Bites Bytes 1(9 mins)  Bites Bytes 2(7 mins)

Lectures cont.  Week4  Software Ⅰ (9 mins)  Software Ⅱ (11 mins)  Networking (16mins)  TCP/IP(16 mins)  Table Date(16 mins)  Week 5  String(4 mins)  Boolean Logic(11 mins)  Count Ⅰ (5 mins)  Count Ⅱ (15 mins)  Analog Digital 1(22 mins)  Week 6  Optional Video: Office Hours  Analog Digital 2(24 mins)  Digital Media(22 mins)  Security(30 mins)  Conclusions(14 mins)

conclusion  Why does the course content and book materials vary so much  Abroad university also has the similar computer foundation course  What should we do? content or method  How can we do? visualization, motivation