Major CPU Design Steps

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Major CPU Design Steps"

Transcription

1 Datapath Major CPU Design Steps. Analyze instruction set operations using independent RTN ISA => RTN => datapath requirements. This provides the the required datapath components and how they are connected to meet ISA requirements.. Select required datapath components, connections & establish clock methodology (e.g clock edge-triggered). + Determine number of cycles per instruction and operations in each cycle. 3. Assemble datapath meeting the requirements. Control 4. Identify and define the function of all control points or signals needed by the datapath. Analyze implementation of each instruction to determine setting of control points that affects its operations and register transfer. 5. Design & assemble the control logic. Hard-Wired: Finite-state machine implementation. Microprogrammed. i.e using a control program 3 rd Edition Chapter 5.5 See Handout Not in 4 th Edition # Lec # 5 Winter

2 Single Cycle MIPS Datapath: CPI =, Long Clock Cycle Branch Zero imm6 4 PC Ext PC+4 Adder Adder PCSrc 0 Mux Branch Target Jump Not Included Clk Inst Memory 00 PC Adr RegDst RegWr busw Clk Rs imm6 <:5> Rd 0 Rt 5 5 Rs 5 Rw Ra Rb -bit Registers 6 (Includes ORI not in book version) Rt <6:0> Rd <:5> Rt busa busb Extender ExtOp <0:5> Imm6 R[rt] Zero R[rs] 0 Mux ALUSrc Instruction<3:0> Function Field ALUop (-bits) ALU Control = ALU Main ALU MemWr WrEn Adr Data In Data Memory Clk T = I x CPI x C MemtoReg # Lec # 5 Winter Mux

3 Single Cycle MIPS Datapath Extended To Handle Jump with Control Unit Added 4 Add Instruction [5 0] Shift left Jump address [3 0] 6 8 PC +4 PC + 4 [3 8] 4 PC +4 Add ALU result PC +4 Branch Target 0 M u x 0 M u x Opcode Instruction [3 6] Control RegDst Jump Branch MemRead MemtoReg ALUOp MemWrite ALUSrc RegWrite Shift left Book figure may have an error! PC Read address Instruction [3 0] Instruction memory Figure 5.4 page 34 Instruction [5 ] Instruction [0 6] Instruction [5 ] Instruction [5 0] imm6 rd rs rt 0 M u x Read register Read register Write register Write data Read data Read data Registers 6 Sign extend Function Field Instruction [5 0] R[rs] R[rt] 0 M u x ALU control ALU Zero ALU result R[rt] Address Write data ALUOp (-bits) 00 = add 0 = subtract 0 = R-Type Data memory Read data M u x 0 In this book version, ORI is not supported no zero extend of immediate needed. #3 Lec # 5 Winter

4 Drawbacks of Single-Cycle Processor. Long cycle time: CPI = All instructions must take as much time as the slowest: Cycle time for load is longer than needed for all other instructions. Real memory is not as well-behaved as idealized memory Cannot always complete data access in one (short) cycle.. Impossible to implement complex, variable-length instructions and complex addressing modes in a single cycle. e.g indirect memory addressing. 3. High and duplicate hardware resource requirements Any hardware functional unit cannot be used more than once in a single cycle (e.g. ALUs). 4. Cannot pipeline (overlap) the processing of one instruction with the previous instructions. (instruction pipelining, chapter 6). #4 Lec # 5 Winter

5 Abstract View of Single Cycle CPU op Main Control fun ALU control Branch, Jump Equal ExtOp ALUSrc ALUctr MemRd MemWr ns RegDst RegWr MemWr Next PC PC Instruction Fetch ns Register Fetch ns Ext ns ALU Mem Access ns Reg. Wrt Data Mem Result Store One CPU Clock Cycle Duration C = 8ns One instruction per cycle CPI = Assuming the following datapath/control hardware components delays: Memory Units: ns ALU and adders: ns Register File: ns Control Unit < ns #5 Lec # 5 Winter

6 Single Cycle Instruction Timing Arithmetic & Logical PC Inst Memory Reg File mux ALU mux setup Load PC Inst Memory Reg File mux ALU Data Mem muxsetup Critical Path Store (Determines CPU clock cycle, C) PC Inst Memory Reg File mux ALU Data Mem Branch PC Inst Memory Reg File cmp mux Critical Path: Load (e.g 8 ns) #6 Lec # 5 Winter

7 Clock Cycle Time & Critical Path Clk One CPU Clock Cycle Duration C = 8ns here i.e longest delay Critical Path LW in this case Critical path: the slowest path between any two storage devices Clock Cycle time is a function of the critical path, and must be greater than: Clock-to-Q + Longest Delay Path through the Combination Logic + Setup + Clock Skew Assuming the following datapath/control hardware components delays: Memory Units: ns ALU and adders: ns Register File: ns Control Unit < ns #7 Lec # 5 Winter

8 Reducing Cycle Time: Multi-Cycle Design Cut combinational dependency graph by inserting registers / latches. The same work is done in two or more shorter cycles, rather than one long cycle. storage element storage element One long cycle e.g CPI = Acyclic Combinational Logic Two shorter cycles => Cycle Acyclic Combinational Logic (A) storage element e.g CPI = Storage Element: Register or memory storage element Cycle Acyclic Combinational Logic (B) Place registers to: Get a balanced clock cycle length Save any results needed for the remaining cycles storage element #8 Lec # 5 Winter

9 Basic MIPS Instruction Processing Steps Instruction Memory Instruction Fetch Next Instruction Instruction Decode Obtain instruction from program storage Instruction Mem[PC] Update program counter to address of next instruction Determine instruction type Obtain operands from registers Common steps for all instructions Execute Result Store Compute result value or status Store result in register/memory if needed (usually called Write Back). Done by Control Unit #9 Lec # 5 Winter

10 Partitioning The Single Cycle Datapath Add registers between steps to break into cycles Branch, Jump ns To Control Unit ns ExtOp ns ns ns ALUSrc ALUctr MemRd MemWr RegDst RegWr MemWr Next PC PC Instruction Fetch Cycle (IF) Instruction Fetch Operand Fetch Instruction Decode Cycle (ID) Exec Execution Cycle (EX) Mem Access Data Memory Access Cycle (MEM) Place registers to: Get a balanced clock cycle length Save any results needed for the remaining cycles Reg. File Data Mem Result Store Write back Cycle (WB) #0 Lec # 5 Winter

