CPU Organization (Design)

Size: px
Start display at page:

Download "CPU Organization (Design)"

Transcription

1 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 Units,...) Components Ways in which these components are interconnected (buses connections, multiplexors, etc.). Connections How information flows between components. Control Unit Design: Components & their connections needed by ISA instructions Control/sequencing of operations of datapath components to realize ISA instructions Logic and means by which such information flow is controlled. Control and coordination of FUs operation to realize the targeted Instruction Set Architecture to be implemented (can either be implemented using a finite state machine or a microprogram). Hardware description with a suitable language, possibly using Register Transfer Notation (RTN). 4 th Edition Chapter rd Edition Chapter EECC55 - Shaaban # Lec # 4 Winter

2 Major CPU Design Steps Analyze instruction set to get datapath requirements: Using independent RTN, write the micro-operations required for target ISA instructions. 2 This provides the the required datapath components and how they are connected. 2 Select set of datapath components and establish clocking methodology (defines when storage or state elements can read and when they can be written, e.g clock edge-triggered) e.g Flip-Flops 3 Assemble datapath meeting the requirements. 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. 5 Control unit design, based on micro-operation timing and control signals identified: Combinational logic: For single cycle CPU. Hard-Wired: Finite-state machine implementation. i.e CPI = Microprogrammed. ISA Requirements CPU Design e.g Any instruction completed in one cycle EECC55 - Shaaban #2 Lec # 4 Winter

3 CPU Design & Implantation Process Top-down Design: Specify component behavior from high-level requirements (ISA). Bottom-up Design: Assemble components in target technology to establish critical timing (hardware delays, critical path timing). Iterative refinement: Establish a partial solution, expand and improve. Instruction Set Architecture (ISA): Provides Requirements Datapath Processor ISA Requirements Control CPU Design Reg. File Mux ALU Reg Mem Decoder Sequencer Target VLSI implementation Technology Cells Gates EECC55 - Shaaban #3 Lec # 4 Winter

4 Datapath Design Steps Write the micro-operation sequences required for a number of representative target ISA instructions using independent RTN. Independent RTN statements specify: the required datapath components and how they are connected. 2 From the above, create an initial datapath by determining possible destinations for each data source (i.e registers, ALU). This establishes connectivity requirements (data paths, or connections) for datapath components. Whenever multiple sources are connected to a single input, a multiplexor of appropriate size is added. (or destination) Find the worst-time propagation delay (critical path) in the datapath to determine the datapath clock cycle (CPU clock cycle, C). Complete the micro-operation sequences for all remaining instructions adding datapath components + connections/multiplexors as needed. EECC55 - Shaaban #4 Lec # 4 Winter

5 MIPS Instruction Formats R-Type op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] [:6] [5:] I-Type: ALU Load/Store, Branch J-Type: Jumps op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits 26 2 [3:26] [25:2] [2:6] [5:] op target address 6 bits 26 bits op: Opcode, operation of the instruction. rs, rt, rd: The source and destination register specifiers. shamt: Shift amount. funct: Selects the variant of the operation in the op field. address / immediate: Address offset or immediate value. target address: Target address of the jump instruction. 6 [3:26] [25:] EECC55 - Shaaban #5 Lec # 4 Winter Or address offset

6 MIPS R-Type R (ALU) Instruction Fields Opcode for R-Type= R-Type: All ALU instructions that use three registers OP rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] [:6] [5:] op: Opcode, basic operation of the instruction. For R-Type op = Independent RTN: rs: The first register source operand. rt: The second register source operand. rd: The register destination operand. shamt: Shift amount used in constant shift operations. funct: Function, selects the specific variant of operation in the op field. Funct field value examples: Add = Sub = 34 AND = 36 OR =37 NOR = 39 st operand 2nd operand Destination Destination register in rd Operand register in rs Rs, rt, rd are register specifier fields Function Field Instruction Word R[rd] R[rs] funct R[rt] PC PC + 4 Mem[PC] Operand register in rt Examples: R-Type = Register Type Register Addressing used (Mode ) add $,$2,$3 sub $,$2,$3 and $,$2,$3 or $,$2,$3 EECC55 - Shaaban #6 Lec # 4 Winter

7 MIPS ALU I-Type I Instruction Fields I-Type ALU instructions that use two registers and an immediate value Loads/stores, conditional branches. st operand Destination 2nd operand OP rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] imm6 op: Opcode, operation of the instruction. rs: The register source operand. rt: The result destination register. immediate: Constant second operand for ALU instruction. imm6 OP = 8 Examples: OP = 2 I-Type = Immediate Type Immediate Addressing used (Mode 2) Result register in rt add immediate: addi $,$2, and immediate andi $,$2, imm6 = 6 bit immediate field Independent RTN for addi: Instruction Word R[rt] R[rs] + imm6 PC PC + 4 Source operand register in rs Mem[PC] Constant operand in immediate EECC55 - Shaaban #7 Lec # 4 Winter

8 MIPS Load/Store I-Type I Instruction Fields Examples: Base OP rs rt address 6 bits 5 bits 5 bits 6 bits op: Opcode, operation of the instruction. For load word op = 35, for store word op = 43. rs: The register containing memory base address. rt: For loads, the destination register. For stores, the source register of value to be stored. address: 6-bit memory address offset in bytes added to base register. imm6 source register in rt Offset Store word: sw $3, 5($4) Load word: lw $, ($2) Destination register in rt Base or Displacement Addressing used (Mode 3) Src./Dest. [3:26] [25:2] [2:6] [5:] Offset base register in rs imm6 = 6 bit immediate field (e.g. offset) imm6 base register in rs Signed address offset in bytes Sign Extended Instruction Word Mem[PC] Mem[R[rs] + imm6] R[rt] PC PC + 4 Instruction Word Mem[PC] R[rt] Mem[R[rs] + imm6] PC PC + 4 EECC55 - Shaaban #8 Lec # 4 Winter

9 MIPS Branch I-Type I Instruction Fields OP rs rt address 6 bits 5 bits 5 bits 6 bits imm6 [3:26] [25:2] [2:6] [5:] Signed address offset in words op: Opcode, operation of the instruction. Word = 4 bytes rs: The first register being compared rt: The second register being compared. address: 6-bit memory address branch target offset in words added to PC to form branch address. imm6 OP = 4 Examples: OP = 5 Independent RTN for beq: PC-Relative Addressing used (Mode 4) Register in rs Register in rt Branch on equal beq $,$2, Branch on not equal bne $,$2, Sign extended Instruction Word Mem[PC] R[rs] = R[rt] : PC PC imm6 x 4 R[rs] R[rt] : PC PC + 4 imm6 = 6 bit immediate field (e.g. offset) offset in bytes equal to instruction address field x 4 Added to PC+4 to form branch target Imm6 x 4 EECC55 - Shaaban #9 Lec # 4 Winter

10 MIPS J-Type J Instruction Fields J-Type: Include jump j, jump and link jal OP jump target 6 bits 26 bits op: Opcode, operation of the instruction. Jump j op = 2 Jump and link jal op = 3 jump target: jump memory address in words. Examples: [3:26] [25:] Jump j Jump and link jal Jump target in words Word = 4 bytes Jump memory address in bytes equal to instruction field jump target x 4 Effective -bit jump address: PC(3-28),jump_target, PC(3-28) From jump target = 25 PC+4 4 bits 26 bits 2 bits Independent RTN for j: Instruction Word Mem[PC] PC PC + 4 PC PC(3-28),jump_target, J-Type = Jump Type Pseudodirect Addressing used (Mode 5) EECC55 - Shaaban # Lec # 4 Winter

11 R I I ADD and SUB: add rd, rs, rt sub rd, rs, rt OR Immediate: ori rt, rs, imm6 LOAD and STORE Word lw rt, rs, imm6 3 sw rt, rs, imm6 A Subset of MIPS Instructions 3 35 = lw 43 = sw op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] [:6] [5:] op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] = add 34 = sub Offset in bytes I BRANCH: beq rs, rt, imm op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] Offset in words EECC55 - Shaaban # Lec # 4 Winter

12 Basic MIPS Instruction Processing Steps Instruction/program Memory Instruction Fetch Next Instruction Instruction Decode Obtain instruction from program storage Instruction Mem[PC] Update program counter to address of next instruction PC PC + 4 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 (Based on Opcode) T = I x CPI x C EECC55 - Shaaban #2 Lec # 4 Winter

13 Overview of MIPS Instruction Micro-operations operations All instructions go through these common steps: Send program counter to instruction memory and fetch the instruction. (fetch) Instruction Mem[PC] Common Steps Update the program counter to point to next instruction PC PC + 4 one or two registers, using instruction fields. (decode) Load reads one register only. Additional instruction execution actions (execution) depend on the instruction in question, but similarities exist: All instruction classes (except J type) use the ALU after reading the registers: Memory reference instructions use it for effective address calculation. Arithmetic and logic instructions (R-Type), use it for the specified operation. Branches use it for comparison. Additional execution steps where instruction classes differ: Memory reference instructions: Access memory for a load or store. Arithmetic and logic instructions: Write ALU result back in register. Branch instructions: Possibly change next instruction address (update PC) based on comparison (i.e if branch is taken). EECC55 - Shaaban #3 Lec # 4 Winter

14 A Single Cycle MIPS CPU Design Design target: A single-cycle per instruction MIPS CPU design All micro-operations of an instruction are to be carried out in a single CPU clock cycle. Cycles Per Instruction = CPI = CPU Performance Equation: T = I x CPI x C CPI = 4 Add Add Abstract view of single cycle MIPS CPU showing major functional units (components) and major connections between them Data PC A ddress Instruction Inst ruct ion memory ISA Register # Re g ist er s ALU Address Register # Register # Dat a memory Data 4 th Edition Figure 4. page 32-3 rd Edition Figure 5. page 287 EECC55 - Shaaban #4 Lec # 4 Winter

15 R-Type Example: Micro-Operation Sequence For ADD add rd, rs, rt = add 34 = sub OP rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] [:6] [5:] Instruction Word Mem[PC] Fetch the instruction PC PC + 4 Increment PC R[rd] R[rs] + R[rt] Memory Add register rs to register rt result in register rd Independent RTN? Program i.e Funct =add = Common Steps EECC55 - Shaaban #5 Lec # 4 Winter

16 Initial Datapath Components Three components needed by: Instruction Fetch: Instruction Mem[PC] Program Counter Update: PC PC + 4 Instruction address Instruction Inst ruct ion memory PC Instruction Word Add -bit a. Instruction memory b. Program counter c. Adder Sum Two state elements (memory) needed to store and access instructions: Instruction memory: Only read access (by user code). No read control signal needed. 2 Program counter (PC): -bit register. Written at end of every clock cycle (edge-triggered) : No write control signal. 3 -bit Adder: To compute the the next instruction address (PC + 4). 4 th Edition Figure 4.5, page 38-3 rd Edition Figure 5.5, page Basics of logic design/logic building blocks review in Appendix C in Book CD (4 th Edition Appendix B) EECC55 - Shaaban #6 Lec # 4 Winter

17 Instruction Fetch & PC Update: 2 Building The Datapath Instruction Mem[PC] PC PC + 4 Add 4 2 PC PC + 4 PC address Instruction Portion of the datapath used for fetching instructions and incrementing the program counter (PC). Inst ruct ion memory Instruction Mem[PC] PC write or update is edge triggered at the end of the cycle 4 th Edition Figure 4.6 page 39-3 rd Edition Figure 5.6 page 293 Clock input to PC, memory not shown EECC55 - Shaaban #7 Lec # 4 Winter

