{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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

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

View Full Document
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
CS 232 Practice Exam 1 Spring 2010 2. C++ to MIPS (30 points) : Translate the following C++ function into MIPS. Assume that x is a positive float

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern