mid_prac - CS 232 Practice Exam 1 Spring 2010 CS 232...

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

View Full Document Right Arrow Icon
CS 232 Practice Exam 1 Spring 2010 CS 232 Practice Exam I Viraj Kumar February 24, 2010 Time: 60 minutes Name: Instructions: 1. This is a closed-book examination. You are allowed one double-sided cheat-sheet (handwritten or typed with any font size). 2. The exam has FOUR questions. Please budget your time. Problem No. Max. Points Your score 1 20 2 30 3 30 4 20 Total 100 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 232 Practice Exam 1 Spring 2010 1. Bitwise operations (20 points) : Assume that two out of the three registers $ a0 , $ a1 , $ a2 have identical values and the third register has a different value. The following MIPS function returns the value that is different: different: # arguments in $a0, $a1, $a2 beq $a0, $a1, its_a2 beq $a0, $a2, its_a1 move $v0, $a0 jr $ra its_a1: move $v0, $a1 jr $ra its_a2: move $v0, $a2 jr $ra Question : Rewrite the above function to solve this problem without using branches . 2
Background image of page 2
CS 232 Practice Exam 1 Spring 2010 2. C++ to MIPS (30 points) : Translate the following C++ function into MIPS. Assume that
Background image of page 3

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

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

This note was uploaded on 03/04/2010 for the course CS 373 taught by Professor Kuma during the Spring '10 term at University of Illinois at Urbana–Champaign.

Page1 / 5

mid_prac - CS 232 Practice Exam 1 Spring 2010 CS 232...

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

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