18 ISA Register File Register numbers Data More Datapath Components register register 2 Write register Write Data Re g ist e r s data data 2 R[rs] R[rt] Main -bit ALU Data 4 ALU operation (Function) Zero ALU ALU result e.g add = RegWrite -bit Arithmetic and Logic Unit (ALU) Register File: a. Registers b. ALU Zero = Zero flag = When ALU result equals zero Contains all ISA registers. Two read ports and one write port. Register writes by asserting write control signal Clocking Methodology: Writes are edge-triggered. Thus can read and write to the same register in the same clock cycle. 4 th Edition Figure 4.7, page 3-3 rd Edition Figure 5.7, page Basics of logic design/logic building blocks review in Appendix C in Book CD (4 th Edition Appendix B) EECC55 - Shaaban #8 Lec # 4 Winter

19 Register File Details Register File consists of registers: Two -bit output busses: busa and busb One -bit input bus: busw Register is selected by: Write Enable Write Data busw Clk RW RA RB bit Registers RA (number) selects the register to put on busa (data): busa = R[RA] RB (number) selects the register to put on busb (data): busb = R[RB] RW (number) selects the register to be written via busw (data) when Write Enable is Write Enable: R[RW] busw Clock input (CLK) The CLK input is a factor ONLY during write operations. During read operation, it behaves as a combinational logic block: RA or RB valid => busa or busb valid after access time. busa busb EECC55 - Shaaban #9 Lec # 4 Winter

20 Write Port Write Register RW 5 rd? rt? A Possible Register File Implementation 5-to- Decoder Register Write Enable (RegWrite) 3 3. Register Write Data (Bus W) Clock input to registers not shown in diagram Write Data In Write Data In Write Data In Write Data In Write Enable busw Clk. Register Register. Register 3 Register 3 RW RA bit Registers Data Out Data Out Data Out Data Out Also see Appendix C in Book CD (3 rd Edition Appendix B) - The Basics of Logic Design Each Register contains edge triggered D-Flip Flops RB busa busb to- MUX 3 3 EECC55 - Shaaban 5 Register (RA) rs -to- MUX 3 3 #2 Lec # 4 Winter Register 2 (RB) rt 2 Ports R[rs] Register Data (Bus A) R[rt] Register Data 2 (Bus B)

21 Idealized Memory Write Enable Address Data In DataOut Memory (idealized) One input bus: Data In. Clk One output bus: Data Out. Memory word is selected by: Enable Address selects the word to put on Data Out bus. Write Enable = : address selects the memory word to be written via the Data In bus. Clock input (CLK): The CLK input is a factor ONLY during write operation, During read operation, this memory behaves as a combinational logic block: Address valid => Data Out valid after access time. Ideal Memory = Short access time. EECC55 - Shaaban Compared to other components in CPU datapath #2 Lec # 4 Winter

22 Clocking Methodology Used: Edge Triggered Writes Clk Setup Hold Don t Care Setup Hold CLK-to-Q CLK-to-Q Clock Critical Path (Longest delay path) All storage element (e.g Flip-Flops, Registers, Data Memory) writes are triggered by the same clock edge. Cycle Time = CLK-to-Q + Longest Delay Path + Setup + Clock Skew Clock Here writes are triggered on the rising edge of the clock EECC55 - Shaaban #22 Lec # 4 Winter

23 Simplified Datapath For MIPS R-Type Instructions From Instruction Memory [25:2] [2:6] Instruction [5:] rs rt rd register register 2 Registers Write register Write data RegWrite data data 2 R[rs] R[rt] 4 3 ALU ALU operation (Function) Zero ALU result e.g add = Components and connections as specified by RTN statement Clock input to register bank not shown R[rd] Destination register R[rd] write or update is edge triggered at the end of the cycle R[rs] + R[rt] i.e Funct = function =add EECC55 - Shaaban #23 Lec # 4 Winter

24 More Detailed Datapath For R-Type R Instructions With Control Points Identified RegWr busw Clk Rd Rs Rw Ra Rb -bit Registers Rt busa busb R[rs] R[rt] ALUctr 4 ALU Function =Add, Subtract Result R[rd] R[rs] + R[rt] i.e Funct = function =add EECC55 - Shaaban #24 Lec # 4 Winter

25 Clk PC Old Value Rs, Rt, Rd, Op, Func ALUctr RegWr busa, B busw busw Clk RegWr R-Type Register-Register Timing Rd Rs Rt Rw Ra Rb -bit Registers Clk-to-Q New Value Old Value Old Value Old Value Old Value Old Value Instruction Memory Access Time New Value busa busb R[rs] R[rt] Delay through Control Logic New Value ALUct r ALU New Value Register File Access Time New Value ALU Delay New Value Result PC+4 Register Write Occurs Here All register writes occur on falling edge of clock (clocking methodology) EECC55 - Shaaban #25 Lec # 4 Winter

26 Logical Operations with Immediate Example: Micro-Operation Sequence For ORI ori rt, rs, imm op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] Instruction Word Mem[PC] Fetch the instruction PC PC + 4 Increment PC Common Steps R[rt] R[rs] OR ZeroExt[imm6] Done by Main ALU.. Not in book version OR register rs with immediate field zero extended to bits, result in register rt Imm6 EECC55 - Shaaban #26 Lec # 4 Winter

27 Datapath For Logical Instructions With Immediate RegDst busw Clk Rd Mux Rs Rt RegWr imm6 Rt Rw Ra Rb -bit Registers 6 2x MUX (width 5 bits) busb ZeroExt busa R[rt] Mux R[rs] ALUSrc ALUctr ALU Result 2x MUX (width bits) Function = OR R[rt] R[rs] OR ZeroExt[imm6].. Imm6 EECC55 - Shaaban #27 Lec # 4 Winter

