The Datapath Andreas Klappenecker CPSC321 Computer Architecture
Administrative Issues WebCT: news, chat, grades Quantum Computing Seminar Chance to make $356 Fair Scholarship in Telecommunications $1000 for five qualified students in Computer Science or Comp. Eng. (CPSC) Computer Science Logo Contest $1000 for best logo
Administrative Issues Talk by David Patterson Friday, October 10, 4:10pm, HRBB 124 Project 0 due October 10 Exam, October 17 Invited Admissions for UGrads
Goal of this lecture Create a single datapath for lw, sw beq (j later) add, sub, and, or, slt Our line of attack We recall datapaths of these operations and compose their datapaths
Instruction Word Formats Register format Immediate format Jump format op-code rs rt rd shamt funct op-code rs rt immediate value op-code 26 bit current segment address
Requirements of the Instruction Set Memory Register file PC Sign extender ALU Add 4 to increase PC
Hardware components
Instruction Fetch + PC update
R-Format Instructions Register format op-code rs rt rd shamt funct
Datapath for a load and store 1. register access 2. memory access calculation 3. read or write from memory 4. in the case of a load, write into register file
Marrying two Datapaths
Datapaths for Instruction Fetch, Memory and R-type Instructions xtend ALU result Zero ALU Address RegWrite ALU operation 3 MemRead MemWrite ALUSrc MemtoReg xtend ALU result Zero ALU Address RegWrite ALU operation 3 MemRead MemWrite ALUSrc MemtoReg xtend ALU result Zero ALU Address RegWrite ALU operation 3 MemRead MemWrite ALUSrc MemtoReg Note the added multiplexor switching between register 2 and sign-extended immediate value
Datapath for a Branch Use ALU to evaluate the branch condition, another adder for branch target = PC (sign extended 16 bits)>>2
Marrying Branches with Rest Output of Sign extend goes where? Output of PC adder goes where?
Datapath for MIPS instructions Seven control signals
ALU Control For load and store instructions Use ALU to compute memory address by addition (add immediate value) For R-type instructions Perform addition, subtraction, and, or, slt value depends on 6bit function field For beq perform subtraction
ALU Control Logic (Recall ALU) ALU cntrlFunction 000and 001or 010add 110subtract 111slt Depending on instruction, the ALU has to perform one of the five operations
Must describe hardware to compute 3-bit ALU control input ALU control bits depend on ALUOp control bits and different functions codes for R-type instructions ALU Control
Datapath for MIPS instructions Note the seven control signals!
Generating Control Signals Opcode field of instruction yields control signals and ALUOp signals
Control
Summary