11 Branch, Jump Next PC PC Example Multi-cycle Datapath Instruction Fetch To Control Unit IR Reg File A B ExtOp ALUSrc ALUctr Ext ALU R MemRd MemWr Mem Access Instruction Instruction Fetch Decode Execution (IF) (ID) (EX) Memory ns ns ns (MEM) 3 4 ns 5 M Data Mem MemToReg RegDst RegWr Reg. File Registers added: All clock-edge triggered (not shown register write enable control lines) IR: Instruction register A, B: Two registers to hold operands read from register file. R: or ALUOut, holds the output of the main ALU M: or Memory data register (MDR) to hold data read from data memory CPU Clock Cycle Time: Worst cycle delay = C = ns (ignoring MUX, CLK-Q delays) Assuming the following datapath/control hardware components delays: Memory Units: ns ALU and adders: ns Register File: ns Control Unit < ns Thus Clock Rate: f = / ns = 500 MHz Equal Write Back (WB) ns # Lec # 5 Winter

12 Operations (Dependant RTN) for Each Cycle R-Type Logic Immediate Load Store Branch IF Instruction Fetch IR Mem[PC] IR Mem[PC] IR Mem[PC] IR Mem[PC] IR Mem[PC] ID Instruction Decode A B R[rs] R[rt] A B R[rs] R[rt A B R[rs] R[rt A B R[rs] R[rt] A B R[rs] R[rt] Zero A - B If Zero = : EX Execution R A funct B R A OR ZeroExt[imm6] R A + SignEx(Im6) R A + SignEx(Im6) + (SignExt(imm6) x4) else (i.e Zero =0): MEM Memory M Mem[R] Mem[R] B WB Write Back R[rd] R R[rt] R R[rt] M Instruction Fetch (IF) & Instruction Decode cycles are common for all instructions # Lec # 5 Winter

13 MIPS Multi-Cycle Datapath: Five Cycles of Load CPI = 5 Cycle Cycle Cycle 3 Cycle 4 Cycle 5 Load IF ID EX MEM WB - Instruction Fetch (IF): Fetch the instruction from instruction Memory. - Instruction Decode (ID): Operand Register Fetch and Instruction Decode. 3- Execute (EX): Calculate the effective memory address. 4- Memory (MEM): Read the data from the Data Memory. 5- Write Back (WB): Write the loaded data to the register file. Update PC. #3 Lec # 5 Winter

14 Multi-cycle Datapath Instruction CPI R-Type/Immediate: Require four cycles, CPI = 4 IF, ID, EX, WB Loads: Require five cycles, CPI = 5 IF, ID, EX, MEM, WB Stores: Require four cycles, CPI = 4 IF, ID, EX, MEM Branches/Jumps: Require three cycles, CPI = 3 IF, ID, EX Average or effective program CPI: 3 CPI 5 depending on program profile (instruction mix). #4 Lec # 5 Winter

15 Clk Single Cycle Vs. Multi-Cycle CPU 8ns (5 MHz) Cycle Cycle Single Cycle Implementation: 8 ns Load Store Waste ns (500 MHz) Cycle Cycle Cycle 3 Cycle 4 Cycle 5 Cycle 6 Cycle 7 Cycle 8 Cycle 9 Cycle 0 Clk Multiple Cycle Implementation: Load IF ID EX MEM WB Store IF ID EX MEM R-type IF T = I x CPI x C Single-Cycle CPU: CPI = C = 8ns f = 5 MHz One million instructions take = I x CPI x C = 0 6 x x 8x0-9 = 8 msec Assuming the following datapath/control hardware components delays: Memory Units: ns ALU and adders: ns Register File: ns Control Unit < ns Multi-Cycle CPU: CPI = 3 to 5 C = ns One million instructions take from 0 6 x 3 x x0-9 = 6 msec to 0 6 x 5 x x0-9 = 0 msec depending on instruction mix used. f = 500 MHz #5 Lec # 5 Winter

16 Control Unit Design: Finite State Machine (FSM) Control Model State specifies control points (outputs) for Register Transfer. Control points (outputs) are assumed to depend only on the current state and not inputs (i.e. Moore finite state machine) Transfer (register/memory writes) and state transition occur upon exiting the state on the falling edge of the clock. inputs (opcode, conditions) Last State Next State Logic Control State State X Register Transfer Control Points Current State e.g Flip-Flops Output Logic outputs (control points) To datapath Moore Finite State Machine State Transition Depends on Inputs Next State #6 Lec # 5 Winter

17 Control Specification For Multi-cycle CPU Finite State Machine (FSM) - State Transition Diagram IR MEM[PC] A R[rs] B R[rt] instruction fetch (Start state) decode / operand fetch Execute R-type R A fun B ORi R A or ZX LW R A + SX SW R A + SX BEQ & ~Zero BEQ & Zero PC PC + 4+ SX 00 Memory M MEM[R] MEM[R] B To instruction fetch R[rd] R R[rt] R R[rt] M 3 states: 4 State Flip-Flops needed Write-back To instruction fetch To instruction fetch #7 Lec # 5 Winter

18 Traditional FSM Controller state op cond next state control points Outputs Next State Logic Output Logic Inputs State Transition Table Equal 6 Opcode next State control points Current State 4 State Outputs (Control points) datapath State op State register (4 Flip-Flops) To datapath #8 Lec # 5 Winter

19 Traditional FSM Controller datapath + state diagram => control Translate RTN statements into control points. Assign states. Implement the controller. More on FSM controller implementation in Appendix C #9 Lec # 5 Winter

20 Mapping RTNs To Control Points Examples & State Assignments IR MEM[PC] 0000 imem_rd, IRen 0 instruction fetch ALUfun, Sen Aen, Ben A R[rs] B R[rt] 000 decode / operand fetch Execute Memory 4 R-type R A fun B 000 R[rd] R 00 RegDst, RegWr, PCen ORi R A or ZX 00 R[rt] R LW R A + SX 000 M MEM[R] 00 R[rt] M 00 SW R A + SX 0 MEM[R] B 00 BEQ & ~Zero 00 3 BEQ & Zero PC PC + 4+SX To instruction fetch state states: 4 State Flip-Flops needed Write-back To instruction fetch state 0000 To instruction fetch state 0000 #0 Lec # 5 Winter

21 IF ID BEQ R ORI LW SW Detailed Control Specification - State Transition Table Current Op field Z Next IR PC Ops Exec Mem Write-Back State en sel A B Ex Sr ALU S R W M M-R Wr Dst 0000??????? BEQ BEQ R-type x ori x LW x SW x xxxxxx x xxxxxx x xxxxxx x 00 0 fun Can be combined in one state 00 xxxxxx x xxxxxx x or 0 xxxxxx x xxxxxx x 00 0 add 00 xxxxxx x xxxxxx x xxxxxx x 00 0 add 00 xxxxxx x More on FSM controller implementation in Appendix C # Lec # 5 Winter

22 Alternative Multiple Cycle Datapath (In Textbook) Minimizes Hardware: memory, ALU PCWr PC IorD 0 Mux PCWrCond Zero MemWr Address Ideal Memory Din Dout MemRd IRWr Instruction Reg Mem Data Reg RegDst Rs Rt Rt Rd Mux Mux 0 RegWr Ra Rb busa Reg File Rw buswbusb A B ALUSrcA PC 4 PCSrc 0 Mux 0 3 Mux 0 Zero ALU ALU Control ALU Out Imm 6 Extend << MemtoReg ALUSrcB ALUOp # Lec # 5 Winter

23 Alternative Multiple Cycle Datapath (In Textbook) IorD MemRead MemWrite IRWrite RegDst RegWrite ALUSrcA PC 0 M u x Address Write data Memory MemData Instruction [5 ] Instruction [0 6] Instruction [5 0] Instruction register Instruction [5 0] Memory data register rs rt 0 M Instruction u [5 ] x rd 0 M u x 6 imm6 Read register Read register Registers Write register Write data Sign extend Read data Read data Shift left A B 4 0 M u x 0 M u x 3 ALU control ALU Zero ALU result ALUOut i.e MDR Instruction [5 0] MemtoReg ALUSrcB ALUOp Shared instruction/data memory unit A single ALU shared among instructions Shared units require additional or widened multiplexors Temporary registers to hold data between clock cycles of the instruction: Additional registers: Instruction Register (IR), Memory Data Register (MDR), A, B, ALUOut (Figure 5.7 page ) #3 Lec # 5 Winter

24 Alternative Multiple Cycle Datapath With Control Lines (Fig 5.8 In Textbook) PC PC+ 4 rt rs Branch Target rd imm6 (ORI not supported, Jump supported) (Figure 5.8 page 3) #4 Lec # 5 Winter

25 Signal Name RegDst RegWrite ALUSrcA MemRead MemWrite MemtoReg IorD IRWrite The Effect of The -bit Control Signals Effect when deasserted (=0) The register destination number for the write register comes from the rt field (instruction bits 0:6). None The first ALU operand is the PC None None The value fed to the register write data input comes from ALUOut register. The PC is used to supply the address to the memory unit. None Effect when asserted (=) The register destination number for the write register comes from the rd field (instruction bits 5:). The register on the write register input is written with the value on the Write data input. The First ALU operand is register A (i.e R[rs]) Content of memory specified by the address input are put on the memory data output. Memory contents specified by the address input is replaced by the value on the Write data input. The value fed to the register write data input comes from data memory register (MDR). The ALUOut register is used to supply the the address to the memory unit. The output of the memory is written into Instruction Register (IR) PCWrite PCWriteCond None None The PC is written; the source is controlled by PCSource The PC is written if the Zero output of the ALU is also active. (Figure 5.9 page 4) #5 Lec # 5 Winter

26 Signal Name The Effect of The -bit Control Signals Value (Binary) Effect ALUOp The ALU performs an add operation The ALU performs a subtract operation The funct field of the instruction determines the ALU operation (R-Type) The second input of the ALU comes from register B (i.e R[rs]) ALUSrcB PCSource 0 0 (Figure 5.9 page 4) The second input of the ALU is the constant 4 The second input of the ALU is the sign-extended 6-bit immediate (imm6) field of the instruction in IR The second input of the ALU is is the sign-extended 6-bit immediate field of IR shifted left bits (for branches) Output of the ALU (PC+4) is sent to the PC for writing The content of ALUOut (the branch target address) is sent to the PC for writing The jump target address (IR[5:0] shifted left bits and concatenated with PC+4[3:8] is sent to the PC for writing i.e jump address #6 Lec # 5 Winter

27 Operations (Dependant RTN) for Each Cycle R-Type Load Store Branch Jump IF Instruction Fetch IR Mem[PC] IR Mem[PC] IR Mem[PC] IR Mem[PC] IR Mem[PC] ID Instruction Decode A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) EX Execution ALUout A funct B ALUout A + SignEx(Imm6) ALUout A + SignEx(Imm6) Zero A - B Zero: PC ALUout PC Jump Address MEM Memory MDR Mem[ALUout] Mem[ALUout] B WB Write Back R[rd] ALUout R[rt] MDR Instruction Fetch (IF) & Instruction Decode (ID) cycles are common for all instructions #7 Lec # 5 Winter

28 High-Level View of Finite State Machine Control (Figure 5.) (Figure 5.33) (Figure 5.34) (Figure 5.35) (Figure 5.36) First steps are independent of the instruction class Then a series of sequences that depend on the instruction opcode Then the control returns to fetch a new instruction. Each box above represents one or several state. (Figure 5.3 page 3) #8 Lec # 5 Winter

29 FSM State Transition Diagram (From Book) IF ID (Figure 5.38 page 339) IR Mem[PC] A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) ALUout A + SignEx(Imm6) EX PC Jump Address ALUout A func B MDR Mem[ALUout] Zero A -B Zero: PC ALUout MEM WB R[rd] ALUout R[rt] WB MDR Mem[ALUout] B Total 0 states More on FSM controller implementation in Appendix C #9 Lec # 5 Winter

30 Instruction Fetch (IF) and Decode (ID) IR Mem[PC] FSM States IF A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) ID (Figure 5.33) (Figure 5.34) (Figure 5.35) (Figure 5.36) (Figure 5. page 333) #30 Lec # 5 Winter

