tuesday 24 november 2015
play

Tuesday, 24 November 2015 Schedule for rest of semester: Today: - PowerPoint PPT Presentation

Tuesday, 24 November 2015 Schedule for rest of semester: Today: quick look at Chapter 4--the datapath Monday, Nov 30: lab time for project work Tuesday, Dec 1: review sheets for exam Thursday, Dec 3: review; project reports


  1. Tuesday, 24 November 2015 Schedule for rest of semester: ■ Today: quick look at Chapter 4--the datapath ■ Monday, Nov 30: lab time for project work ■ Tuesday, Dec 1: review sheets for exam ■ Thursday, Dec 3: review; project reports ■ Monday, Dec 7: COOKIES!, project reports

  2. Executing a MIPS Program Recall : programs consist of a set of instructions. In MIPS, each instruction is a 32- bit word. Instructions are stored in an area of memory separate from the data area. A special register called the “program counter” or PC contains the address of the next instruction.

  3. Executing a MIPS Program All calculations take place in the ALU, or Arithmetic Logic Unit. These calculations use the registers. All of the logic needed to perform addition, subtraction, “or”, “and”, comparisons, etc. is contained in the ALU. Data stored in memory must be transferred back and forth between the registers and memory in order to perform calculations with it.

  4. Steps to Execute a MIPS Instruction ■ Fetch an instruction from memory address stored in the PC and add 4 to the PC (advance to next instruction) ■ Decode the instruction ■ Execute the instruction: ■ If it’s a load, fetch operand from memory to register ■ If it’s a store, store result from register to memory ■ Everything else: carry out the instruction in registers

  5. Decoding Instructions Recall instruction formats (chapter 2). We only looked at R-format (for register operations); there are two others (I-format for immediate instructions; J-format for jump instructions). To decode an instruction we look at the leftmost 6 bits (the op code). E.g., “000000” indicates an R-format instruction (to determine which one, we look at the rightmost 6 bits).

  6. First Approximation to Datapath Most of these lines actually represent 32 one-bit values

  7. First Approximation to Datapath Here is where we “add 4” to the program counter, advancing to the next instruction.

  8. First Approximation to Datapath In the case of a jump instruction, we must alter the PC by adding an “offset” (which is contained in the jump instruction)

  9. First Approximation to Datapath A “load” instruction requires several steps: first, calculate the memory address

  10. First Approximation to Datapath Then transfer data from memory to a register

  11. What Is “Calculate an Address”? In a MIPS instruction there is not enough room to hold an entire address; instead, the instruction contains an OFFSET that must be added to the base address of the data memory in order to compute the actual address.

  12. First Approximation to Datapath A “store” instruction also requires several steps: first, calculate the memory address

  13. First Approximation to Datapath Then transfer data from a register to memory

  14. First Approximation to Datapath An “la” instruction (“load address”) first calculates the memory address

  15. First Approximation to Datapath And then loads that address to a register. No memory access is needed.

  16. A More Detailed Look ■ Can’t just join wires together ■ Use multiplexers

  17. A More Detailed Look

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend