Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Architecture Lecture 10 MIPS Control Unit Ralph Grishman Oct. 2015 NYU.

Similar presentations


Presentation on theme: "Computer Architecture Lecture 10 MIPS Control Unit Ralph Grishman Oct. 2015 NYU."— Presentation transcript:

1 Computer Architecture Lecture 10 MIPS Control Unit Ralph Grishman Oct. 2015 NYU

2 Full core MIPS data path 9/30/15Computer Architecture lecture 82

3 Control Logic What’s left: setting the proper control lines for each instruction 9/30/15Computer Architecture lecture 83 instructionControl signals

4 4 Copyright © 2014 Elsevier Inc. All rights reserved. FIGURE 4.14 The three instruction classes (R-type, load and store, and branch) use two different instruction formats. The jump instructions use another format, which we will discuss shortly. (a) Instruction format for R- format instructions, which all have an opcode of 0. These instructions have three register operands: rs, rt, and rd. Fields rs and rt are sources, and rd is the destination. The ALU function is in the funct field and is decoded by the ALU control design in the previous section. The R-type instructions that we implement are add, sub, AND, OR, and slt. The shamt field is used only for shifts; we will ignore it in this chapter. (b) Instruction format for load (opcode = 35 ten ) and store (opcode = 43 ten ) instructions. The register rs is the base register that is added to the 16-bit address field to form the memory address. For loads, rt is the destination register for the loaded value. For stores, rt is the source register whose value should be stored into memory. (c) Instruction format for branch equal (opcode =4). The registers rs and rt are the source registers that are compared for equality. The 16-bit address field is sign-extended, shifted, and added to the PC + 4 to compute the branch target address. Instruction Formats

5 Control Logic In general, operation depends on both opcode and funct Requires a large combinatorial circuit We will do this in two steps ALU function for each instruction other control lines for each instruction 9/30/15Computer Architecture lecture 85

6 Two control units Divide into two control units: one for ALU, one for other control lines 9/30/15Computer Architecture lecture 86 Main control unit ALU control opcode funct ALU Other Contrpl lines

7 ALU Control Inputs ALU functionA invertBinvertOperation and0000 or0001 add0010 subtract0110 set less than0111 nor1100 9/30/15Computer Architecture lecture 87

8 ALU functions required InstructionALU function load wordadd store wordadd and or add subtract set less than branch on equalsubtract 9/30/15Computer Architecture lecture 88

9 Control lines Instru ction Reg Dst ALU src Mem toReg Reg Write Mem Read Mem Write Branc h ALU Op1 ALU Op0 R- format 100100010 lw011110000 swX1X001000 beqX0X000101 9/30/15Computer Architecture lecture 89

10 Single-cycle control Everything happens in one clock cycle: Fetch instruction Fetch registers Do ALU operation Load from memory + store into register or Store into memory or Store into register Very slow Must allow for slowest instruction Most instructions involve an add or subtract 9/30/15Computer Architecture lecture 810

11 Faster adder? Ripple-carry adder is very slow (64 gate delays for 32 bits) … can we make a faster adder? Approach: incorporate more parallelism into adder 9/30/15Computer Architecture lecture 811

12 Carries Analyze each bit position in terms of its effect on carries: 1 + 1: generates a carry there is always a carry out of this bit position 1 + 0: propagates a carry there is a carry out of this bit position only if there is a carry in 0 + 0: does neither there is never a carry out of this bit position 9/30/15Computer Architecture lecture 812

13 Groups We can classify 4-bit groups in the same way: for example: 0 0 0 1 + 1 1 1 1 is a generate group: a carry always comes out (from the high bit) while 0 0 0 0 +1 1 1 1 is a propagate group: a carry comes out (from the high bit) only if a carry came in (to the low bit) [see lecture notes for formulas and analysis] 9/30/15Computer Architecture lecture 813

14 Carry Look-Ahead What is the benefit of using P and G? – they can be computed in parallel for all bits and groups  much faster addition 9/30/15Computer Architecture lecture 814

15 9/30/15Computer Architecture lecture 815 16-bit CLA Adder


Download ppt "Computer Architecture Lecture 10 MIPS Control Unit Ralph Grishman Oct. 2015 NYU."

Similar presentations


Ads by Google