31 Instruction Fetch (IF) Cycle (State 0) IR Mem[PC] MemRead = ALUSrcA = 0 IorD = 0 IRWrite = ALUSrcB = 0 ALUOp = 00 (add) PCWrite = PCSource = PC 0 0 PC+ 4 rt rs Branch Target rd imm6 00 Add (ORI not supported, Jump supported) (Figure 5.8 page 3) #3 Lec # 5 Winter

32 Instruction Decode (ID) Cycle (State ) A R[rs] B R[rt] ALUSrcA = 0 ALUSrcB = ALUOp = 00 (add) ALUout PC + (SignExt(imm6) x4) (Calculate branch target) PC 0 PC+ 4 rt rs Branch Target rd imm6 00 Add (ORI not supported, Jump supported) (Figure 5.8 page 3) # Lec # 5 Winter

33 Load/Store Instructions FSM States (From Instruction Decode) EX ALUout A + SignEx(Imm6) i.e Effective address calculation MDR Mem[ALUout] MEM Mem[ALUout] B R[rt] MDR WB (Figure 5.33 page 334) To Instruction Fetch (Figure 5.) #33 Lec # 5 Winter

34 Load/Store Execution (EX) Cycle (State ) Effective address calculation ALUout A + SignEx(Imm6) ALUSrcA = ALUSrcB = 0 ALUOp = 00 (add) PC 0 PC+ 4 rt rs Branch Target rd imm6 00 Add (ORI not supported, Jump supported) (Figure 5.8 page 3) #34 Lec # 5 Winter

