{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CDA3101PracticeFinalExamSoln

# CDA3101PracticeFinalExamSoln - CDA 3101 Final Exam(Sample...

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

1 CDA 3101 Final Exam (Sample) Last Name ____________________ Time: 2 hrs. First Name ____________________ Honor Code Statement On my honor, I have neither given nor received unauthorized aid on this exam . _______________________ ________________________ Signature UFID Show all your work to get partial/full credit. You can use a calculator. 1. (10 points) Write (in binary) the IEEE 754 single-precision representation of the number 18.25 10 . 0100000110010010…..0 2. (15 points) Consider two different implementations, I1 and I2, of the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. I1 has a clock rate of 6 GHz, and I2 has a clock rate of 4 GHz. The average number of cycles for each instruction class on I1 and I2 is given in the following table. Class CPI on I1 CPI on I2 C1 Usage C2 Usage A 2 1 40% 50% B 3 2 20% 25% C 5 2 40% 25% The table also contains a summary of average proportion of instruction classes generated by two different compilers (C1, and C2). Assume each compiler uses the same number of instructions for a given program but that the instruction mix is as described in the table. a. If you purchased I1, which compiler would you use i.e. which compiler produces programs with the lower average CPI? CPI of C1 = .4x2 + .2x3 + .4x5 = 3.4 CPI of C2 = .5x2 + .25x3 + .25x5 = 3.0 So, C2. b. If you purchased I2, which compiler would you use? CPI of C1 = .1.6 CPI of C2 = .1.5 So, C2. c. Which computer and compiler would you purchase if all other criteria are identical, including the cost? Exec_time(I1, C2) = (no. of Instructions) x 3.0/ 6 GHz = (no. of Instructions)x.5 x 10^-9

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

View Full Document
2 Exec_time(I2, C2) = (no. of Instructions) x 1.5/ 4 GHz = (no. of Instructions)x.375 x 10^-9. So (I2, C2) 3. (15 points) Implement the recursive function sillymultiply() given below in the MIPS assembly language. You may assume that the result always fits the 32-bit resgisters.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}