csse232_exam1 - Fall 2011-2012 Initials CSSE 232 CSSE 232 Computer Architecture I Rose-Hulman Institute of Technology Computer Science and Software

# csse232_exam1 - Fall 2011-2012 Initials CSSE 232 CSSE 232...

• Notes
• 10

This preview shows page 1 - 3 out of 10 pages.

Fall 2011-2012 Initials CSSE 232 CSSE 232 – Computer Architecture I Rose-Hulman Institute of Technology Computer Science and Software Engineering Department Exam 1 Name: Section: 1 2 3 This exam is closed book . You are allowed to use the reference card from the book. You may not use a computer, calculator, pda, etc. during the examination, except you may use a calculator only for the last question. Write all answers on these pages — use the back if necessary. Be sure to show all work and document your code. Do not use instructions that we have not covered (e.g. no mult or div but you can use sll , srl ). MIPS code is judged both by its correctness and its efficiency. You may use MIPS pseu- doinstructions when writing MIPS code. However, the length of your instruction sequence is 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 available Your marks 1 16 2 12 3 16 4 20 5 18 6 18 Total 100 4 January 2012 Page 1
Fall 2011-2012 Initials CSSE 232 Problem 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?