Lecture3.pdf - Chapter 2 Instructions Language of the...

This preview shows page 1 - 12 out of 42 pages.

Chapter 2Instructions: Language of the Computer(R-Format Instructions, Adding constant dataand flow control)
R-FORMAT INSTRUCTIONSChapter 2 Instructions: Language of the Computer 2
Chapter 2 Instructions: Language of the Computer 3Instruction SetThe repertoire of instructions of a computerDifferent computers have different instruction setsBut with many aspects in commonEarly computers had very simple instruction setsSimplified implementationMany modern computers also have simple instruction sets
Chapter 2 Instructions: Language of the Computer 4Instruction Set ArchitectureInstruction Set Architecture:abstraction that hides the low-level details of a processor from the userthe interface between the hardware and softwareeverything you need to know to “use” the processor
Chapter 2 Instructions: Language of the Computer 5Instruction Set Architecture“Families” of processors are defined by their ISA:Intel IA-32MIPSIBM 360Motorola/IBM PowerPCSunSparc
Chapter 2 Instructions: Language of the Computer 6RISC vs. CISCDesign “philosophies” for ISAs: RISC vs CISCCISC = Complex Instruction Set ComputerRISC = Reduced Instruction Set ComputerTradeoff:Execution time = (Instructions/program)*(cycles/instruction)*(seconds/cycle)
Chapter 2 Instructions: Language of the Computer 7RISCRISCSmall Instruction SetEasier for compilersLimit each instruction to (at most):Three register accesses,One memory access,One ALU operationFacilitates instruction level parallelism*Load-Store Architecture: minimize off-chip memory accesses
Chapter 2 Instructions: Language of the Computer 8The MIPS Instruction SetUsed as the example throughout our textbookStanford MIPS commercialized by MIPS technologiesAccounts for a large share of embedded core market:Applications in consumer electronics, network/store equipment, cameras, printers, …
Chapter 2 Instructions: Language of the Computer 9MIPS ISAThere are 3 MIPS assembly instruction formatsR-Format Instructions:add, sub, and, or, nor, sltI-Format Instructions:addi*, beq, lw, swJ-Format Instructions:j, jal
Chapter 2 Instructions: Language of the Computer 10R-format: Register formatRegister:Memory element for data being actively processedOur MIPS processor has 32 registersregisters can be addressed by number as $0, $1, ... $30, $31Each register is 32-bits wide$0 contains 0x00000000 and is read only (cannot be overwritten)Registers have other symbolic designators
Chapter 2 Instructions: Language of the Computer 11Register OperandsArithmetic and logic instructions use register operandsMIPS has a 32x32-bit register fileUse for frequently accessed data32-bit data called a ‘word’Assembler names for registers$t0, $t1, …, $t9 for temporary values$s0, $s1, …, $s7 for saved variables

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture