Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CS 3340 Computer Architecture Practice Exam 1 Chapter 2 Questions 1. Write the f

ID: 3887112 • Letter: C

Question

CS 3340 Computer Architecture Practice Exam 1 Chapter 2 Questions 1. Write the following C code in MIPS assembler: x=x+y+z-q; Assume that x, y, z, q are stored in registers Ss1-Ss4. 2. Describe the difference between carry and overflow. For each of the following, state if it is a carry, an overflow, or neither (a) 1011 0111 (unsigned) (b) 00010 (unsigned) (c) 011 0010 (signed) (d) 1000+0111 (signed) 3. Convert the C function below to a MIPS assembly language subroutine. Then write code that calls the subroutine (assuming that n is in $a0) and stores the return

Explanation / Answer

!.ANSWER

void fun()
{
int x=10,y=10,z=10,q=10;
x=x+y+z-q;
}

MIPS CODE

3.Answer

MIPS Code