50
臺大電機吳安宇教授- 計算機結構 Computer Architecture 計算機結構 (901 43200) 臺大電機系 吳安宇教授 2004/09/12

Chapter1 v.2 09-15-2004access.ee.ntu.edu.tw/course/computer_organization_93first...臺大電機吳安宇教授- 計算機結構 Textbook and Reference Textbook: (Main) “Computer

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • 臺大電機吳安宇教授- 計算機結構

    Computer Architecture計算機結構 (901 43200)

    臺大電機系吳安宇教授

    2004/09/12

  • 臺大電機吳安宇教授- 計算機結構

    Course Outline Instructor: 吳安宇副教授, E-mail: [email protected] , Phone Extension: 441 TA: 沈文中, E-mail: [email protected] Prerequisite: Basic Logic Designs, High-level programming

    languages (C/C++ programming)

    Outline: Chapter 1 Computer Abstractions and Technology Chapter 2 Instructions: Language of the Computer Chapter 3 Arithmetic For Computers Chapter 4 Assessing and Understanding Performance of CPU Chapter 5 The Processor: Data Path and Control Chapter 7 Large and Fast: Exploiting Memory Hierarchy Chapter 8 Storage, Networks, and Other Peripherals Chapter 6 Enhancing CPU Performance with Pipelining with

    concept of Chapter 5

  • 臺大電機吳安宇教授- 計算機結構

    Textbook and Reference Textbook:

    (Main) “Computer organization and design: The hardware/software interface”,by David A. Patterson and John L. Hennessy, 2005, 3rd Edition (新月, 東華).

    (Verilog Coding, optional)“Advanced Digital Design with the Verilog HDL,”by M.D. Ciletti, Prentice Hall, 2003.

    (Verilog Coding, optional)“Verilog HDL: A Guide to Digital Design andSynthesis,”2nd ed., by Samir Palnitkar, SunSoft Press, 2003 (全華)

    References:

    (General) “Structured Computer Organization,”by Andrew S. Tanenbaum,Prentice Hall, 1999, 4th edition (高立圖書).

    (General) "Computer organization and architecture - Designing forperformance," by William Stallings, 4th edition, Prentice-Hall International, Inc.,1996 (開發).

    (Advanced reading, graduate/senior level) “Computer architecture: AQuantitative Apporach,”by John L. Hennessy and David A. Patterson, 2003,3rd Edition (新月, 東華).

  • 臺大電機吳安宇教授- 計算機結構

    Grading Rules: Grading method:

    Mid-term exam 30%, Final exam 35%

    Homework 15% (every chapter, and assembly writing),

    Participation 2%, Final Projects 18%.

    Final project format:

    6~8 people form a team

    Perform survey of modern CPU designs (RISC (MIPS, ARM), CISC(Pentium, Centrino), TI OMAP, Intel Xcale, ADI Blackfin) (written reportof 15~20 pages)

    Simple CPU Design (use HDL to do a simple CPU design)

    Grade will be shared by all members

    Copy of reports/programs and fabrication of computer data are consideredas treating in the major exams. It will be processed according to theschool’s law.

  • 臺大電機吳安宇教授- 計算機結構

    Course ObjectiveAn entry-level course to learn basic concepts of

    computer architecture (Central Processing Unit(CPU) and CPU + Memory + I/O)

    The basic concept of RISC (Reduced Instruction SetComputer), compared with CISC (Complex Instruction SetComputer)

    The Assembly/Machine language of the MIPS CPU Detailed CPU design:

    Instruction set Data path Control Unit Arithmetic Logic Unit (ALU) Techniques to enhance CPU performance, e.g., pipelining.

  • 臺大電機吳安宇教授- 計算機結構

    Course Objective (cont’d)

    Memory hierarchy: Cache: How to improve data/instruction access time? Virtual memory: How to handle program/data that is

    larger than your physical (main) memory?

    I/O peripherals: Know more about I/O Devices. How to transfer data directly from I/O devices to

    memory? Learn the technique of Direct Memory Access(DMA).

    What is the relationship among CPU/Memory/I-O?

  • 臺大電機吳安宇教授- 計算機結構

    What are not covered in this class?

    High-level language (HLL) such as C, Pascal, FORTRAN, etc. programmable language course.

    Compiler/Assembler Design: HLL (Compiler) Assembly language Assembly language (Assembler) Machine language (101001)

    for computer execution. Take “System programming/Compiler”if you want to know the

    design of compiler and assembler. CISC: Complex instruction set computer, e.g.,Intel 8086, Pentium

    CPU. Fundamentals and Implementation of RAM/ROM, I/O Devices. “Computer network”and “Computer communication”: We focus on

    stand-alone computer system right now. WWW Home page design Computer graphics, Computer vision, and Games (2-D, 3-D) Virtual Reality.

  • 臺大電機吳安宇教授- 計算機結構

    What can you do after learning this course?

    Design a simple CPU/micro-controller (follow-up course: DigitalSystem Design for Junior and Senior students)

    Read specification book of a CPU, micro-controller, andprogrammable DSP processor, such as 6502, 68030, Intel i860,8086, Pentium (through final project), TI TMS32030, etc.

    Computer motherboard design: How to arrange CPU, MEM, I/Odevices, DMA controller, Peripheral I/O controller.

    Write assembly language for a certain CPU/micro-controller, whichis useful for Writing Firmware for micro-controller, programmable DSP

    processor. Writing Firmware for PC video, I/O, Ethernet cards (most of

    them have -controller/processor to process data). Preparation for advanced courses of “Parallel Processors”and

    “Supercomputer design”.

  • 臺大電機吳安宇教授- 計算機結構

    Chap. 1Computer Abstractions andTechnology

    臺大電機系吳安宇教授2004/09/12

  • 臺大電機吳安宇教授- 計算機結構

    Outline

    1.1 Introduction 1.2 Below Your Program 1.3 Under the cover of your PC 1.4 Real stuff: Manufacturing of

    Pentium 4 Chips

  • 臺大電機吳安宇教授- 計算機結構

    Introduction In the recent past, the following applications were“computer science fiction”:

    Automatic Teller Machines (ATM): In 1950, it costs$500,000 with size of a car

    Computers in Automobiles: Safety, Gas efficiency,Electronics (audio, GPS, Navigation)

    Laptop/notebook computers: Reduction in size Human genome project: Huge computing power Word Wide Web: Internet + Low-cost PC

  • 臺大電機吳安宇教授- 計算機結構

    Different Types of Computers

    Desktop computer A computer designed for use by an individual, usually

    incorporating a graphics display, keyboard, and mouse. Server

    A computer used for running larger programs formultiple users often simultaneously and typicallyaccessed only via a network

    Supercomputer A class of computer with the highest performance and

    cost; they are configured as servers and typically costmillions of dollars

  • 臺大電機吳安宇教授- 計算機結構

    Different Types of Computers (cont’d)

    Embedded computer

    A computer inside another device used for running one pre-determined application, e.g., cellular phone, video games, digitalTVs, set-top boxes, personal digital assistants (PDAs), computerinside automobiles/space shuttles.

    Side Note:

    Kilobyte: 1,024 (210)bytes 10^3 bytes

    Megabyte: Traditionally 1,048,576(220)bytes, although somecommunications and secondary storage systems have redefined it tomean 1,000,000 (106)bytes.

    Gigabyte: 230 bytes 10^9 bytes

    Terabyte:

    Originally 1,099,511,627,776(240)bytes, some applications redefinedit to mean 1,000,000,000,000(1012)bytes.

  • 臺大電機吳安宇教授- 計算機結構

    Introduction

    The number of distinct processors sold between 1998 and 2002

  • 臺大電機吳安宇教授- 計算機結構

    Introduction

    Sales of microprocessors between 1998 and 2002 by instruction setarchitecture combing all users

  • 臺大電機吳安宇教授- 計算機結構

    What you can learn in this book?

    How are programs written in a high-levellanguage, and how does the hardware executethe resulting program?

    What is the interface between the software andthe hardware, and how does software instruct thehardware to perform needed functions?

    What determines the performance of a program,and how can a programmer improve theperformance?

  • 臺大電機吳安宇教授- 計算機結構

    What you can learn in this book?

    What techniques can be used by hardwaredesigners to improve performance?

    Will be impressed as you correctly use wordssuch as BIOS, DIMM, CPU, cache, DRAM, ATA,PCI, and many others

    Side note: Acronym A word constructed by taking the initial letters of string

    of words. For example: RAM is an acronym for RandomAccess Memory, and CPU is an acronym for CentralProcessing Unit

  • 臺大電機吳安宇教授- 計算機結構

    Outline

    1.1 Introduction 1.2 Below Your Program 1.3 Under the Covers 1.4 Real Stuff: Manufacturing Pentium 4

    Chips 1.5 Fallacies and Pitfalls 1.6 Concluding Remarks

  • 臺大電機吳安宇教授- 計算機結構

    Computer programs Systems software

    Software that provides services that are commonlyuseful, including operating systems, compilers, andassemblers.

    Operating system Supervising program that manages the resources of a

    computer for the benefit of the programs that run onthat machine

    Compiler A program that translates high-level language

    statements into assembly language statements

  • 臺大電機吳安宇教授- 計算機結構

    Below your program

    A simplified view of hardware and software as hierarchical layers, shownas concentric circles with hardware in the center and applicationssoftware outermost

  • 臺大電機吳安宇教授- 計算機結構

    System software

    Operating System (Windows, Linux, MacOS) Handle basic input and output operations Allocate storage and memory Provide for sharing the computer among multiple

    applications using it simultaneously.

    Compilers: translate high-level language (C,Java) into instructions that the hardware canexecute

    Assembler: From assembly language to machinelanguage

  • 臺大電機吳安宇教授- 計算機結構

    From high-level language to the language ofhardware

    C program

    compiled into assemblylanguage

    and then assembledinto binary machinelanguage

  • 臺大電機吳安宇教授- 計算機結構

    Outline

    1.1 Introduction 1.2 Below Your Program 1.3 Under the Covers of Your Computer 1.4 Real Stuff: Manufacturing Pentium 4

    Chips

  • 臺大電機吳安宇教授- 計算機結構

    A desktop computer

  • 臺大電機吳安宇教授- 計算機結構

    I/O Devices

    Input device A mechanism through which the computer is

    fed information, such as the keyboard, digitizedpen, mouse, etc.

    Output device A mechanism that conveys the result of a

    computation to a user or another computer,such as LCD display, CRT display, Printer,Plotter, etc.

  • 臺大電機吳安宇教授- 計算機結構

    Through the looking glass

    Cathode ray tube (CRT) display A display, such as a television set, that

    displays an image using an electron beamscanned across a screen

    Flat-panel display, Liquid Crystal Display(LCD) A display technology using a thin layer of

    liquid polymers that can be used to transmitor block light according to whether a chargeis applied

  • 臺大電機吳安宇教授- 計算機結構

    Opening the box

    Inside the Personal Computer (PC)

  • 臺大電機吳安宇教授- 計算機結構

    The organization of a computer

    The organization of a computer, showing the five classic components

  • 臺大電機吳安宇教授- 計算機結構

    Computer components Motherboard

    A plastic board containing packages of integratedcircuits or chips, including processor, cache, memory,and connectors for I/O devices such as networks anddisks

    Integrated Circuit (IC) or chip A device combining dozens to millions of transistors

    Memory The storage area in which programs are kept when

    they are running and that contains the data needed bythe running programs

  • 臺大電機吳安宇教授- 計算機結構

    Computer components Central processor unit (CPU)

    Also called processor. The active part of the computer,which contains the datapath and control and whichadds numbers, tests numbers, signals I/O devices toactivate, and so on.

    Datapath The component of the processor that performs

    arithmetic operations (add, sub, mul, div)

    Control The component of the processor that commands the

    datapath, memory, and I/O devices according to theinstructions of the program

  • 臺大電機吳安宇教授- 計算機結構

    Opening the box

    Inside the processor chip used on the board

  • 臺大電機吳安宇教授- 計算機結構

    Opening the box

    Close-up of PC motherboard

  • 臺大電機吳安宇教授- 計算機結構

    Memory: A place for data

    Memory: Memory built as an integratedcircuit, it provides random access to anylocation Static Random Access Memory (SRAM) Dynamic Random Access Memory (DRAM) Cache memory

    A small, fast memory that acts as a buffer for aslower, larger memory

  • 臺大電機吳安宇教授- 計算機結構

    Memory (I) Memory

    The storage area in which programs are kept whenthey are running and that contains the data needed bythe running programs

    Volatile memory Storage, such as DRAM, that only retains data only if it

    is receiving power Nonvolatile memory

    A form of memory that retains data even in theabsence of a power source and that is used to storeprograms between runs. Magnetic disk is nonvolatileand DRAM is not.

  • 臺大電機吳安宇教授- 計算機結構

    Memory (II) Primary memory

    Also called main memory. Volatile memory used to holdprograms while they are running; typically consists ofDRAM in today,s computers

    Secondary memory Nonvolatile memory used to store programs and data

    between runs; typically consists of magnetic disks intoday,s computers

    Magnetic disk (also called hard disk) A form of nonvolatile secondary memory composed of

    rotating platters coated with a magnetic recordingmaterial

  • 臺大電機吳安宇教授- 計算機結構

    Disk: A safe place for data

    A disk showing 10 disk platters and the read/write heads

  • 臺大電機吳安宇教授- 計算機結構

    Disk: A safe place for data

    Hard drive: most commonly used storage:40Gbytes~60Gbytes/UDS 100.

    Optical disks constitute the most common formof removable storage

    Magnetic tape provides only slow serial accessand has been used to back up disks, in a role nowoften replaced by duplicate hard drivers

    FLASH-based removable memory cards typicallyattach by a USB (Universal Serial Bus) connectionand are often used to transfer files

  • 臺大電機吳安宇教授- 計算機結構

    A safe place for data

    Floppy drivers and Zip drives are a version ofmagnetic disk technology with removable flexibledisks.

    Floppy disks were the original primary storage forpersonal computers, but have now largelyvanished

  • 臺大電機吳安宇教授- 計算機結構

    Communicating with Other Computers

    Networked computers have several majoradvantages Communication: Information is exchanged

    between computers at high speeds Resource sharing: Rather than each machine

    having its own I/O devices, devices can beshared by computers on the network

    Non-local access: By connecting computersover long distances, users need not be nearthe computer they are using

  • 臺大電機吳安宇教授- 計算機結構

    Communicating with other computers

    Local area network (LAN) A network designed to carry data within a

    geographically confined area, typically within a singlebuilding, e.g. 10/100M Ethernet

    Wide area network (WAN) A network extended over hundreds of kilometers which

    can span a continent, e.g, ADSL

  • 臺大電機吳安宇教授- 計算機結構

    outline

    1.1 Introduction 1.2 Below Your Program 1.3 Under the Covers 1.4 Real Stuff: Manufacturing Pentium 4

    Chips

  • 臺大電機吳安宇教授- 計算機結構

    Technologies for building processors andmemories

    Transistor An ON/OFF switch controlled by an electric signal

    Vacuum tube An electronic component, predecessor of the

    transistor, that consists of a hollow glass tube about5 to 10 cm long from which as much air has beenremoved as possible and which uses an electronbeam to transfer data

    Very large scale integrated (VLSI) circuit A device containing hundreds of thousands to millions

    of transistors

  • 臺大電機吳安宇教授- 計算機結構

    Technologies for building processors andmemories

    Relative performance per unit cost of technologies used in computersover time

  • 臺大電機吳安宇教授- 計算機結構

    Technologies for building processors andmemories

    Growth of capacity per DRAM chip over time

  • 臺大電機吳安宇教授- 計算機結構

    The chip manufacturing process

  • 臺大電機吳安宇教授- 計算機結構

    Real stuff

    An 8-inch (200-mm) diameter wafer containing Intel Pentium 4 processors

  • 臺大電機吳安宇教授- 計算機結構

    Real stuff

    An Intel Pentium 4 (3.06 GHz) mounted on top of its heat sink, which isdesigned to remove the 82 watts generated within the die

  • 臺大電機吳安宇教授- 計算機結構

    CPU Performance in WS

    •Performance increase of workstations (WS), 1987-2003

    •Improvement of 1.54 per year, or double performanceapproximately every 18 months (Moore’s law)

  • 臺大電機吳安宇教授- 計算機結構

    Summary

    The basics of computer components and CPU arereviewed

    The next issue is to explore the details of theCPU design: Instruction sets (assembly language, machine

    language) –Chapter 2 Arithmetic for computers: ALU design for

    add/subtract/multiplications/division –Chapter 3 Performance evaluation –Chapter 4 CPU datapath and control units –Chapter 5

  • 臺大電機吳安宇教授- 計算機結構

    Homework #1

    1.1 ~ 1.28 (選擇題) 1.29 ~ 1.45 (選擇題) 1.51 1.52 Due date: 9/29 by the class. No late

    submissions