35 Load Memory (MEM) Cycle (State 3) MDR Mem[ALUout] MemRead = IorD = PC PC+ 4 rt rs Branch Target rd imm6 (ORI not supported, Jump supported) (Figure 5.8 page 3) #35 Lec # 5 Winter

36 Load Write Back (WB) Cycle (State 4) R[rt] MDR RegWrite = MemtoReg = RegDst = 0 PC PC+ 4 rt rs 0 Branch Target rd imm6 (ORI not supported, Jump supported) (Figure 5.8 page 3) #36 Lec # 5 Winter

37 Store Memory (MEM) Cycle (State 5) Mem[ALUout] B MemWrite = IorD = PC PC+ 4 rt rs Branch Target rd imm6 (ORI not supported, Jump supported) (Figure 5.8 page 3) #37 Lec # 5 Winter

38 (From Instruction Decode) R-Type Instructions FSM States EX ALUout A funct B WB R[rd] ALUout (Figure 5.34 page 335) To State 0 (Instruction Fetch) (Figure 5.) #38 Lec # 5 Winter

39 R-Type Execution (EX) Cycle (State 6) ALUout A funct B ALUSrcA = ALUSrcB = 00 ALUOp = 0 (R-Type) PC 00 PC+ 4 rt rs Branch Target rd imm6 0 R-Type (ORI not supported, Jump supported) (Figure 5.8 page 3) #39 Lec # 5 Winter

40 R-Type Write Back (WB) Cycle (State 7) R[rd] ALUout RegWrite = MemtoReg = 0 RegDst = PC PC+ 4 rt rs Branch Target rd 0 imm6 (ORI not supported, Jump supported) (Figure 5.8 page 3) #40 Lec # 5 Winter

41 Branch Instruction Single EX State Jump Instruction Single EX State (From Instruction Decode) (From Instruction Decode) EX Zero A - B Zero : PC ALUout EX PC Jump Address To State 0 (Instruction Fetch) (Figure 5.) To State 0 (Instruction Fetch) (Figure 5.) (Figures 5.35, 5.36 page 337) #4 Lec # 5 Winter

42 Zero A - B Zero : PC Branch Execution (EX) Cycle (State 8) ALUout ALUSrcA = ALUSrcB = 00 ALUOp = 0 (Subtract) PCWriteCond = PCSource = 0 0 PC 00 PC+ 4 rt rs Branch Target rd imm6 0 Subtract (ORI not supported, Jump supported) (Figure 5.8 page 3) #4 Lec # 5 Winter

43 Jump Execution (EX) Cycle (State 9) PC Jump Address PCWrite = PCSource = 0 0 PC PC+ 4 rt rs Branch Target rd imm6 (ORI not supported, Jump supported) (Figure 5.8 page 3) #43 Lec # 5 Winter

44 MIPS Multi-cycle Datapath Performance Evaluation What is the average CPI? State diagram gives CPI for each instruction type. Workload (program) below gives frequency of each type. Type CPI i for type Frequency CPI i x freqi i Arith/Logic 4 40%.6 Load 5 30%.5 Store 4 0% 0.4 branch 3 0% 0.6 Average CPI: 4. Better than CPI = 5 if all instructions took the same number of clock cycles (5). T = I x CPI x C #44 Lec # 5 Winter

45 Adding Support for swap to Multi Cycle Datapath You are to add support for a new instruction, swap that exchanges the values of two registers to the MIPS multicycle datapath of Figure 5.8 on page swap $rs, $rt R[rt] Swap used the R-Type format with: R[rs] the value of field rs = the value of field rd R[rs] R[rt] Add any necessary datapaths and control signals to the multicycle datapath. Find a solution that minimizes the number of clock cycles required for the new instruction without modifying the register file. Justify the need for the modifications, if any. i.e No additional register write ports Show the necessary modifications to the multicycle control finite state machine of Figure 5.38 on page 339 when adding the swap instruction. For each new state added, provide the dependent RTN and active control signal values. #45 Lec # 5 Winter

46 Adding swap Instruction Support to Multi Cycle Datapath Swap $rs, $rt R[rt] R[rs] op rs rt R[rs] R[rt] rd [3-6] [5-] [0-6] [0-6] We assume here rs = rd in instruction encoding PC+ 4 rs rt R[rs] Branch Target rd imm6 3 R[rt] The outputs of A and B should be connected to the multiplexor controlled by MemtoReg if one of the two fields (rs and rd) contains the name of one of the registers being swapped. The other register is specified by rt. The MemtoReg control signal becomes two bits. #46 Lec # 5 Winter

47 Adding swap Instruction Support to Multi Cycle Datapath IF IR Mem[PC] ID A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) EX ALUout A + SignEx(Imm6) WB R[rd] B ALUout A func B Zero A -B Zero: PC ALUout WB R[rt] A R[rd] ALUout MEM WB Swap takes 4 cycles WB #47 Lec # 5 Winter

48 Adding Support for add3 to Multi Cycle Datapath You are to add support for a new instruction, add3, that adds the values of three registers, to the MIPS multicycle datapath of Figure 5.8 on page For example: add3 $s0,$s, $s, $s3 Register $s0 gets the sum of $s, $s and $s3. The instruction encoding uses a modified R-format, with an additional register specifier rx added replacing the five low bits of the funct field. 6 bits [3-6] 5 bits [5-] 5 bits [0-6] 5 bits [5-] OP rs rt rd rx add3 $s $s $s0 Not used $s3 Add necessary datapath components, connections, and control signals to the multicycle datapath without modifying the register bank or adding additional ALUs. Find a solution that minimizes the number of clock cycles required for the new instruction. Justify the need for the modifications, if any. Show the necessary modifications to the multicycle control finite state machine of Figure 5.38 on page 339 when adding the add3 instruction. For each new state added, provide the dependent RTN and active control signal values. 6 bits [0-5] 5 bits [4-0] #48 Lec # 5 Winter

