Introduction

  • Upload
    ford

  • View
    26

  • Download
    0

Embed Size (px)

DESCRIPTION

Introduction. ICS 233 Computer Architecture and Assembly Language Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals. Presentation Outline. Welcome to ICS 233 High-Level, Assembly-, and Machine-Languages - PowerPoint PPT Presentation

Citation preview

  • IntroductionICS 233Computer Architecture and Assembly LanguageProf. Muhamed MudawarCollege of Computer Sciences and EngineeringKing Fahd University of Petroleum and Minerals

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Presentation OutlineWelcome to ICS 233High-Level, Assembly-, and Machine-LanguagesComponents of a Computer SystemChip Manufacturing ProcessTechnology ImprovementsProgrammer's View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Welcome to ICS 233Instructor:Dr. Muhamed F. MudawarOffice:Building 22, Room 328Office Phone:4642Office Hours:SMW 10:00 am 12 noonCourse Web Page:http://www.ccse.kfupm.edu.sa/~mudawar/ics233/Email:[email protected]

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Which Textbooks will be Used?Computer Organization & Design:The Hardware/Software InterfaceThird EditionDavid Patterson and John HennessyMorgan Kaufmann Publishers, 2005MIPS Assembly Language ProgrammingRobert BrittonPearson Prentice Hall, 2004Supplement for LabRead the textbooks in addition to slides

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Grading PolicyLaboratory20%Assignments and Quizzes10%Projects20%Midterm Exam I15%Midterm Exam II15%Final Exam20%

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Software ToolsMIPS SimulatorsMARS: MIPS Assembly and Runtime SimulatorRuns MIPS-32 assembly language programsWebsite: http://courses.missouristate.edu/KenVollmar/MARS/PCSPIMAlso Runs MIPS-32 assembly language programsWebsite: http://www.cs.wisc.edu/~larus/spim.htmlCPU Design and Simulation ToolLogisimEducational tool for designing and simulating CPUsWebsite: http://ozark.hendrix.edu/~burch/logisim/

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Course ObjectivesTowards the end of this course, you should be able to Describe the instruction set architecture of a MIPS processorAnalyze, write, and test MIPS assembly language programsDescribe organization/operation of integer & floating-point unitsDesign the datapath and control of a single-cycle CPUDesign the datapath/control of a pipelined CPU & handle hazardsDescribe the organization/operation of memory and cachesAnalyze the performance of processors and cachesRequired BackgroundAbility to program confidently in Java or CAbility to design a combinational and sequential circuit

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    What is Computer Architecture ?Computer Architecture = Instruction Set Architecture + Computer OrganizationInstruction Set Architecture (ISA)WHAT the computer does (logical view)Computer OrganizationHOW the ISA is implemented (physical view)We will study both in this course

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Next . . .Welcome to ICS 233High-Level, Assembly-, and Machine-LanguagesComponents of a Computer SystemChip Manufacturing ProcessTechnology ImprovementsProgrammer's View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Some Important Questions to AskWhat is Assembly Language?What is Machine Language?How is Assembly related to a high-level language?Why Learn Assembly Language?What is an Assembler, Linker, and Debugger?

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    A Hierarchy of Languages

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Assembly and Machine LanguageMachine languageNative to a processor: executed directly by hardwareInstructions consist of binary code: 1s and 0sAssembly languageSlightly higher-level languageReadability of instructions is better than machine languageOne-to-one correspondence with machine language instructionsAssemblers translate assembly to machine codeCompilers translate high-level programs to machine codeEither directly, orIndirectly via an assembler

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Compiler and Assembler

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Translating LanguagesProgram (C Language):swap(int v[], int k) {int temp;temp = v[k];v[k] = v[k+1];v[k+1] = temp;}A statement in a high-level language is translated typically into several machine-level instructions

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Advantages of High-Level LanguagesProgram development is fasterHigh-level statements: fewer instructions to codeProgram maintenance is easierFor the same above reasonsPrograms are portableContain few machine-dependent detailsCan be used with little or no modifications on different machinesCompiler translates to the target machine languageHowever, Assembly language programs are not portable

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Why Learn Assembly Language?Many reasons:Accessibility to system hardwareSpace and time efficiencyWriting a compiler for a high-level languageAccessibility to system hardwareAssembly Language is useful for implementing system softwareAlso useful for small embedded system applicationsSpace and Time efficiencyUnderstanding sources of program inefficiencyTuning program performanceWriting compact code

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Assembly Language Programming ToolsEditorAllows you to create and edit assembly language source files AssemblerConverts assembly language programs into object filesObject files contain the machine instructionsLinkerCombines object files created by the assembler with link librariesProduces a single executable programDebuggerAllows you to trace the execution of a programAllows you to view machine instructions, memory, and registers

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Assemble and Link ProcessA project may consist of multiple source filesAssembler translates each source file separately into an object fileLinker links all object files together with link libraries

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    MARS Assembler and Simulator Tool

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Next . . .Welcome to ICS 233High-Level, Assembly-, and Machine-LanguagesComponents of a Computer SystemChip Manufacturing ProcessTechnology ImprovementsProgrammer's View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Components of a Computer SystemProcessorDatapathControlMemory & StorageMain MemoryDisk StorageInput devicesOutput devicesBus: Interconnects processor to memory and I/ONetwork: newly added component for communication

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Input Devices

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Output Devices

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Memory DevicesVolatile Memory DevicesRAM = Random Access MemoryDRAM = Dynamic RAM1-Transistor cell + trench capacitorDense but slow, must be refreshedTypical choice for main memorySRAM: Static RAM6-Transistor cell, faster but less dense than DRAMTypical choice for cache memoryNon-Volatile Memory DevicesROM = Read Only MemoryFlash Memory

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Magnetic Disk StorageArm provides read/write heads for all surfacesThe disk heads are connected together and move in conjunctionA Magnetic disk consists of a collection of plattersProvides a number of recording surfaces

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Memory HierarchyRegisters are at the top of the hierarchyTypically few registersFastest memory elementLevel 1 Caches (8 64 KB)I-Cache stores instructionsD-Cache stores dataL2 Cache (512KB 8MB)Bigger but slower than L1Main Memory (1 2 GB)Access time: 50 70 nsDisk Storage (> 200 GB)Much slower than main memory, Access time = 5 ms

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Address, Data, and Control BusAddress Bus Memory address is put on address busIf memory address = a bits then 2a locations are addressedData Bus: bi-directional busData can be transferred in both directions on the data busControl BusSignals controltransfer of dataRead requestWrite requestDone transferMemory01232a 1. . .readwritedonedata busaddress busProcessord bitsa bitsAddress RegisterData RegisterBus Control

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    ProcessorDatapath: part of a processor that executes instructionsControl: generates control signals for each instructionInstructionProgram CounterInstructionCacheNext ProgramCounterDataCache

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Datapath ComponentsProgram Counter (PC)Contains address of instruction to be fetchedNext Program Counter: computes address of next instructionInstruction and Data CachesSmall and fast memory containing most recent instructions/dataRegister FileGeneral-purpose registers used for intermediate computationsALU = Arithmetic and Logic UnitExecutes arithmetic and logic instructionsBusesUsed to wire and interconnect the various components

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Fetch - Execute CycleFetch instructionCompute address of next instructionGenerate control signals for instructionRead operands from registersCompute result valueWriteback result in a registerInstruction DecodeInstruction FetchExecuteWriteback ResultInfinite Cycle implemented in HardwareMemory AccessRead or write memory (load/store)

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Next . . .Welcome to ICS 233Assembly-, Machine-, and High-Level LanguagesComponents of a Computer SystemChip Manufacturing ProcessTechnology ImprovementsProgrammer's View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Chip Manufacturing Process

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Wafer of Pentium 4 Processors8 inches (20 cm) in diameterDie area is 250 mm2About 16 mm per side55 million transistors per die0.18 m technologySize of smallest transistorImproved technology uses0.13 m and 0.09 mDies per wafer = 169When yield = 100%Number is reduced after testingRounded dies at boundary are useless

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Effect of Die Size on YieldDramatic decrease in yield with larger diesYield = (Number of Good Dies) / (Total Number of Dies)Die Cost = (Wafer Cost) / (Dies per Wafer Yield)

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Inside the Pentium 4 Processor Chip

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Next . . .Welcome to ICS 233Assembly-, Machine-, and High-Level LanguagesComponents of a Computer SystemChip Manufacturing ProcessTechnology ImprovementsProgrammer's View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Technology ImprovementsVacuum tube transistor IC VLSIProcessorTransistor count:about 30% to 40% per yearMemoryDRAM capacity:about 60% per year (4x every 3 yrs)Cost per bit:decreases about 25% per yearDiskCapacity:about 60% per yearOpportunities for new applicationsBetter organizations and designs

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Growth of Capacity per DRAM ChipDRAM capacity quadrupled almost every 3 years60% increase per year, for 20 years

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Workstation PerformanceMore than 1000 times improvement between 1987 and 2003Improvement is between 50% and 60% per year

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Microprocessor Sales (1998 2002)ARM processor sales exceeded Intel IA-32 processors, which came secondARM processors are used mostly in cellular phonesMost processors today are embedded in cell phones, video games, digital TVs, PDAs, and a variety of consumer devices

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Microprocessor Sales cont'd

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Next . . .Welcome to ICS 233Assembly-, Machine-, and High-Level LanguagesComponents of a Computer SystemChip Manufacturing ProcessTechnology ImprovementsProgrammer's View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Programmers View of a Computer System

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Programmer's View 2Application Programs (Level 5)Written in high-level programming languagesSuch as Java, C++, Pascal, Visual Basic . . .Programs compile into assembly language level (Level 4) Assembly Language (Level 4)Instruction mnemonics are usedHave one-to-one correspondence to machine languageCalls functions written at the operating system level (Level 3)Programs are translated into machine language (Level 2)Operating System (Level 3)Provides services to level 4 and 5 programsTranslated to run at the machine instruction level (Level 2)

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Programmer's View 3Instruction Set Architecture (Level 2)Interface between software and hardwareSpecifies how a processor functionsMachine instructions, registers, and memory are exposedMachine language is executed by Level 1 (microarchitecture)Microarchitecture (Level 1)Controls the execution of machine instructions (Level 2)Implemented by digital logicPhysical Design (Level 0)Implements the microarchitecturePhysical layout of circuits on a chip

    IntroductionICS 233 Computer Architecture and Assembly Language KFUPM Muhamed Mudawar slide *

    Course RoadmapInstruction set architecture (Chapter 2)MIPS Assembly Language Programming (Chapter 2)Computer arithmetic (Chapter 3)Performance issues (Chapter 4)Constructing a processor (Chapter 5)Pipelining to improve performance (Chapter 6)Memory and caches (Chapter 7)Disk Storage (Chapter 8)Key to obtain a good grade: read the textbook!