prerequisite quiz Sp04 CS152

Computer Organization and Design: The Hardware/Software Interface

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

View Full Document Right Arrow Icon
University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2004 John Kubiatowicz Prerequisite Quiz February 2, 2004 CS152 Computer Architecture and Engineering This prerequisite quiz will be used in determining class admissions. The use of notes is not allowed during this quiz. Good Luck! Your Name: SID Number: Discussion Section: 1 2 3 4 5 Total 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
[ This page left for π ] 3.141592653589793238462643383279502884197169399375105820974944 2
Background image of page 2
1) Assume that we have a 16 bit system that uses signed, two’s-complement integers. Perform the following conversions: -21 10 to base 2: FF2F 16 to base 10: 65 10 to base 16: (1111111110110100) 2 to base 10: FEC3 16 to base 8: 257 10 to base 2: 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
[ This page left for scratch ] 4
Background image of page 4
2) Suppose that we start with the following C program for fibonacci: int fib (int n) { /* n >= 0 */ int temp; int sum; if (n <= 1) { return 1; } else { temp = fib (n-1); sum = temp + fib (n-2); return sum; } } Here is a translation of the above program into MIPS assembly language. Let’s assume that the stack pointer points at a full entry (i.e. 0($sp) is ok). Assume that we are using the RAW architecture (i.e. there are delay slots).
Background image of page 5

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

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

This homework help was uploaded on 01/29/2008 for the course CS 152 taught by Professor Kubiatowicz during the Spring '04 term at University of California, Berkeley.

Page1 / 14

prerequisite quiz Sp04 CS152 - University of California,...

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

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