prelim2_sp06sol - NETID_ NAME:_ SIGNATURE:_ ECE 314 Prelim...

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

View Full Document Right Arrow Icon
NETID______________________________ Page 1 of 13 NAME:_____________________________ SIGNATURE:________________________ ECE 314 Prelim Exam 2 April 25, 2006 Normal academic integrity rules apply. Show your work (e.g., on the back of the page) in order to receive partial credit.
Background image of page 1

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

View Full DocumentRight Arrow Icon
NETID______________________________ Page 2 of 13 Question Possible Points Points Earned MIPS Datapath 25 Hazards 10 Hazard Elimination 10 Datapath Modification 10 Caches 20 Virtual Memory 25 Total 100
Background image of page 2
NETID______________________________ Page 3 of 13 Q1. MIPS Datapath (25 points) For each of the following MIPS instructions, fill in the control signal values necessary to execute the instruction. Refer to the reference datapath on the last page of the exam to see the function of each control signal. Note any assumptions that you must make about any of the blocks in the reference datapath that are required. If it is not possible to execute an instruction using the reference datapath, state why the instruction cannot be executed. Use X for a don’t care value. (a) addi $rt, $rs, imm # $rt = $rs + sext(imm) Control Signal Value Notes RegDest_ID[1:0] 00 Jump_EX 0 JumpSRC_EX X BranchTaken_EX 0 ShiftSrc_EX[1:0] XX Asrc_EX 1 Bsrc_EX[1:0] 01 DMC_MEM[1:0] 00 Dread_MEM X WBSrc_WB 0 WBenable_WB 1 -1 point for each wrong answer, up to a max of -5 points. If the answer is marked here as X, either 0 or 1 should be considered correct. (b) movz $rd, $rs, $rt # if ($rt= =0) $rd = $rs Control Signal Value Notes RegDest_ID[1:0] Jump_EX JumpSRC_EX BranchTaken_EX ShiftSrc_EX[1:0] Asrc_EX Bsrc_EX[1:0] DMC_MEM[1:0] Dread_MEM WBSrc_WB WBenable_WB Not possible to execute because it is not possible to test if $rt is zero and transfer $rs to $rt at the same time. 3 points for recognizing that it can’t be done 2 points for the explanation
Background image of page 3

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

View Full DocumentRight Arrow Icon
NETID______________________________ Page 4 of 13 (c) beq $rs, $rt, offset # if ($rs = = $rt) then PC = PC+4+sext(offset << 2) Control Signal Value Notes RegDest_ID[1:0] XX Jump_EX 0 JumpSRC_EX X BranchTaken_EX $rs==$t ShiftSrc_EX[1:0] XX Asrc_EX X Bsrc_EX[1:0] XX DMC_MEM[1:0] 00 Dread_MEM X WBSrc_WB X WBenable_WB 0 -1 point for each wrong answer, up to a max of -5 points. If the answer is marked here as X, either 0 or 1 should be considered correct. (d) j addr # PC = { (PC+4)[31:28], addr, 2’b0 } Control Signal Value Notes RegDest_ID[1:0] XX Jump_EX 1 JumpSRC_EX 0 BranchTaken_EX X ShiftSrc_EX[1:0] XX Asrc_EX X Bsrc_EX[1:0] XX DMC_MEM[1:0] 00 Dread_MEM X WBSrc_WB X WBenable_WB 0 -1 point for each wrong answer, up to a max of -5 points. If the answer is marked here as X, either 0 or 1 should be considered correct.
Background image of page 4
NETID______________________________ Page 5 of 13 (e) pref 0, offset($rs) # The prefetch instruction with hint of 0 has same # effect on the cache as lw $rt,offset($rs) # BUT does NOT update $rt Note that you only have to implement the case where the hint is 0, as shown above. Control Signal
Background image of page 5

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

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

This note was uploaded on 04/28/2008 for the course ECE 3140 taught by Professor Mckee/long during the Spring '07 term at Cornell University (Engineering School).

Page1 / 13

prelim2_sp06sol - NETID_ NAME:_ SIGNATURE:_ ECE 314 Prelim...

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

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