28 Load Operations Example: Micro-Operation Sequence For LW 35 3 Instruction Word Mem[PC] Fetch the instruction PC PC op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits R[rt] Mem[R[rs] + SignExt[imm6]] Data Memory lw rt, rs, imm6 [3:26] [25:2] [2:6] [5:] Instruction Memory Effective Address To load from Increment PC Immediate field sign extended to bits and added to register rs to form memory load address, write word at load effective address to register rt Signed Address offset in bytes Common Steps EECC55 - Shaaban #28 Lec # 4 Winter

29 Additional Datapath Components For 4 th Edition Figure 4.8, page 3 3 rd Edition Figure 5.8, page 296 Loads & Stores MemWrite Address Write data data Dat a memory Mem 6 Sig n extend For SignExt[imm6] a. Data memory unit Inputs: for address and write (store) data Output for read (load) data Data memory write or update is edge triggered at the end of the cycle (clocking methodology) b. Sign-extension unit 6-bit input sign-extended into a -bit value at the output EECC55 - Shaaban #29 Lec # 4 Winter

30 Datapath For Loads LW RegDst busw Clk Rd RegWr Mux imm6 Rt Rs Rw Ra Rb -bit Registers 6 busb Extender Base Address register R[rs] busa R[rt] Offset Mux ALUSrc ALUctr ALU Data In Clk Function = add Effective Address MemWr WrEn Adr Data Memory MemtoReg Mux ExtOp MemRd R[rt] Mem[R[rs] + SignExt[imm6]] Data Memory Effective Address EECC55 - Shaaban #3 Lec # 4 Winter

31 Store Operations Example: Micro-Operation Sequence For SW sw rt, rs, imm6 2 6 op rs rt Immediate (imm6) 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] Signed Address offset in bytes Instruction Word Mem[PC] Fetch the instruction PC PC + 4 Increment PC Common Steps Mem[R[rs] + SignExt[imm6]] R[rt] Effective Address Data Memory To store at Immediate field sign extended to bits and added to register rs to form memory store effective address, register rt written to memory at store effective address. EECC55 - Shaaban #3 Lec # 4 Winter

32 Datapath For Stores SW RegDst busw Clk Rd RegWr Mux imm6 Rt 5 5 Rs 5 Rw Ra Rb -bit Registers 6 Rt busb Extender Base Address register R[rs] busa R[rt] Offset Add = Mux ALUctr R[rt] Data In ALU Effective Address Clk MemWr WrEn Adr Data Memory MemtoReg Mux ExtOp ALUSrc MemRd Mem[R[rs] + SignExt[imm6]] R[rt] Data Memory Effective Address EECC55 - Shaaban # Lec # 4 Winter

33 Conditional Branch Example: Micro-Operation Sequence For BEQ 4 3 Instruction Word Mem[PC] Fetch the instruction PC PC beq rs, rt, imm6 2 op rs rt immediate 6 bits 5 bits 5 bits 6 bits [3:26] [25:2] [2:6] [5:] 6 Increment PC PC Offset in words Common Steps Zero R[rs] - R[rt] Condition Action Zero : PC PC + ( SignExt(imm6) x 4 ) Zero is zero flag of main ALU Branch Target Calculate the branch condition R[rs] == R[rt] (i.e R[rs] - R[rt] = ) Calculate the next instruction s PC address Then Zero = EECC55 - Shaaban #33 Lec # 4 Winter