49 Add3 $rd, $rs, $rt, $rx R[rd] R[rs] + R[rt] + R[rx] add3 instruction support to Multi Cycle Datapath rx is a new register specifier in field [0-4] of the instruction No additional register read ports or ALUs allowed Modified R-Format op rs rt rd rx [3-6] [5-] [0-6] [0-6] [4-0] WriteB Re adsrc PC+ 4 rx rs rt Branch Target rd imm6. ALUout is added as an extra input to first ALU operand MUX to use the previous ALU result as an input for the second addition.. A multiplexor should be added to select between rt and the new field rx containing register number of the 3rd operand (bits 4-0 for the instruction) for input for Read Register. This multiplexor will be controlled by a new one bit control signal called ReadSrc. 3. WriteB control line added to enable writing R[rx] to B #49 Lec # 5 Winter

50 add3 instruction support to Multi Cycle Datapath IF IR Mem[PC] ID A R[rs] B R[rt] ALUout PC + (SignExt(imm6) x4) EX ALUout A + SignEx(Im6) WriteB EX WriteB ALUout B R[rx] A + B ALUout A func B Zero A -B Zero: PC ALUout EX ALUout ALUout + B MEM R[rd] ALUout WB Add3 takes 5 cycles WB #50 Lec # 5 Winter

CPU Organization (Design)

CPU Organization (Design) ISA Requirements CPU Organization (Design) Datapath Design: Capabilities & performance characteristics of principal Functional Units (FUs) needed by ISA instructions (e.g., Registers, ALU, Shifters, Logic

More information

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath The Big Picture: Where are We Now? EEM 486: Computer Architecture Lecture 3 The Five Classic Components of a Computer Processor Input Control Memory Designing a Single Cycle path path Output Today s Topic:

More information

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath 361 datapath.1 Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath Outline of Today s Lecture Introduction Where are we with respect to the BIG picture? Questions and Administrative

More information

COMP303 Computer Architecture Lecture 9. Single Cycle Control

COMP303 Computer Architecture Lecture 9. Single Cycle Control COMP33 Computer Architecture Lecture 9 Single Cycle Control A Single Cycle Datapath We have everything except control signals (underlined) RegDst busw Today s lecture will look at how to generate the control

More information

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Initial Representation Finite State Diagram. Logic Representation Logic Equations Control Implementation Alternatives Control may be designed using one of several initial representations. The choice of sequence control, and how logic is represented, can then be determined independently;

More information

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath CPE 442 single-cycle datapath.1 Outline of Today s Lecture Recap and Introduction Where are we with respect to the BIG picture?

More information

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter Control Implementation Alternatives Control may be designed using one of several initial representations. The choice of sequence control, and how logic is represented, can then be determined independently;

More information

CPE 335. Basic MIPS Architecture Part II

CPE 335. Basic MIPS Architecture Part II CPE 335 Computer Organization Basic MIPS Architecture Part II Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE232 Basic MIPS Architecture

More information

Systems Architecture I

Systems Architecture I Systems Architecture I Topics A Simple Implementation of MIPS * A Multicycle Implementation of MIPS ** *This lecture was derived from material in the text (sec. 5.1-5.3). **This lecture was derived from

More information

CS3350B Computer Architecture Winter Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2)

