Exam1-S06

Exam1-S06 - in bold into MIPS assembly. The only...

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

View Full Document Right Arrow Icon
Name: ______________________ CPE 315-02 Exam 1 Spring 2006 Short Answer: /17 Simple Translation: /25 Advanced Assembly: /30 /72
Background image of page 1

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

View Full DocumentRight Arrow Icon
10: Short Answer Chip Die Size ( mm 2 ) Estimated Defect Rate (per cm 2 ) Manufacturing Size IBM Power5 389 .30 130nm Sun Niagara 380 380 .75 90nm AMD Opteron 199 .75 90nm 4pts - 1) What is the yield of the AMD Opteron? 1pts - 2) What is the yield of the Sun Niagara 380? 2pts - 3) Why are the yields so different? 2pts – 4) If we move to a new fabrication process, what will happen to the die size? 4pts – Are the following two loops equivalent (equivalent means they produce the same results and take the same computation time)? Justify your answer float f; float f; for(i=0;i<n;i++) for(int i=n-1;i>=0;i--) f += A[i]; f += A[i]; (2) Give two disadvantages and one advantage of doubling the number of registers in the ISA. If you say “faster”, say why it is faster. (2) Translate the following MIPS instruction into the binary format seen by the computer: sltu $5, $3, 250
Background image of page 2
25 pts – Basic translations. (15 pts) Translate the code
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: in bold into MIPS assembly. The only pseudoinstruction you may use is la. C MIPS int H[256]; // global variable void main() { int i, j; char A[26]; for(i=a;i&lt;z;i++) A[i-a] = i; H[5] = i &amp; 0x77; } (10 pts)Using a stack-based architecture, write the following code snippet: A = (B + C) * (D + E) / F; (30) public class Link { public: int key; Link *right; Link *left; void *data; int SumKeys(); Link *Collapse(); }; Translate the SumKeys method into MIPS. It returns the sum of all keys in the current nodes subtree, including itself. You must use proper calling convention. You may not use pseudoinstructions. I have written the method in both C++ and Java. C Java int Link::SumKeys() int SumKeys() { { int sum = key; int sum = key; if (left != NULL) if (left != null) sum += left-&gt;SumKeys(); sum += left.SumKeys(); if (right != NULL) if (right != null) sum += right-&gt;SumKeys(); sum += right.SumKeys(); return sum; return sum; } }...
View Full Document

Page1 / 4

Exam1-S06 - in bold into MIPS assembly. The only...

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

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