Fall 2011-2012InitialsCSSE 232CSSE 232 – Computer Architecture IRose-Hulman Institute of TechnologyComputer Science and Software Engineering DepartmentExam 1Name:Section:123This exam isclosed book. You are allowed to use the reference card from the book. Youmay not use a computer, calculator, pda, etc. during the examination, except you may usea calculatoronlyfor the last question.Write all answers on these pages — use the back if necessary. Be sure toshow all workand document your code. Do not use instructions that we have not covered (e.g. nomultordivbut you can usesll,srl).MIPScode is judged both by its correctness and its efficiency. You may useMIPSpseu-doinstructions when writingMIPScode. However, the length of your instruction sequenceis judged by the actual instructions to which the sequence expands.All numbers are expressed in decimal unless specifically stated otherwise.You are encouraged to read the entire exam before beginning.Points availableYour marks116212316420518618Total1004 January 2012Page 1
Fall 2011-2012InitialsCSSE 232Problem 1(16 points) Consider the followingMIPSassembly code with partial machine languagetranslation to the right.Loop:addi$t0, $t0, 4# 0x2108????lw$t1, V($t0)# 0x8d09????beq$t1, $t3, Loop# 0x112b????This code is loaded at address0x0040 0000, V is at address0x0000 7FF0, and theinitial value of $t0 is 0.(a) (6 points) Fill in the missing immediate values in the instructions above.(b) (5 points) How would you change the code if the branch instruction needed tobranch to address0x0060 0000?(c) (5 points) How would your answer to part 1b change if the branch instructionneeded to branch to address0x1060 0000?