CS3350B Computer Architecture Winter Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) CS335B Computer Architecture Winter 25 Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) Marc Moreno Maza www.csd.uwo.ca/courses/cs335b [Adapted from lectures on Computer Organization and Design,

More information

MIPS-Lite Single-Cycle Control

MIPS-Lite Single-Cycle Control MIPS-Lite Single-Cycle Control COE68: Computer Organization and Architecture Dr. Gul N. Khan http://www.ee.ryerson.ca/~gnkhan Electrical and Computer Engineering Ryerson University Overview Single cycle

More information

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control ELEC 52/62 Computer Architecture and Design Spring 217 Lecture 4: Datapath and Control Ujjwal Guin, Assistant Professor Department of Electrical and Computer Engineering Auburn University, Auburn, AL 36849

More information

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions COP33 - Computer Architecture Lecture ulti-cycle Design & Exceptions Single Cycle Datapath We designed a processor that requires one cycle per instruction RegDst busw 32 Clk RegWr Rd ux imm6 Rt 5 5 Rs

More information

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath Outline EEL-473 Computer Architecture Designing a Single Cycle path Introduction The steps of designing a processor path and timing for register-register operations path for logical operations with immediates

More information

The Processor: Datapath & Control

The Processor: Datapath & Control Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture The Processor: Datapath & Control Processor Design Step 3 Assemble Datapath Meeting Requirements Build the

More information

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19 CO2-3224 Computer Architecture and Programming Languages CAPL Lecture 8 & 9 Dr. Kinga Lipskoch Fall 27 Single Cycle Disadvantages & Advantages Uses the clock cycle inefficiently the clock cycle must be

More information

LECTURE 6. Multi-Cycle Datapath and Control

LECTURE 6. Multi-Cycle Datapath and Control LECTURE 6 Multi-Cycle Datapath and Control SINGLE-CYCLE IMPLEMENTATION As we ve seen, single-cycle implementation, although easy to implement, could potentially be very inefficient. In single-cycle, we

More information

Recap: A Single Cycle Datapath. CS 152 Computer Architecture and Engineering Lecture 8. Single-Cycle (Con t) Designing a Multicycle Processor

Recap: A Single Cycle Datapath. CS 152 Computer Architecture and Engineering Lecture 8. Single-Cycle (Con t) Designing a Multicycle Processor CS 52 Computer Architecture and Engineering Lecture 8 Single-Cycle (Con t) Designing a Multicycle Processor February 23, 24 John Kubiatowicz (www.cs.berkeley.edu/~kubitron) lecture slides: http://inst.eecs.berkeley.edu/~cs52/

More information

Chapter 4. The Processor. Computer Architecture and IC Design Lab

Chapter 4. The Processor. Computer Architecture and IC Design Lab Chapter 4 The Processor Introduction CPU performance factors CPI Clock Cycle Time Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS

More information

ECE369. Chapter 5 ECE369

ECE369. Chapter 5 ECE369 Chapter 5 1 State Elements Unclocked vs. Clocked Clocks used in synchronous logic Clocks are needed in sequential logic to decide when an element that contains state should be updated. State element 1

More information

CPU Organization Datapath Design:

CPU Organization Datapath Design: CPU Organization Datapath Design: Capabilities & performance characteristics of principal Functional Units (FUs): (e.g., Registers, ALU, Shifters, Logic Units,...) Ways in which these components are interconnected

More information

What do we have so far? Multi-Cycle Datapath (Textbook Version)

What do we have so far? Multi-Cycle Datapath (Textbook Version) What do we have so far? ulti-cycle Datapath (Textbook Version) CPI: R-Type = 4, Load = 5, Store 4, Branch = 3 Only one instruction being processed in datapath How to lower CPI further? #1 Lec # 8 Summer2001

More information

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction CS 61C: Great Ideas in Computer Architecture MIPS CPU Datapath, Control Introduction Instructor: Alan Christopher 7/28/214 Summer 214 -- Lecture #2 1 Review of Last Lecture Critical path constrains clock

More information

Chapter 5. The Processor. Islamic University of Gaza 2009/2010

Chapter 5. The Processor. Islamic University of Gaza 2009/2010 Chapter 5 The Processor Husam Alzaq Islamic University of Gaza 2009/2010 Introduction CPU performance factors Instruction ti count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware

More information

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations ECE7 Computer Architecture Single Cycle Control Review: 3a: Overview of the Fetch Unit The common operations Fetch the : mem[] Update the program counter: Sequential Code: < + Branch and Jump: < something

More information

T = I x CPI x C. Both effective CPI and clock cycle C are heavily influenced by CPU design. CPI increased (3-5) bad Shorter cycle good

T = I x CPI x C. Both effective CPI and clock cycle C are heavily influenced by CPU design. CPI increased (3-5) bad Shorter cycle good CPU performance equation: T = I x CPI x C Both effective CPI and clock cycle C are heavily influenced by CPU design. For single-cycle CPU: CPI = 1 good Long cycle time bad On the other hand, for multi-cycle

More information

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August Lecture 8: Control COS / ELE 375 Computer Architecture and Organization Princeton University Fall 2015 Prof. David August 1 Datapath and Control Datapath The collection of state elements, computation elements,

More information

Lecture 6 Datapath and Controller

Lecture 6 Datapath and Controller Lecture 6 Datapath and Controller Peng Liu liupeng@zju.edu.cn Windows Editor and Word Processing UltraEdit, EditPlus Gvim Linux or Mac IOS Emacs vi or vim Word Processing(Windows, Linux, and Mac IOS) LaTex

More information

Systems Architecture

Systems Architecture Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some or all figures from Computer Organization and Design: The Hardware/Software

More information

Processor (I) - datapath & control. Hwansoo Han

Processor (I) - datapath & control. Hwansoo Han Processor (I) - datapath & control Hwansoo Han Introduction CPU performance factors Instruction count - Determined by ISA and compiler CPI and Cycle time - Determined by CPU hardware We will examine two

More information

ENE 334 Microprocessors

ENE 334 Microprocessors ENE 334 Microprocessors Lecture 6: Datapath and Control : Dejwoot KHAWPARISUTH Adapted from Computer Organization and Design, 3 th & 4 th Edition, Patterson & Hennessy, 2005/2008, Elsevier (MK) http://webstaff.kmutt.ac.th/~dejwoot.kha/

More information

CS 61C: Great Ideas in Computer Architecture Control and Pipelining

CS 61C: Great Ideas in Computer Architecture Control and Pipelining CS 6C: Great Ideas in Computer Architecture Control and Pipelining Instructors: Vladimir Stojanovic and Nicholas Weaver http://inst.eecs.berkeley.edu/~cs6c/sp6 Datapath Control Signals ExtOp: zero, sign

More information

EEM 486: Computer Architecture. Lecture 3. Designing Single Cycle Control

EEM 486: Computer Architecture. Lecture 3. Designing Single Cycle Control EEM 48: Computer Architecture Lecture 3 Designing Single Cycle The Big Picture: Where are We Now? Processor Input path Output Lec 3.2 An Abstract View of the Implementation Ideal Address Net Address PC

More information

Lecture 7 Pipelining. Peng Liu.

Lecture 7 Pipelining. Peng Liu. Lecture 7 Pipelining Peng Liu liupeng@zju.edu.cn 1 Review: The Single Cycle Processor 2 Review: Given Datapath,RTL -> Control Instruction Inst Memory Adr Op Fun Rt

More information

RISC Design: Multi-Cycle Implementation

RISC Design: Multi-Cycle Implementation RISC Design: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay http://www.ee.iitb.ac.in/~viren/

More information

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20) Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20) The MIPS jump and link instruction, jal is used to support procedure calls by jumping to jump address (similar to j ) and

More information

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction Multi-cycle Approach Single cycle CPU State element Combinational logic State element clock one clock cycle or instruction Multi-cycle CPU Requires state elements to hold intermediate values State Element

More information

Multiple Cycle Data Path

Multiple Cycle Data Path Multiple Cycle Data Path CS 365 Lecture 7 Prof. Yih Huang CS365 1 Multicycle Approach Break up the instructions into steps, each step takes a cycle balance the amount of work to be done restrict each cycle

More information

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface Chapter 4 The Processor: A Based on P&H Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined

More information

RISC Architecture: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation RISC Architecture: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor The Processor? Chapter 4 The Processor 2 Introduction We will learn How the ISA determines many aspects

More information

Multicycle Approach. Designing MIPS Processor

Multicycle Approach. Designing MIPS Processor CSE 675.2: Introduction to Computer Architecture Multicycle Approach 8/8/25 Designing MIPS Processor (Multi-Cycle) Presentation H Slides by Gojko Babić and Elsevier Publishing We will be reusing functional

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Recall. ISA? Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction Instruction Format or Encoding how is it decoded? Location of operands and

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware 4.1 Introduction We will examine two MIPS implementations

More information

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007 Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007 Final Exam This is a closed-book take-home exam. You are permitted a calculator and two 8.5x sheets of paper with notes. The exam

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization CS/COE0447: Computer Organization and Assembly Language Datapath and Control Sangyeun Cho Dept. of Computer Science A simple MIPS We will design a simple MIPS processor that supports a small instruction

More information

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University The Processor (1) Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3050: Theory on Computer Architectures, Spring 2017, Jinkyu Jeong (jinkyu@skku.edu)

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition The Processor - Introduction

More information

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Introduction Chapter 4.1 Chapter 4.2 Review: MIPS (RISC) Design Principles Simplicity favors regularity fixed size instructions small number

More information

ECE4680. Computer Organization and Architecture. Designing a Multiple Cycle Processor

ECE4680. Computer Organization and Architecture. Designing a Multiple Cycle Processor ECE68 Computer Organization and Architecture Designing a Multiple Cycle Processor ECE68 Multipath. -- op 6 Instr RegDst A Single Cycle Processor busw RegWr Main imm6 Instr Rb -bit Registers 6 op

More information

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University The Processor: Datapath and Control Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Introduction CPU performance factors Instruction count Determined

More information

Computer Science 141 Computing Hardware

Computer Science 141 Computing Hardware Computer Science 4 Computing Hardware Fall 6 Harvard University Instructor: Prof. David Brooks dbrooks@eecs.harvard.edu Upcoming topics Mon, Nov th MIPS Basic Architecture (Part ) Wed, Nov th Basic Computer

More information

CS152 Computer Architecture and Engineering Lecture 10: Designing a Single Cycle Control. Recap: The MIPS Instruction Formats

CS152 Computer Architecture and Engineering Lecture 10: Designing a Single Cycle Control. Recap: The MIPS Instruction Formats CS52 Computer Architecture and Engineering Lecture : Designing a Single Cycle February 7, 995 Dave Patterson (patterson@cs) and Shing Kong (shing.kong@eng.sun.com) Slides available on http://http.cs.berkeley.edu/~patterson

More information

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University Compter Architectre Chapter 5 Fall 25 Department of Compter Science Kent State University The Processor: Datapath & Control Or implementation of the MIPS is simplified memory-reference instrctions: lw,

More information

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations Chapter 4 The Processor Part I Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations

More information

The MIPS Processor Datapath

The MIPS Processor Datapath The MIPS Processor Datapath Module Outline MIPS datapath implementation Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational control Assignment: Datapath

More information

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds?

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds? Chapter 4: Assessing and Understanding Performance 1. Define response (execution) time. 2. Define throughput. 3. Describe why using the clock rate of a processor is a bad way to measure performance. Provide

More information

Microprogramming. Microprogramming

Microprogramming. Microprogramming Microprogramming Alternative way of specifying control FSM State -- bubble control signals in bubble next state given by signals on arc not a great language to specify when things are complex Treat as

More information

Design of the MIPS Processor

Design of the MIPS Processor Design of the MIPS Processor We will study the design of a simple version of MIPS that can support the following instructions: I-type instructions LW, SW R-type instructions, like ADD, SUB Conditional

More information

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl. Lecture 4: Review of MIPS Instruction formats, impl. of control and datapath, pipelined impl. 1 MIPS Instruction Types Data transfer: Load and store Integer arithmetic/logic Floating point arithmetic Control

More information

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design 1 TDT4255 Computer Design Lecture 4 Magnus Jahre 2 Outline Chapter 4.1 to 4.4 A Multi-cycle Processor Appendix D 3 Chapter 4 The Processor Acknowledgement: Slides are adapted from Morgan Kaufmann companion

More information

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining Single-Cycle Design Problems Assuming fixed-period clock every instruction datapath uses one

More information

Chapter 4. The Processor Designing the datapath

Chapter 4. The Processor Designing the datapath Chapter 4 The Processor Designing the datapath Introduction CPU performance determined by Instruction Count Clock Cycles per Instruction (CPI) and Cycle time Determined by Instruction Set Architecure (ISA)

More information

ECS 154B Computer Architecture II Spring 2009

ECS 154B Computer Architecture II Spring 2009 ECS 154B Computer Architecture II Spring 2009 Pipelining Datapath and Control 6.2-6.3 Partially adapted from slides by Mary Jane Irwin, Penn State And Kurtis Kredo, UCD Pipelined CPU Break execution into

More information

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering Datapath for a Simplified Processor James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy Introduction

More information

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Computer Organization and Structure. Bing-Yu Chen National Taiwan University Computer Organization and Structure Bing-Yu Chen National Taiwan University The Processor Logic Design Conventions Building a Datapath A Simple Implementation Scheme An Overview of Pipelining Pipelined

More information

The Big Picture: Where are We Now? CS 152 Computer Architecture and Engineering Lecture 11. The Five Classic Components of a Computer

The Big Picture: Where are We Now? CS 152 Computer Architecture and Engineering Lecture 11. The Five Classic Components of a Computer The Big Picture: Where are We Now? S 5 omputer Architecture and ngineering Lecture Multicycle ontroller esign (ontinued) The Five lassic omponents of a omputer Processor Input ontrol atapath Output Today

More information

Processor (multi-cycle)

Processor (multi-cycle) CS359: Computer Architecture Processor (multi-cycle) Yanyan Shen Department of Computer Science and Engineering Five Instruction Steps ) Instruction Fetch ) Instruction Decode and Register Fetch 3) R-type

More information

The overall datapath for RT, lw,sw beq instrucution

The overall datapath for RT, lw,sw beq instrucution Designing The Main Control Unit: Remember the three instruction classes {R-type, Memory, Branch}: a) R-type : Op rs rt rd shamt funct 1.src 2.src dest. 31-26 25-21 20-16 15-11 10-6 5-0 a) Memory : Op rs

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

CS232 Final Exam May 5, 2001

CS232 Final Exam May 5, 2001 CS232 Final Exam May 5, 2 Name: This exam has 4 pages, including this cover. There are six questions, worth a total of 5 points. You have 3 hours. Budget your time! Write clearly and show your work. State

