Difference between revisions of "CSC231 Final Exam 2014"

From dftwiki3
Jump to: navigation, search
Line 11: Line 11:
 
<br />
 
<br />
 
* What is the decimal value represented by 1001011 in U(5,2)?
 
* What is the decimal value represented by 1001011 in U(5,2)?
(answer = 18.75)
+
 
 
<br />
 
<br />
 
=Problem 2=
 
=Problem 2=
 
<br />
 
<br />
 
* What is 10000001 in A(4,3) format?
 
* What is 10000001 in A(4,3) format?
(answer -0.125)
 
 
<br />
 
<br />
 
=Problem 3=
 
=Problem 3=
Line 22: Line 21:
 
* Assume a floating point format of 9 bits: 1 sign bit, 1 4-bit exponent with a bias of 7, and a 4-bit mantissa (in this order).
 
* Assume a floating point format of 9 bits: 1 sign bit, 1 4-bit exponent with a bias of 7, and a 4-bit mantissa (in this order).
 
* What is the real number (in decimal) with this binary representation: 1 1000 0000  
 
* What is the real number (in decimal) with this binary representation: 1 1000 0000  
(answer -2)
+
 
 
<br />
 
<br />
 
=Problem 4=
 
=Problem 4=
Line 69: Line 68:
 
and that you push eax, ebx, ecx, and edx at the beginning of moveDisk. Nothing else is pushed in moveDisk in addition to these four registers.
 
and that you push eax, ebx, ecx, and edx at the beginning of moveDisk. Nothing else is pushed in moveDisk in addition to these four registers.
  
How much stack space will your program need, approximately, when moving 32 disks (''N'' = 32)?
+
How much stack space will your program need, approximately, when moving 32 disks (''N'' = 32)? Pick the answer that is closest to your estimate.
 
* Approximately 100 bytes
 
* Approximately 100 bytes
 
* Approximately 640 bytes
 
* Approximately 640 bytes
Line 78: Line 77:
 
Please answer this question in the Moodle Final-Exam Problem 6 section.
 
Please answer this question in the Moodle Final-Exam Problem 6 section.
 
</onlydft>
 
</onlydft>
 +
<br />
 +
<br />
 +
<onlydft>
 +
=Answers=
 +
* Problem 1: (answer = 18.75)
 +
* Problem 2: (answer -0.125)
 +
* Problem 3: (answer -2)
 +
* Problem 4: 2^24 - 2 (sign bit + mantissa = 24 bits ==> 2^24 combinations - 2 infiniti representations)
 +
* Problem 5:
 +
* Problem 6: 640 bytes
 +
</onlydft>
 +
<br />
 +
<br />
 +
<br />
 +
[[Category:CSC231]]

Revision as of 07:37, 11 December 2014

--D. Thiebaut (talk) 15:02, 9 December 2014 (EST)



...




...