Course overview Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken ( www.nand2tetris.org ) www.nand2tetris.org.

Slides:



Advertisements
Similar presentations
Chapter 4: Machine Language
Advertisements

Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 5: Computer Architecture slide 1www.idc.ac.il/tecs Chapter.
Fall 2001CS 4471 CS 447: Fall 2001 Chapter 1: Computer Abstraction and Technology (Introduction to the course)
Chapter 1. Introduction This course is all about how computers work But what do we mean by a computer? –Different types: desktop, servers, embedded devices.
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
Computer Architecture Instructor: Wen-Hung Liao Office: 大仁樓三樓 Office hours: TBA Course web page:
1  1998 Morgan Kaufmann Publishers Lectures for 2nd Edition Note: these lectures are often supplemented with other materials and also problems from the.
Slide 1 Instructor: Dr. Hong Jiang Teaching Assistant: Mr. Sheng Zhang Department of Computer Science & Engineering University of Nebraska-Lincoln Classroom:
ECE 232 L1 Intro.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 1 Introduction.
Course overview Computer Organization and Assembly Languages Yung-Yu Chuang 2007/09/17 with slides by Kip Irvine.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 3: Sequential Logic slide 1www.idc.ac.il/tecs Chapter 3:
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 8: VM II: Program Control slide 1www.idc.ac.il/tecs Chapter.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 7: VM I: Stack Arithmetic slide 1www.idc.ac.il/tecs Chapter.
Computer Organization and Assembly Languages Yung-Yu Chuang
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.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 9: High Level Language slide 1www.idc.ac.il/tecs Chapter.
Introduction Course Overview and Basic understanding of Computer Architecture.
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 7: Virtual Machine I: Stack Arithmetic slide 1www.nand2tetris.org.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 7: Virutal Machine, Part I slide 1www.idc.ac.il/tecs Virtual Machine.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 4: Machine Language slide 1www.idc.ac.il/tecs Machine Language.
Overview Introduction The Level of Abstraction Organization & Architecture Structure & Function Why study computer organization?
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.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Chapter 1 An Introduction to Processor Design 부산대학교 컴퓨터공학과.
CS/ECE 3330 Computer Architecture Kim Hazelwood Fall 2009.
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.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM585 Special Topics in Computer Design.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 2: Boolean Arithmetic slide 1www.nand2tetris.org Building a Modern.
(1) ECE 3056: Architecture, Concurrency and Energy in Computation Lecture Notes by MKP and Sudhakar Yalamanchili Sudhakar Yalamanchili (Some small modifications.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 8: Virtual Machine, Part II slide 1www.idc.ac.il/tecs Virtual Machine.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 8: Virtual Machine, Part II slide 1www.nand2tetris.org Building.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 1: Compiler II: Code Generation slide 1www.nand2tetris.org Building.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 11: Compiler II: Code Generation slide 1www.nand2tetris.org Building.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 7: Virutal Machine, Part I slide 1www.nand2tetris.org Building.
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.
Course overview Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken ( )
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 10: Compiler I: Syntax Analysis slide 1www.nand2tetris.org Building.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 10: Compiler I: Syntax Analysis slide 1www.nand2tetris.org Building.
1 ECE3055 Computer Architecture and Operating Systems Lecture 1 Introduction Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 9: High-Level Language slide 1www.nand2tetris.org Building a Modern.
Lecture 0. Program Introduction Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
Building a Modern Computer From First Principles
12/13/ _01 1 Computer Organization EEC-213 Computer Organization Electrical and Computer Engineering.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 7: Virutal Machine, Part I slide 1www.nand2tetris.org Building.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO CS 219 Computer Organization.
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.
Elements of Computing Systems, Nisan & Schocken, MIT Press, Chapter 4: Machine Language slide 1www.nand2tetris.org Building a Modern.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University COM515 Advanced Computer Architecture.
Computer Architecture Opening Yu-Lun Kuo 郭育倫 Department of Computer Science and Information Engineering Tunghai University Taichung, 40704, Taiwan R.O.C.
Computer Architecture Furkan Rabee
0. Course Introduction Rocky K. C. Chang, 25 August 2017.
CSC235 Computer Organization & Assembly Language
ECE 3056: Architecture, Concurrency and Energy in Computation
Introduction: From Nand to Tetris
CS 310: Computer Organization and Programming
Virtual Machine Part I: Stack Arithmetic
课程名 编译原理 Compiling Techniques
Introduction to Computer Yung-Yu Chuang
Compiler I: Sytnax Analysis
CDA 3100 Spring 2009.
Chapter 1 Introduction.
Presentation transcript:

Course overview Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken ( )

Logistics Meeting time: 2:20pm-5:20pm, Tuesday Classroom: CSIE Room 104 Instructor: 莊永裕 Yung-Yu Chuang Teaching assistant: TBD Webpage: id / password Mailing list: Please subscribe via

Textbook The Elements of Computing Systems, Noam Nisan, Shimon Schocken, MIT Press

References (TOY) Princeton’s Introduction to CS, cs/50machine/ cs/50machine/ cs/60circuits/

References CODE: The Hidden Language of Computer Hardware and Software, Charles Petzold, Microsoft Press. Digital Design and Computer Architecture, 2 nd Edition, David Harris and Sarah Harris, Morgan Kaufmann.

Grading (subject to change) Assignments (n projects, 60%) from the accompanying website Class participation (4%) Midterm exam (16%) Final project (20%)

Early computers

Early programming tools

First popular PCs

Early PCs Intel 8086 processor 768KB memory 20MB disk Dot-Matrix printer (9-pin)

GUI/IDE

More advanced architectures Pipeline SIMD Multi-core Cache

More advanced software

More “computers” around us

My computers iPhone 5 (A6, ARM Cortex-A15?) iPad 2 (dual-core A5 1GHz) VAIO Z46TD (Intel Core 2 Duo P GHz) Desktop (Intel Pentium D 3GHz, Nvidia 7900)

Goal of the course

The course at a glance Objectives: Understand how hardware and software systems are built and how they work together Learn how to break complex problems into simpler ones Learn how large scale development projects are planned and executed Have fun Methodology: Build a complete, general-purpose and working computer system Play and experiment with this computer, at any level of interest

TOY machine

Starting from a simple construct

TOY machine Build several components and connect them together

TOY machine Almost as good as any computers

TOY machine ADUP32 ldaR1, 1 ldaRA, A ldaRC, 0 readldRD, 0xFF bzRD, exit addR2, RA, RC stiRD, R2 addRC, RC, R1 bzR0, read exitjlRF, printr hlt int A[32]; i=0; Do { RD=stdin; if (RD==0) break; A[i]=RD; i=i+1; } while (1); printr(); 10: C020 20: : 7A00 22: 7C00 23: 8DFF 24: CD29 25: 12AC 26: BD02 27: 1CC1 28: C023 29: FF2B 2A: 0000

From NAND to Tetris The elements of computing systems Courses Software Cool stuffs

Pong on the Hack computer Pong, 1985Pong, 2011 Pong, on our computer

Theme and structure of the book Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12 (Abstraction–implementation paradigm)

Application level: Pong (an example)

The big picture Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12

High-level programming (Jack language) /** A Graphic Bat for a Pong Game */ class Bat { field int x, y; // screen location of the bat's top-left corner field int width, height; // bat's width & height // The class constructor and most of the class methods are omitted /** Draws (color=true) or erases (color=false) the bat */ method void draw(boolean color) { do Screen.setColor(color); do Screen.drawRectangle(x,y,x+width,y+height); return; } /** Moves the bat one step (4 pixels) to the right. */ method void moveR() { do draw(false); // erase the bat at the current location let x = x + 4; // change the bat's X-location // but don't go beyond the screen's right border if ((x + width) > 511) { let x = width; } do draw(true); // re-draw the bat in the new location return; } /** A Graphic Bat for a Pong Game */ class Bat { field int x, y; // screen location of the bat's top-left corner field int width, height; // bat's width & height // The class constructor and most of the class methods are omitted /** Draws (color=true) or erases (color=false) the bat */ method void draw(boolean color) { do Screen.setColor(color); do Screen.drawRectangle(x,y,x+width,y+height); return; } /** Moves the bat one step (4 pixels) to the right. */ method void moveR() { do draw(false); // erase the bat at the current location let x = x + 4; // change the bat's X-location // but don't go beyond the screen's right border if ((x + width) > 511) { let x = width; } do draw(true); // re-draw the bat in the new location return; } Typical call to an OS method

Operating system level (Jack OS) /** An OS-level screen driver that abstracts the computer's physical screen */ class Screen { static boolean currentColor; // the current color // The Screen class is a collection of methods, each implementing one // abstract screen-oriented operation. Most of this code is omitted. /** Draws a rectangle in the current color. */ // the rectangle's top left corner is anchored at screen location (x0,y0) // and its width and length are x1 and y1, respectively. function void drawRectangle(int x0, int y0, int x1, int y1) { var int x, y; let x = x0; while (x < x1) { let y = y0; while(y < y1) { do Screen.drawPixel(x,y); let y = y+1; } let x = x+1; } /** An OS-level screen driver that abstracts the computer's physical screen */ class Screen { static boolean currentColor; // the current color // The Screen class is a collection of methods, each implementing one // abstract screen-oriented operation. Most of this code is omitted. /** Draws a rectangle in the current color. */ // the rectangle's top left corner is anchored at screen location (x0,y0) // and its width and length are x1 and y1, respectively. function void drawRectangle(int x0, int y0, int x1, int y1) { var int x, y; let x = x0; while (x < x1) { let y = y0; while(y < y1) { do Screen.drawPixel(x,y); let y = y+1; } let x = x+1; }

The big picture Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12

A modern compilation model

Compilation 101 Observations: Modularity Abstraction / implementation interplay The implementation uses abstract services from the level below. parsing Code generation Source code (x + width) > 511 Abstraction push x push width add push 511 gt push x push width add push 511 gt Intermediate code ImplementationSyntax Analysis Parse Tree Semantic Synthesis

The virtual machine (VM modeled after JVM) if ((x+width)>511) { let x=511-width; }

The big picture Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12

Low-level programming (on Hack)

The big picture Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12

Machine language semantics (Hack) Code syntax Instruction code (0=“address” inst.) Address ALU operation code ( M-1 ) Destination Code ( M ) Jump Code ( no jump ) Code semantics, as interpreted by the Hack hardware platform Instruction code (1=“compute” inst.) M=M-1 We need a hardware architecture that realizes this semantics The hardware platform should be designed to: o Parse instructions, and o Execute them.

Computer architecture (Hack) A typical Von Neumann machine

The big picture Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12

Logic design Combinational logic (leading to an ALU) Sequential logic (leading to a RAM) Putting the whole thing together (leading to a computer) Using … gate logic

Gate logic Interface Implementation Hardware platform = inter-connected set of chips Chips are made of simpler chips, all the way down to elemantary logic gates Logic gate = hardware element that implements a certain Boolean function Every chip and gate has an interface, specifying WHAT it is doing, and an implementation, specifying HOW it is doing it.

Hardware description language (HDL)

The tour ends: Interface One implementation option (CMOS)

ElectronicsDigital System Design Computer Architecture Operating System Compiler The tour map, revisited Assembler Chapter 6 H.L. Language & Operating Sys. abstract interface Compiler Chapters VM Translator Chapters Computer Architecture Chapters Gate Logic Chapters Electrical Engineering Physics Virtual Machine abstract interface Software hierarchy Assembly Language abstract interface Hardware hierarchy Machine Language abstract interface Hardware Platform abstract interface Chips & Logic Gates abstract interface Human Thought Abstract design Chapters 9, 12 Course overview: Building this world, from the ground up

What you will learn Number systems Combinational logic Sequential logic Basic principle of computer architecture Assembler Virtual machine High-level language Fundamentals of compilers Basic operating system Application programming

In short