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 Design Steps. EECC550 - Shaaban

CPU Design Steps. EECC550 - Shaaban CPU Design Steps 1. Analyze instruction set operations using independent RTN => datapath requirements. 2. Select set of datapath components & establish clock methodology. 3. Assemble datapath meeting the

More information

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

Designing a Multicycle Processor

Designing a Multicycle Processor Designing a Multicycle Processor Arquitectura de Computadoras Arturo Díaz D PérezP Centro de Investigación n y de Estudios Avanzados del IPN adiaz@cinvestav.mx Arquitectura de Computadoras Multicycle-

More information

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath COMP33 - Computer Architecture Lecture 8 Designing a Single Cycle Datapath The Big Picture The Five Classic Components of a Computer Processor Input Control Memory Datapath Output The Big Picture: The

More information

CS 152 Computer Architecture and Engineering. Lecture 10: Designing a Multicycle Processor

CS 152 Computer Architecture and Engineering. Lecture 10: Designing a Multicycle Processor CS 152 Computer Architecture and Engineering Lecture 1: Designing a Multicycle Processor October 1, 1997 Dave Patterson (http.cs.berkeley.edu/~patterson) lecture slides: http://www-inst.eecs.berkeley.edu/~cs152/

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

CS152 Computer Architecture and Engineering. Lecture 8 Multicycle Design and Microcode John Lazzaro (www.cs.berkeley.

CS152 Computer Architecture and Engineering. Lecture 8 Multicycle Design and Microcode John Lazzaro (www.cs.berkeley. CS152 Computer Architecture and Engineering Lecture 8 Multicycle Design and Microcode 2004-09-23 John Lazzaro (www.cs.berkeley.edu/~lazzaro) Dave Patterson (www.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs152/

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

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

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

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

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #19 Designing a Single-Cycle CPU 27-7-26 Scott Beamer Instructor AI Focuses on Poker CS61C L19 CPU Design : Designing a Single-Cycle CPU

More information

Topic #6. Processor Design

Topic #6. Processor Design Topic #6 Processor Design Major Goals! To present the single-cycle implementation and to develop the student's understanding of combinational and clocked sequential circuits and the relationship between

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

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath ECE468 Computer Organization and Architecture Designing a Single Cycle Datapath ECE468 datapath1 The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Control Input Datapath

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

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón ICS 152 Computer Systems Architecture Prof. Juan Luis Aragón Lecture 5 and 6 Multicycle Implementation Introduction to Microprogramming Readings: Sections 5.4 and 5.5 1 Review of Last Lecture We have seen

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

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control CS Computer Architecture Single-Cycle CPU Datapath & Control Instructor: Sören Schwertfeger http://shtech.org/courses/ca/ School of Information Science and Technology SIST ShanghaiTech University Slides

More information

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller ECE468 Computer Organization and Architecture Designing a Multiple Cycle Controller ECE468 multicontroller Review of a Multiple Cycle Implementation The root of the single cycle processor s problems: The

More information

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle Boris Grot School of Informatics University of Edinburgh Previous lecture: single-cycle processor Inf2C Computer Systems - 2017-2018. Boris

More information

Chapter 5: The Processor: Datapath and Control

Chapter 5: The Processor: Datapath and Control Chapter 5: The Processor: Datapath and Control Overview Logic Design Conventions Building a Datapath and Control Unit Different Implementations of MIPS instruction set A simple implementation of a processor

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

CC 311- Computer Architecture. The Processor - Control

CC 311- Computer Architecture. The Processor - Control CC 311- Computer Architecture The Processor - Control Control Unit Functions: Instruction code Control Unit Control Signals Select operations to be performed (ALU, read/write, etc.) Control data flow (multiplexor

More information

Lecture #17: CPU Design II Control

Lecture #17: CPU Design II Control Lecture #7: CPU Design II Control 25-7-9 Anatomy: 5 components of any Computer Personal Computer Computer Processor Control ( brain ) This week ( ) path ( brawn ) (where programs, data live when running)

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

361 control.1. EECS 361 Computer Architecture Lecture 9: Designing Single Cycle Control

361 control.1. EECS 361 Computer Architecture Lecture 9: Designing Single Cycle Control 36 control. EECS 36 Computer Architecture Lecture 9: Designing Single Cycle Control Recap: The MIPS Subset ADD and subtract add rd, rs, rt sub rd, rs, rt OR Imm: ori rt, rs, imm6 3 3 26 2 6 op rs rt rd

More information

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI CSCI 42: Computer Architectures The Processor (2) Fengguang Song Department of Computer & Information Science IUPUI Full Datapath Branch Target Instruction Fetch Immediate 4 Today s Contents We have looked

More information

Processor: Multi- Cycle Datapath & Control

Processor: Multi- Cycle Datapath & Control Processor: Multi- Cycle Datapath & Control (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann, 27) COURSE

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

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

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic CS 61C: Great Ideas in Computer Architecture Datapath Instructors: John Wawrzynek & Vladimir Stojanovic http://inst.eecs.berkeley.edu/~cs61c/fa15 1 Components of a Computer Processor Control Enable? Read/Write

More information

Midterm Questions Overview

Midterm Questions Overview Midterm Questions Overview Four questions from the following: Performance Evaluation: Given MIPS code, estimate performance on a given CPU. Compare performance of different CPU/compiler changes for a given

More information

RISC Processor Design

RISC Processor Design RISC Processor Design Single Cycle Implementation - MIPS Virendra Singh Indian Institute of Science Bangalore virendra@computer.org Lecture 13 SE-273: Processor Design Feb 07, 2011 SE-273@SERC 1 Courtesy:

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

Midterm Questions Overview

Midterm Questions Overview Midterm Questions Overview Four questions from the following: Performance Evaluation: Given MIPS code, estimate performance on a given CPU. Compare performance of different CPU/compiler changes for a given

More information

CSE 2021 COMPUTER ORGANIZATION

CSE 2021 COMPUTER ORGANIZATION CSE 22 COMPUTER ORGANIZATION HUGH CHESSER CHESSER HUGH CSEB 2U 2U CSEB Agenda Topics:. Sample Exam/Quiz Q - Review 2. Multiple cycle implementation Patterson: Section 4.5 Reminder: Quiz #2 Next Wednesday

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

CSE 2021 COMPUTER ORGANIZATION

CSE 2021 COMPUTER ORGANIZATION CSE 2021 COMPUTER ORGANIZATION HUGH LAS CHESSER 1012U HUGH CHESSER CSEB 1012U W10-M Agenda Topics: 1. Multiple cycle implementation review 2. State Machine 3. Control Unit implementation for Multi-cycle

More information

Chapter 4. The Processor

Chapter 4. The Processor 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

Ch 5: Designing a Single Cycle Datapath

Ch 5: Designing a Single Cycle Datapath Ch 5: esigning a Single Cycle path Computer Systems Architecture CS 365 The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Control Memory path Input Output Today s Topic:

More information

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control معماري كامپيوتر پيشرفته معماري MIPS data path and control abbasi@basu.ac.ir Topics Building a datapath support a subset of the MIPS-I instruction-set A single cycle processor datapath all instruction actions

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

Single Cycle CPU Design. Mehran Rezaei

Single Cycle CPU Design. Mehran Rezaei Single Cycle CPU Design Mehran Rezaei What does it mean? Instruction Fetch Instruction Memory clk pc 32 32 address add $t,$t,$t2 instruction Next Logic to generate the address of next instruction The Branch

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

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

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content 3/6/8 CSCI 42: Computer Architectures The Processor (2) Fengguang Song Department of Computer & Information Science IUPUI Today s Content We have looked at how to design a Data Path. 4.4, 4.5 We will design

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

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

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR Microprogramming Exceptions and interrupts 9 CMPE Fall 26 A. Di Blas Fall 26 CMPE CPU Multicycle From single-cycle to Multicycle CPU with sequential control: Finite State Machine Textbook Edition: 5.4,

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

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

Working on the Pipeline

Working on the Pipeline Computer Science 6C Spring 27 Working on the Pipeline Datapath Control Signals Computer Science 6C Spring 27 MemWr: write memory MemtoReg: ALU; Mem RegDst: rt ; rd RegWr: write register 4 PC Ext Imm6 Adder

More information

Points available Your marks Total 100

Points available Your marks Total 100 CSSE 3 Computer Architecture I Rose-Hulman Institute of Technology Computer Science and Software Engineering Department Exam Name: Section: 3 This exam is closed book. You are allowed to use the reference

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

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

361 multipath..1. EECS 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor

361 multipath..1. EECS 361 Computer Architecture Lecture 10: Designing a Multiple Cycle Processor 36 multipath.. EECS 36 Computer Architecture Lecture : Designing a Multiple Cycle Processor Recap: A Single Cycle Datapath We have everything except control signals (underline) Today s lecture will show

More information

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu CENG 342 Computer Organization and Design Lecture 6: MIPS Processor - I Bei Yu CEG342 L6. Spring 26 The Processor: Datapath & Control q We're ready to look at an implementation of the MIPS q Simplified

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

CpE 442. Designing a Multiple Cycle Controller

CpE 442. Designing a Multiple Cycle Controller CpE 442 Designing a Multiple Cycle Controller CPE 442 multicontroller.. Outline of Today s Lecture Recap (5 minutes) Review of FSM control (5 minutes) From Finite State Diagrams to Microprogramming (25

More information

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 25 CPU Design: Designing a Single-cycle CPU Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia T-Mobile s Wi-Fi / Cell phone

More information

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs6c UC Berkeley CS6C : Machine Structures The Internet is broken?! The Clean Slate team at Stanford wants to revamp the Internet, making it safer (from viruses), more reliable

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

The Processor: Datapath & Control

The Processor: Datapath & Control Chapter Five 1 The Processor: Datapath & Control We're ready to look at an implementation of the MIPS Simplified to contain only: memory-reference instructions: lw, sw arithmetic-logical instructions:

More information

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering

Midterm I October 6, 1999 CS152 Computer Architecture and Engineering University of California, Berkeley College of Engineering Computer Science Division EECS Fall 1999 John Kubiatowicz Midterm I October 6, 1999 CS152 Computer Architecture and Engineering Your Name: SID

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1 Guest Lecturer: Sagar Karandikar hfp://inst.eecs.berkeley.edu/~cs61c/ http://research.microsoft.com/apps/pubs/default.aspx?id=212001!

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath & Control Part 2

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath & Control Part 2 CS 6C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath & Control Part 2 Instructors: Krste Asanovic & Vladimir Stojanovic hfp://inst.eecs.berkeley.edu/~cs6c/ Review:

More information

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade CSE 141 Computer Architecture Summer Session 1 2004 Lecture 3 ALU Part 2 Single Cycle CPU Part 1 Pramod V. Argade Reading Assignment Announcements Chapter 5: The Processor: Datapath and Control, Sec. 5.3-5.4

More information

Chapter 5 Solutions: For More Practice

Chapter 5 Solutions: For More Practice Chapter 5 Solutions: For More Practice 1 Chapter 5 Solutions: For More Practice 5.4 Fetching, reading registers, and writing the destination register takes a total of 300ps for both floating point add/subtract

More information

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU CS6C L9 CPU Design : Designing a Single-Cycle CPU () insteecsberkeleyedu/~cs6c CS6C : Machine Structures Lecture #9 Designing a Single-Cycle CPU 27-7-26 Scott Beamer Instructor AI Focuses on Poker Review

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #17 Single Cycle CPU Datapath CPS today! 2005-10-31 There is one handout today at the front and back of the room! Lecturer PSOE, new dad

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

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs6c UC Berkeley CS6C : Machine Structures Lecture 26 Single-cycle CPU Control 27-3-2 Exhausted TA Ben Sussman www.icanhascheezburger.com Qutrits Bring Quantum Computers Closer:

More information

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering

Midterm I March 12, 2003 CS152 Computer Architecture and Engineering University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2003 John Kubiatowicz Midterm I March 2, 2003 CS52 Computer Architecture and Engineering Your Name: SID Number:

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

Lets Build a Processor

Lets Build a Processor Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let s review Boolean Logic and build the ALU we ll need (Material from Appendix B) operation a 32 ALU result

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

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

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction EECS150 - Digital Design Lecture 10- CPU Microarchitecture Feb 18, 2010 John Wawrzynek Spring 2010 EECS150 - Lec10-cpu Page 1 Processor Microarchitecture Introduction Microarchitecture: how to implement

More information

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: Data Paths and Microprogramming We have spent time looking at the MIPS instruction set architecture and building

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

Review: Abstract Implementation View

Review: Abstract Implementation View Review: Abstract Implementation View Split memory (Harvard) model - single cycle operation Simplified to contain only the instructions: memory-reference instructions: lw, sw arithmetic-logical instructions:

More information

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture The Processor Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut CSE3666: Introduction to Computer Architecture Introduction CPU performance factors Instruction count

More information

Note- E~ S. \3 \S U\e. ~ ~s ~. 4. \\ o~ (fw' \i<.t. (~e., 3\0)

Note- E~ S. \3 \S U\e. ~ ~s ~. 4. \\ o~ (fw' \i<.t. (~e., 3\0) 5.4 A Multicycle Implementation 377 Similarly, if we had a machine with more powerful operations and addressing modes, instructions could vary from three or four functional unit delays to tens or even

More information

CENG 3420 Lecture 06: Datapath

CENG 3420 Lecture 06: Datapath CENG 342 Lecture 6: Datapath Bei Yu byu@cse.cuhk.edu.hk CENG342 L6. Spring 27 The Processor: Datapath & Control q We're ready to look at an implementation of the MIPS q Simplified to contain only: memory-reference

More information

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability!

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability! inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I CS61C L18 CPU Design: The Single-Cycle I (1)! 2010-07-21!!!Instructor Paul Pearce! Nasty new windows vulnerability!

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

Alternative to single cycle. Drawbacks of single cycle implementation. Multiple cycle implementation. Instruction fetch

Alternative to single cycle. Drawbacks of single cycle implementation. Multiple cycle implementation. Instruction fetch Drawbacks of single cycle implementation Alternative to single cycle All instructions take the same time although some instructions are longer than others; e.g. load is longer than add since it has to

More information

CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions. Review of a Multiple Cycle Implementation

CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions. Review of a Multiple Cycle Implementation CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions March 3, 1995 Dave Patterson (patterson@cs) and Shing Kong (shing.kong@eng.sun.com) Slides available on http://http.cs.berkeley.edu/~patterson

More information

CS359: Computer Architecture. The Processor (A) Yanyan Shen Department of Computer Science and Engineering

CS359: Computer Architecture. The Processor (A) Yanyan Shen Department of Computer Science and Engineering CS359: Computer Architecture The Processor (A) Yanyan Shen Department of Computer Science and Engineering Eecuting R-type Instructions 7 Instructions ADD and subtract add rd, rs, rt sub rd, rs, rt OR Immediate:

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

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer EECS150 - Digital Design Lecture 9- CPU Microarchitecture Feb 15, 2011 John Wawrzynek Spring 2011 EECS150 - Lec09-cpu Page 1 Watson: Jeopardy-playing Computer Watson is made up of a cluster of ninety IBM

More information

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang Lecture 12: Single-Cycle Control Unit Spring 2018 Jason Tang 1 Topics Control unit design Single cycle processor Control unit circuit implementation 2 Computer Organization Computer Processor Memory Devices

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 34 Single Cycle CPU Control I 24-4-16 Lecturer PSOE Dan Garcia www.cs.berkeley.edu/~ddgarcia 1.5 Quake?! NBC movie on May 3 rd. Truth stranger

More information