{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
Image of page 1

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

View Full Document Right 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
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 x is a positive float
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern