{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Midterm.sp10

# Midterm.sp10 - Name Student ID Signature cs30x CSE 30...

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

1 Name _________________________ Student ID __________________ Signature_______________________ cs30x_______ CSE 30 Spring 2010 Midterm Exam 1. Number Systems ___________________ (15 points) 2. Binary Addition/Condition Code Bits/Overflow Detection ___________________ (12 points) 3. Branching ___________________ (22 points) 4. Bit Operations / C Runtime Environment ___________________ (17 points) 5. Parameter Passing and Return Values (Stack Variables) ___________________ (12 points) 6. Local Variables, The Stack and Return Values ___________________ (16 points) 7. Load/Store/Memory ___________________ (11 points) SubTotal ___________________ (105 points) Extra Credit ___________________ (12 points) Total ___________________

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

View Full Document
2 1. Number Systems Convert 0xFB99 (2’s complement, 16-bit word) to the following. (6 points) binary ____________________________________ (straight base conversion) octal 0 ___________________________________ (straight base conversion) decimal ____________________________________ (convert to signed decimal) Convert -341 to the following (assume 16-bit word). Express answers in hexadecimal. (6 points) sign-magnitude 0x _______________________________________________ 1’s complement 0x _______________________________________________ 2’s complement 0x _______________________________________________ Convert +448 to the following (assume 16-bit word). Express answers in hexadecimal. (3 points) sign-magnitude 0x _______________________________________________ 1’s complement 0x _______________________________________________ 2’s complement 0x _______________________________________________ 2. Binary Addition/Condition Code Bits/Overflow Detection Indicate what the condition code bits are when adding the following 8-bit 2’s complement numbers. (12 points) 11010111 00100001 10000000 +10101001 +01001001 +10000000 --------- --------- --------- N Z V C N Z V C N Z V C ----------------- ----------------- ----------------- | | | | | | | | | | | | | | | ----------------- ----------------- -----------------
3 3. Branching (22 points) Translate the C code below into the equivalent unoptimized SPARC Assembly code. Just perform a direct translation – no optimizations. Use the local register mappings for the variables in assembly as specified.

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