Lec06 - 1 Animation Sequence for lw Step 1: Fetch...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Animation Sequence for lw Step 1: Fetch Instruction word address data Step 2: Compute address Step 3: Read data from memory Step 4: Write to register Data Register # Register # Register # PC Address Instruction Instruction memory Registers ALU Address Data Data memory Add Add 4 2 Datapath for Instruction Fetch Instruction MEM[PC] PC PC + 4 RD Memory ADDR PC Instruction 4 ADD 3 Datapath for R-Type Instructions add rd, rs, rt R[rd] R[rs] + R[rt]; 5 5 5 RD1 RD2 RN1 RN2 WN WD RegWrite Register File op rs rt rd funct shamt Operation ALU Zero Instruction 3 4 Datapath for Load Instructions op rs rt offset/immediate 5 5 16 RD1 RD2 RN1 RN2 WN WD RegWrite Register File Operation ALU 3 E X T N D 16 32 Zero RD WD MemRead Memory ADDR MemWrite 5 lw rt, offset(rs) R[rt] MEM[R[rs] + s_extend(offset)]; Why we need an extend component for the datapath? 5 Datapath for Store Instructions op rs rt offset/immediate 5 5 16 RD1 RD2 RN1 RN2 WN WD RegWrite Register File Operation ALU 3 E X T N D 16 32 Zero RD WD MemRead Memory ADDR MemWrite 5 sw rt, offset(rs) MEM[R[rs] + sign_extend(offset)] R[rt] 6 Datapath for Branch Instructions beq rs, rt, offset if (R[rs] == R[rt]) then PC PC+4 + s_extend(offset<<2) op rs rt offset/immediate 5 5 16 RD1 RD2 RN1 RN2 WN WD RegWrite Register File Operation ALU E X T N D 16 32 Zero ADD <<2 PC +4 from instruction datapath 7 Datapath: More Detailed View 8 PC Instruction address Instruction Instruction memory Add Sum a. Instruction memory b. Program counter c. Adder Address Read data Data memory a. Data memory unit Write data MemRead MemWrite b. Sign-extension unit Sign extend 16 32 Simple Implementation Include the functional units we need for each instruction Read register 1 Read register 2 Write register Write Data Registers ALU Data Data Zero ALU result RegWrite a. Registers b. ALU 5 5 5 Register numbers Read data 1 Read data 2 ALU operation 4 ALU control input Function 000 AND 001 OR 010 add 110 subtract 111 set on less than 9 RTL (Register Transfer Level) Code for MIPS add 1. Fetch Instruction = ROM[PC], PC=PC+4 2. Read Operands ALUOp1 = Registers[rs-value], ALUOp2 = Registers[rt-value] 3. Add ALUOut = ALUOp1+ALUOp2 4. Write Result Registers[rd-value] = ALUOut 10...
View Full Document

Page1 / 37

Lec06 - 1 Animation Sequence for lw Step 1: Fetch...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online