More information

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Inf2C - Computer Systems Lecture Processor Design Single Cycle Inf2C - Computer Systems Lecture 10-11 Processor Design Single Cycle Boris Grot School of Informatics University of Edinburgh Previous lectures Combinational circuits Combinations of gates (INV, AND, OR,

More information

Single Cycle Datapath

Single Cycle Datapath Single Cycle atapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili Section 4.-4.4 Appendices B.7, B.8, B.,.2 Practice Problems:, 4, 6, 9 ing (2) Introduction We will examine two MIPS implementations

More information

CSE Lecture In Class Example Handout

CSE Lecture In Class Example Handout CSE 30321 Lecture 10-11 In Class Example Handout Question 1: First, we briefly review the notion of a clock cycle (CC). Generally speaking a CC is the amount of time required for (i) a set of inputs to

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

EE 457 Unit 6a. Basic Pipelining Techniques

EE 457 Unit 6a. Basic Pipelining Techniques EE 47 Unit 6a Basic Pipelining Techniques 2 Pipelining Introduction Consider a drink bottling plant Filling the bottle = 3 sec. Placing the cap = 3 sec. Labeling = 3 sec. Would you want Machine = Does

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control Chapter 5 The Processor: Datapath and Control Big Picture: Where are We Now? Performance of a

More information

ECE Exam I - Solutions February 19 th, :00 pm 4:25pm

ECE Exam I - Solutions February 19 th, :00 pm 4:25pm ECE 3056 Exam I - Solutions February 19 th, 2015 3:00 pm 4:25pm 1. (35 pts) Consider the following block of SPIM code. The text segment starts at 0x00400000 and the data segment starts at 0x10010000..data

More information

Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories

Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories Computer Organization Structure of a Computer Computer design as an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + Control = finite

More information

Beyond Pipelining. CP-226: Computer Architecture. Lecture 23 (19 April 2013) CADSL

Beyond Pipelining. CP-226: Computer Architecture. Lecture 23 (19 April 2013) CADSL Beyond Pipelining Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay http://www.ee.iitb.ac.in/~viren/

More information

Pipelined Processor Design

Pipelined Processor Design Pipelined Processor Design Pipelined Implementation: MIPS Virendra Singh Computer Design and Test Lab. Indian Institute of Science (IISc) Bangalore virendra@computer.org Advance Computer Architecture http://www.serc.iisc.ernet.in/~viren/courses/aca/aca.htm

More information

CS232 Final Exam May 5, 2001

CS232 Final Exam May 5, 2001 CS232 Final Exam May 5, 2 Name: Spiderman This exam has 4 pages, including this cover. There are six questions, worth a total of 5 points. You have 3 hours. Budget your time! Write clearly and show your

More information

Single Cycle Data Path

Single Cycle Data Path Single ycle ata Path S 365 Lecture 6 Prof. Yih Huang S365 1 MIPS Lite We're ready to look at an implementation of the MIPS Simplified to support only: memory-reference instructions: lw, sw arithmetic-logical

More information

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan) Microarchitecture Design of Digital Circuits 27 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan) http://www.syssec.ethz.ch/education/digitaltechnik_7 Adapted from Digital

More information

Example Sketch a stick diagram for a CMOS gate computing Y = (A + B + C) D (see Figure 1.18) and estimate the cell width and height.

Example Sketch a stick diagram for a CMOS gate computing Y = (A + B + C) D (see Figure 1.18) and estimate the cell width and height. V DD A B C D.6 DESIGN PARTITIONING 35 Example Sketch a stick diagram for a CMOS gate computing Y = (A + B + C) D (see Figure.8) and estimate the cell width and height. Solution: Figure.47shows a stick

More information

Microprogrammed Control Approach

Microprogrammed Control Approach Microprogrammed Control Approach Considering the FSM for our MIPS subset has 10 states, the complete MIPS instruction set, which contains more than 100 instructions, and considering that these instructions

More information

CPE 335 Computer Organization. Basic MIPS Pipelining Part I

CPE 335 Computer Organization. Basic MIPS Pipelining Part I CPE 335 Computer Organization Basic MIPS Pipelining Part I Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE232 Basic MIPS Pipelining

More information

CMSC Computer Architecture Lecture 4: Single-Cycle uarch and Pipelining. Prof. Yanjing Li University of Chicago

CMSC Computer Architecture Lecture 4: Single-Cycle uarch and Pipelining. Prof. Yanjing Li University of Chicago CMSC 22200 Computer Architecture Lecture 4: Single-Cycle uarch and Pipelining Prof. Yanjing Li University of Chicago Administrative Stuff! Lab1 due at 11:59pm today! Lab2 out " Pipeline ARM simulator "

More information

ENGR 3410: Midterm. Mark L. Chang. November 7, 2005

ENGR 3410: Midterm. Mark L. Chang. November 7, 2005 ENGR 3410: Midterm Mark L. Chang November 7, 2005 Instructions This is a test. This is only a test. You have 3 hours to complete this exam. You should take this exam in one sitting. You should not need

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

CMOS VLSI Design. MIPS Processor Example. Outline

CMOS VLSI Design. MIPS Processor Example. Outline COS VLSI Design IPS Processor Example Outline Design Partitioning IPS Processor Example Architecture icroarchitecture Logic Design Circuit Design Physical Design Fabrication, Packaging, Testing Slide 2

More information

EECS Digital Design

EECS Digital Design EECS 150 -- Digital Design Lecture 11-- Processor Pipelining 2010-2-23 John Wawrzynek Today s lecture by John Lazzaro www-inst.eecs.berkeley.edu/~cs150 1 Today: Pipelining How to apply the performance

More information

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes NAME: STUDENT NUMBER: EE557--FALL 1999 MAKE-UP MIDTERM 1 Closed books, closed notes Q1: /1 Q2: /1 Q3: /1 Q4: /1 Q5: /15 Q6: /1 TOTAL: /65 Grade: /25 1 QUESTION 1(Performance evaluation) 1 points We are

More information

Pipelining! Advanced Topics on Heterogeneous System Architectures. Politecnico di Milano! Seminar DEIB! 30 November, 2017!

Pipelining! Advanced Topics on Heterogeneous System Architectures. Politecnico di Milano! Seminar DEIB! 30 November, 2017! Advanced Topics on Heterogeneous System Architectures Pipelining! Politecnico di Milano! Seminar Room @ DEIB! 30 November, 2017! Antonio R. Miele! Marco D. Santambrogio! Politecnico di Milano! 2 Outline!

More information

Machine Organization & Assembly Language

Machine Organization & Assembly Language Name: CSE 378 Winter 29 Machine Organization & Assembly Language Midterm Exam Solution your answers on these pages. itional pages may be attached (with staple) if necessary. Please ensure that your answers

More information

Computer Hardware Engineering

Computer Hardware Engineering Computer Hardware Engineering IS2, spring 27 Lecture 9: LU and s ssociate Professor, KTH Royal Institute of Technology Slides version. 2 Course Structure Module : C and ssembly Programming LE LE2 LE EX

More information

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design ENGN64: Design of Computing Systems Topic 4: Single-Cycle Processor Design Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University

More information

Fundamentals of Computer Systems

Fundamentals of Computer Systems Fundamentals of Computer Systems Single Cycle MIPS Processor Stephen. Edwards Columbia University Summer 26 Illustrations Copyright 27 Elsevier The path The lw The sw R-Type s The beq The Controller Encoding

More information