34 Main ALU evaluates branch condition New adder to compute branch target: Sum of incremented PC and sign-extended lower 6-bits on the instruction. [25:2] rs Instruction [2:6] rt register register 2 Write register Write data [5:] imm6 RegWrite PC+4 from instruction datapath ISA Regist ers data data 2 SignExt(imm6) x 4 Sh if t lef t 2 6 Sig n extend SignExt(imm6) Datapath For Branch Instructions R[rs] R[rt] Add Sum 4 ALU operation ALU Zero (Main ALU) Branch target New -bit Adder (Third ALU) for Branch Target PC ( SignExt(imm6) x 4 = Subtract To branch control logic Zero flag = if R[rs] - R[rt] = (i.e R[rs] = R[rt]) Zero R[rs] - R[rt] Main ALU Evaluates Branch Condition (subtract) 4 th Edition Figure 4.9, page 32-3 rd Edition Figure 5.9, page 297 EECC55 - Shaaban #34 Lec # 4 Winter

35 More Detailed Datapath For Branch Operations Branch Zero Instruction Address Zero 4 imm6 PC Ext Adder PC+4 Adder Mux Branch Target PC Clk PC busw Clk RegWr Rs Rw Ra Rb -bit Registers Rt busa busb R[rs] R[rt] Equal? Main ALU (subtract) Zero R[rs] - R[rt] Sign extend shift left 2 Branch Target ALU New Third ALU (adder) New 2X -bit MUX to select next PC value EECC55 - Shaaban #35 Lec # 4 Winter

36 Combining The Datapaths For Memory Instructions and R-Type R Instructions [25:2] rs 4 [2:6] rt R[rs] R[rt] R[rt] rt/rd MUX not shown [5:] imm6 SignExt(imm6) Highlighted muliplexors and connections added to combine the datapaths of memory and R-Type instructions into one datapath This is book version ORI not supported 4 th Edition Figure 4. Page 34-3 rd Edition Figure 5. Page 299 EECC55 - Shaaban #36 Lec # 4 Winter

37 Instruction Fetch Datapath Added to ALU R-Type R and Memory Instructions Datapath PC+ 4 PC Combination of Figure 4. (p. 34) and Figure 4.6 (p. 39) [3 rd Edition Figure 5. (p. 299) and Figure 5.6 (p. 293)] Add 4 PC address rt Instruction Inst ruct ion memory rs rt/rd MUX not shown register register 2 Write register Write data RegWrite data data 2 Re gist e r s 6 Sig n extend R[rs] ALUSrc R[rt] M u x 4 ALU operation Zero ALU ALU result R[rt] Write data MemWrite Address data Dat a memory Mem MemtoReg M u x This is book version ORI not supported, no zero extend of immediate needed EECC55 - Shaaban #37 Lec # 4 Winter

38 A Simple Datapath For The MIPS Architecture Datapath of branches and a program counter multiplexor are added. Resulting datapath can execute in a single cycle the basic MIPS instruction: - load/store word - ALU operations - Branches Zero PC +4 Branch Branch Target rs rt R[rs] 4 R[rt] rt/rd MUX not shown This is book version ORI not supported, no zero extend of immediate needed 4 th Edition Figure 4. page 35-3 rd Edition Figure 5. page 3 EECC55 - Shaaban #38 Lec # 4 Winter

39 Main ALU Control The main ALU has four control lines (detailed design in Appendix B) with the following functions: 4 th Edition ALU Control Lines ALU Function Appendix C AND OR add subtract Set-on-less-than NOR Not Used 3 rd Edition For our current subset of MIPS instructions only the top five functions will be used (thus only three control lines will be used) For R-type instruction the ALU function depends on both the opcode and the 6-bit funct function field For other instructions the ALU function depends on the opcode only. A local ALU control unit can be designed to accept 2-bit ALUop control lines (from main control unit) and the 6-bit function field and generate the correct 4-bit ALU control lines. Or 3 bits depending on number functions actually used EECC55 - Shaaban #39 Lec # 4 Winter

40 Local ALU Decoding of func Field Opcode op 6 Main Control Add = func 6 ALUop 2 Subtract = ALU Control (Local) ALUctr 4 Or 3 bits ALU Instruction Opcode Instruction Operation ALUOp Funct Field Desired ALU Action ALU Control Lines LW SW Branch Equal R-Type R-Type R-Type R-Type R-Type Load word Store word branch equal add subtract AND OR set on less than XXXXXX XXXXXX XXXXXX add add subtract add subtract and or set on less than R-Type = EECC55 - Shaaban #4 Lec # 4 Winter

41 Local ALU Control Unit Add = Subtract = R-type ={ Add Subtract Add Subtract AND OR Set-On-less-Than 2 (2 lines From main control unit) Page 32 Function Field 3 ALU Control Lines 4 th line = More details found in Appendix D in Book CD (3 rd Edition Appendix C) EECC55 - Shaaban #4 Lec # 4 Winter

42 Single Cycle MIPS Datapath Necessary multiplexors and control lines are identified here and local ALU control added: PC 4 address Add register ALUSrc register 2 Zero rt [3:] R[rt] ALU ALU Instruction Instruction memory Instruction [25:2] rs Instruction [2:6] Instruction [5:] rd Instruction [5:] imm6 M ux RegDst PC +4 Write register Write data RegWrite data data 2 Registers 6 Sign extend Function Field Instruction [5:] Shift left 2 R[rs] M u x ALU control ALUOp Add ALU result result PC +4 R[rt] PCSrc M ux Branch Target MemWrite Address Write data Data memory Mem data MemtoReg M u x Zero Branch ALUOp (2-bits) = add = subtract = R-Type This is book version ORI not supported, no zero extend of immediate needed 4 th Edition Figure 4.5 page - 3 rd Edition Figure 5.5 page 35 EECC55 - Shaaban #42 Lec # 4 Winter

43 imm6 Putting It All Together: A Single Cycle Datapath Branch Zero 4 PC Ext PC+4 Adder Adder PCSrc Mux Branch Target Clk Inst Memory PC Adr RegDst RegWr busw Clk Rs imm6 <2:25> Rd Rt 5 5 Rt Rs 5 Rw Ra Rb -bit Registers 6 <6:2> Rd <:5> Rt busa busb Extender <:5> Imm6 R[rt] Zero R[rs] Mux Instruction<3:> Function Field ALUop (2-bits) ALU Control = ALU Main ALU = add = subtract = R-Type MemWr WrEn Adr Data In Data Memory Clk MemtoReg Mux e.g Sign Extend + Shift Left 2 (Includes ORI not in book version) ExtOp ALUSrc MemRd EECC55 - Shaaban #43 Lec # 4 Winter

44 Instruction Memory Adr Instruction<3:> <:5> <:5> <6:2> <2:25> <2:25> <:25> Op Fun Rt Rs Rd Imm6 Jump_target Control Unit Control Lines RegDst ALUSrc MemtoReg RegWrite Mem Mem Write Branch ALOp (2-bits) DATA PATH EECC55 - Shaaban #44 Lec # 4 Winter

45 Signal Name RegDst The Effect of The Control Signals Effect when deasserted (=) The register destination number for the write register comes from the rt field (instruction bits 2:6). Effect when asserted (=) The register destination number for the write register comes from the rd field (instruction bits 5:). RegWrite ALUSrc Branch (BEQ) Mem MemWrite MemtoReg None The second main ALU operand comes from the second register file output ( data 2) R[rt] The PC is replaced by the output of the adder that computes PC + 4 None None The value fed to the register write data input comes from the main ALU. The register on the write register input is written with the value on the Write data input. The second main ALU operand is the sign-extended lower 6 bits on the instruction (imm6) If Zero = The PC is replaced by the output of the adder that computes the branch target. Data memory contents designated by the address input are put on the data output. Data memory contents designated by the address input are replaced by the value on the Write data input. The value fed to the register write data input comes from data memory. EECC55 - Shaaban #45 Lec # 4 Winter

46 Control Line Settings Control Lines Instruction RegDst ALUSrc Memto- Reg Reg Write Mem Mem Write Branch ALUOp ALUOp R-Format lw sw X X beq X X 4 th Edition Figure 4.8 page 3 3 rd Edition Figure 5.8 page 38 ALUOp (2-bits) = add = subtract = R-Type EECC55 - Shaaban #46 Lec # 4 Winter

47 The Truth Table For The Main Control (Opcode) Similar to Figure 4.22 Page 7 (3 rd Edition Figure 5.22 Page 32) EECC55 - Shaaban #47 Lec # 4 Winter

48 PLA Implementation of the Main Control Control Lines To Datapath Figure D.2.5 in Appendix D (3 rd Edition Figure C.2.5 in Appendix C) PLA = Programmable Logic Array - Appendix C (3 rd Edition Appendix B) EECC55 - Shaaban #48 Lec # 4 Winter

49 Single Cycle MIPS Datapath Control Unit Added PC 4 Add Instruction [3 26] 6 Sign extend Shift left 2 Add ALU result Instruction [25 2] register address R[rs] Instruction [2 6] rt data register 2 Zero Instruction R[rt] [3 ] ALU M Write ALU register data 2 result Instruction u Instruction [5 ] M memory x u rd Write x data Registers Instruction [5 ] 4 th Edition Figure 4.2, page 6 3 rd Edition Figure 5.7, page 37 PC +4 Opcode imm6 Control RegDst Branch Mem MemtoReg ALUOp MemWrite ALUSrc RegWrite Function Field Instruction [5 ] In this book version, ORI is not supported no zero extend of immediate needed. rs PC +4 ALU control PC +4 Branch Target Write data ALUOp (2-bits) = add = subtract = R-Type M u x Address data Data memory M u x EECC55 - Shaaban #49 Lec # 4 Winter

50 Adding Support For Jump: Micro-Operation Sequence For Jump: J j jump_target OP Jump_target 2 Instruction Word Mem[PC] Fetch the instruction PC PC bits 26 bits [3:26] [25:] Increment PC Jump address in words PC PC(3-28),jump_target, Update PC with jump address Common Steps Jump Address PC(3-28) jump target 4 bits 26 bits 2 bits 4 highest bits from PC + 4 EECC55 - Shaaban #5 Lec # 4 Winter

51 Datapath For Jump Branch Zero Next Instruction Address 4 Adder PC+4 PCSrc JUMP Instruction(5-) Instruction(25-) jump_target imm6 e.g Sign Extend + Shift Left 2 26 PC Ext Shift left 2 Adder 4 Branch Target 28 Mux PC+4(3-28) Mux Jump Address PC Clk PC PC(3-28),jump_target, Jump Address PC(3-28) jump target 4 bits 26 bits 2 bits EECC55 - Shaaban #5 Lec # 4 Winter

52 Single Cycle MIPS Datapath Extended To Handle Jump with Control Unit Added 4 Add Instruction [25 ] Shift left 2 Jump address [3 ] PC +4 PC + 4 [3 28] 4 PC +4 Add ALU result PC +4 Branch Target M u x M u x Opcode Instruction [3 26] Control RegDst Jump Branch Mem MemtoReg ALUOp MemWrite ALUSrc RegWrite Shift left 2 PC address Instruction [3 ] Instruction memory Instruction [25 2] Instruction [2 6] Instruction [5 ] Instruction [5 ] imm6 4 th Edition Figure 4.24 page 9 3 rd Edition Figure 5.24 page 34 M u x register register 2 Write register Write data data data 2 Registers 6 Sign extend Function Field Instruction [5 ] R[rt] In this book version, ORI is not supported no zero extend of immediate needed. rd rs rt R[rs] M u x ALU control ALU Zero ALU result R[rt] Address Write data ALUOp (2-bits) = add = subtract = R-Type Data memory data M u x EECC55 - Shaaban #52 Lec # 4 Winter

53 Control Line Settings (with jump instruction, j added) Instruction RegDst ALUSrc Memto- Reg Reg Write Mem Mem Write Branch ALUOp ALUOp Jump R-Format lw sw X X beq X X j X X X X X X Figure 4.8 page 3 (3 rd Edition Figure 5.8 page 38) modified to include j EECC55 - Shaaban #53 Lec # 4 Winter

54 Clk PC Old Value Rs, Rt, Rd, Op, Func ALUctr Worst Case Timing (Load) Clk-to-Q New Value Old Value Old Value Instruction Memoey Access Time New Value Delay through Control Logic New Value ExtOp Old Value New Value ALUSrc Old Value New Value MemtoReg Old Value New Value RegWr Old Value New Value busa busb Old Value Delay through Extender & Mux Old Value Register Write Occurs Register File Access Time New Value New Value ALU Delay Address Old Value New Value Data Memory Access Time busw Old Value New EECC55 - Shaaban #54 Lec # 4 Winter

55 Instruction Timing Comparison 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 PC Inst Memory Reg File mux ALU Data Mem Branch PC Inst Memory Reg File cmp mux Jump PC Inst Memory mux EECC55 - Shaaban #55 Lec # 4 Winter

56 Simplified Single Cycle Datapath Timing Assuming the following datapath/control hardware components delays: Memory Units: 2 ns ALU and adders: 2 ns Register File: ns Control Unit < ns Ignoring Mux and clk-to-q delays, critical path analysis: ns Control Unit } Obtained from low-level target VLSI implementation technology of components 2 ns 2 ns 2 ns Instruction Memory Register Main ALU Data Memory ns Register Write PC + 4 ALU Critical Path Branch Target ALU (Load) Critical Path = 8 ns (LW) 2 ns Time 2ns 3ns 4ns 5ns 7ns 8ns ns = nanosecond = -9 second EECC55 - Shaaban #56 Lec # 4 Winter

57 Performance of Single-Cycle (CPI=) CPU Assuming the following datapath hardware components delays: Memory Units: 2 ns ALU and adders: 2 ns Register File: ns The delays needed for each instruction type can be found : Nanosecond, ns = -9 second Instruction Instruction Register ALU Class Memory Operation Data Register Total Memory Write Delay ALU 2 ns ns 2 ns ns 6 ns Load 2 ns ns 2 ns 2 ns ns 8 ns Store 2 ns ns 2 ns 2 ns 7 ns Branch 2 ns ns 2 ns 5 ns Jump 2 ns 2 ns Load has longest delay of 8 ns thus determining the clock cycle of the CPU to be 8ns C = 8 ns The clock cycle is determined by the instruction with longest delay: The load in this case which is 8 ns. Clock rate = / 8 ns = 25 MHz A program with I =,, instructions executed takes: Execution Time = T = I x CPI x C = 6 x x 8x -9 =.8 s = 8 msec T = I x CPI x C EECC55 - Shaaban #57 Lec # 4 Winter

58 Adding Support for jal to Single Cycle Datapath The MIPS jump and link instruction, jal is used to support procedure calls by jumping to jump address (similar to j ) and saving the address of the following instruction PC+4 in register $ra ($3) i.e. Return Address jal Address R[3] PC + 4 jal uses the j instruction format: PC Jump Address op (6 bits) Target address (26 bits) We wish to add jal to the single cycle datapath in Figure 4.24 page 9 (3 rd Edition Figure 5.24 page 34). Add any necessary datapaths and control signals to the single-clock datapath and justify the need for the modifications, if any. Specify control line values for this instruction. EECC55 - Shaaban #58 Lec # 4 Winter

59 jump and link, jal support to Single Cycle Datapath Instruction Word R[3] PC + 4 PC Jump Address Mem[PC] Jump Address PC + 4 PC + 4 Branch Target PC rd rs rt R[rt] R[rs] 2 imm6. Expand the multiplexor controlled by RegDst to include the value 3 as a new input Expand the multiplexor controlled by MemtoReg to have PC+4 as new input 2. EECC55 - Shaaban #59 Lec # 4 Winter

60 jump and link, jal support to Single Cycle Datapath Adding Control Lines Settings for jal (For Textbook Single Cycle Datapath including Jump) RegDst Is now 2 bits MemtoReg Is now 2 bits Memto- Reg Mem Mem RegDst ALUSrc Reg Write Write Branch ALUOp ALUOp Jump R-format lw sw xx xx beq xx xx J xx x xx x x x JAL x x x x R[3] PC+ 4 Instruction Word R[3] PC + 4 PC Jump Address Mem[PC] PC Jump Address EECC55 - Shaaban #6 Lec # 4 Winter

61 Load Word Register Adding Support for LWR to Single Cycle Datapath We wish to add a variant of lw (load word) let s call it LWR to the single cycle datapath in Figure 4.24 page 9 (3 rd Edition Figure 5.24 page 34). LWR $rd, $rs, $rt The LWR instruction is similar to lw but it sums two registers (specified by $rs, $rt) to obtain the effective load address and uses the R-Type format Loaded word from memory written to register rd Add any necessary datapaths and control signals to the single cycle datapath and justify the need for the modifications, if any. Specify control line values for this instruction. EECC55 - Shaaban #6 Lec # 4 Winter

62 LWR (R-format LW) support to Single Cycle Datapath Instruction Word Mem[PC] PC PC + 4 R[rd] Mem[ R[rs] + R[rt] ] No new components or connections are needed for the datapath just the proper control line settings Adding Control Lines Settings for LWR (For Textbook Single Cycle Datapath including Jump) Memto- Reg Mem Mem RegDst ALUSrc Reg Write Write Branch ALUOp ALUOp Jump R-format lw sw x x beq x x J x x x x x x LWR rd R[rt] Add EECC55 - Shaaban #62 Lec # 4 Winter

63 Jump Memory Adding Support for jm to Single Cycle Datapath We wish to add a new instruction jm (jump memory) to the single cycle datapath in Figure 4.24 page 9 (3 rd Edition Figure 5.24 page 34). jm offset($rs) The jm instruction loads a word from effective address (R[rs] + offset), this is similar to lw except the loaded word is put in the PC instead of register $rt. Jm used the I-format with field rt not used. OP rs rt address (imm6) 6 bits 5 bits 5 bits 6 bits Not Used Add any necessary datapaths and control signals to the single cycle datapath and justify the need for the modifications, if any. Specify control line values for this instruction. EECC55 - Shaaban #63 Lec # 4 Winter

64 Adding jump memory, jm support to Single Cycle Datapath Instruction Word Mem[PC] PC Mem[R[rs] + SignExt[imm6]]. Expand the multiplexor controlled by Jump to include the Data (data memory output) as new input 2. The Jump control signal is now 2 bits Jump 2 2 Jump PC + 4 Branch Target 2 rs rt R[rt] R[rs] rd imm6 EECC55 - Shaaban #64 Lec # 4 Winter

65 Adding jm support to Single Cycle Datapath Adding Control Lines Settings for jm (For Textbook Single Cycle Datapath including Jump) Jump is now 2 bits Memto- Reg Mem Mem RegDst ALUSrc Reg Write Write Branch ALUOp ALUOp Jump R-format lw sw x x beq x x J x x x x x x Jm x x x add PC Mem[R[rs] + SignExt[imm6]] EECC55 - Shaaban #65 Lec # 4 Winter

66 Drawbacks of Single Cycle Processor. Long cycle time: All instructions must take as much time as the slowest Here, cycle time for load is longer than needed for all other instructions. Cycle time must be long enough for the load instruction: PC s Clock -to-q + Instruction Memory Access Time + Register File Access Time + ALU Delay (address calculation) + Data Memory Access Time + Register File Setup Time + Clock Skew Real memory is not as well-behaved as idealized memory Cannot always complete data access in one (short) cycle. 2. Impossible to implement complex, variable-length instructions and complex addressing modes in a single cycle. e.g indirect memory addressing. e.g R[$] Mem[ Mem[$2] ] 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. Does not allow overlap of instruction processing (instruction pipelining, chapter 6). EECC55 - Shaaban #66 Lec # 4 Winter

Major CPU Design Steps

Major CPU Design Steps 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

How to design a controller to produce signals to control the datapath

How to design a controller to produce signals to control the datapath ECE48 Computer Organization and Architecture Designing Single Cycle How to design a controller to produce signals to control the datapath ECE48. 2--7 Recap: The MIPS Formats All MIPS instructions are bits

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

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

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

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

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

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

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

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

CS61C : Machine Structures

CS61C : Machine Structures CS 61C L path (1) insteecsberkeleyedu/~cs61c/su6 CS61C : Machine Structures Lecture # path natomy: 5 components of any Computer Personal Computer -7-25 This week Computer Processor ( brain ) path ( brawn

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

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

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

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I Name: University of California College of Engineering Computer Science Division -EECS Fall 996 D.E. Culler CS 52 Midterm I Your Name: ID Number: Discussion Section: You may bring one double-sided pages

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

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

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

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

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

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

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

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

CS 61C: Great Ideas in Computer Architecture Lecture 12: Single- Cycle CPU, Datapath & Control Part 2

CS 61C: Great Ideas in Computer Architecture Lecture 12: Single- Cycle CPU, Datapath & Control Part 2 CS 6C: Great Ideas in Computer Architecture Lecture 2: Single- Cycle CPU, Datapath & Control Part 2 Instructor: Sagar Karandikar sagark@eecs.berkeley.edu hbp://inst.eecs.berkeley.edu/~cs6c Midterm Results

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

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

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

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

Midterm I March 3, 1999 CS152 Computer Architecture and Engineering

Midterm I March 3, 1999 CS152 Computer Architecture and Engineering University of California, Berkeley College of Engineering Computer Science Division EECS Spring 1999 John Kubiatowicz Midterm I March 3, 1999 CS152 Computer Architecture and Engineering Your Name: SID

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

LECTURE 5. Single-Cycle Datapath and Control

LECTURE 5. Single-Cycle Datapath and Control LECTURE 5 Single-Cycle Datapath and Control PROCESSORS In lecture 1, we reminded ourselves that the datapath and control are the two components that come together to be collectively known as the processor.

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

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

CPE 335 Computer Organization. Basic MIPS Architecture Part I

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

More information

CS3350B Computer Architecture Quiz 3 March 15, 2018

CS3350B Computer Architecture Quiz 3 March 15, 2018 CS3350B Computer Architecture Quiz 3 March 15, 2018 Student ID number: Student Last Name: Question 1.1 1.2 1.3 2.1 2.2 2.3 Total Marks The quiz consists of two exercises. The expected duration is 30 minutes.

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

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

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

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 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 14: One Cycle MIPs Datapath Adapted from Computer Organization and Design, Patterson & Hennessy, UCB R-Format Instructions Read two register operands Perform

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

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor. COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor The Processor - Introduction

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

Instructor: Randy H. Katz hcp://inst.eecs.berkeley.edu/~cs61c/fa13. Fall Lecture #18. Warehouse Scale Computer

Instructor: Randy H. Katz hcp://inst.eecs.berkeley.edu/~cs61c/fa13. Fall Lecture #18. Warehouse Scale Computer /29/3 CS 6C: Great Ideas in Computer Architecture Building Blocks for Datapaths Instructor: Randy H. Katz hcp://inst.eecs.berkeley.edu/~cs6c/fa3 /27/3 Fall 23 - - Lecture #8 So5ware Parallel Requests Assigned

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

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

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

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

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

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

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

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

Single Cycle Datapath

Single Cycle Datapath Single Cycle atapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili Section 4.1-4.4 Appendices B.3, B.7, B.8, B.11,.2 ing Note: Appendices A-E in the hardcopy text correspond to chapters 7-11 in

More information

CSEN 601: Computer System Architecture Summer 2014

CSEN 601: Computer System Architecture Summer 2014 CSEN 601: Computer System Architecture Summer 2014 Practice Assignment 5 Solutions Exercise 5-1: (Midterm Spring 2013) a. What are the values of the control signals (except ALUOp) for each of the following

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

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

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

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141 EECS 151/251A Fall 2017 Digital Design and Integrated Circuits Instructor: John Wawrzynek and Nicholas Weaver Lecture 13 Project Introduction You will design and optimize a RISC-V processor Phase 1: Design

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

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

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

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

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

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 19 CPU Design: The Single-Cycle II & Control !

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 19 CPU Design: The Single-Cycle II & Control ! inst.eecs.berkeley.edu/~cs6c CS6C : Machine Structures Lecture 9 CPU Design: The Single-Cycle II & Control 2-7-22!!!Instructor Paul Pearce! Dell may have shipped infected motherboards! Dell is warning

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

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

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath The MIPS Datapath 1 The Critical Path and Circuit Timing The critical path is the slowest path through the circuit For a synchronous circuit, the clock cycle must be longer than the critical path otherwise

More information

Final Exam Spring 2017

Final Exam Spring 2017 COE 3 / ICS 233 Computer Organization Final Exam Spring 27 Friday, May 9, 27 7:3 AM Computer Engineering Department College of Computer Sciences & Engineering King Fahd University of Petroleum & Minerals

More information