MODD / Mr. Hansen |
Name:
_________________________ |
Test on Unit 0x60 (Topics 0x61-0x6F, omitting 0x63 and
0x6A)
Time limit: 32 minutes (48 minutes for extended
time). A calculator and textbook are permitted.
Each question is worth 6 points.
Instructions:
For multiple choice questions, write the capital letter of the best choice in the blank provided. For
fill-in questions, write the word or phrase that best fits in the space
provided. For free-response questions, write a coherent, legible response in
the space provided, or on the reverse if you need more room. Most free-response
questions can generally be answered in a few lines.
1, 2. |
Many so-called “division by
zero” errors that are reported when a computer program runs may actually be
______________________ errors, caused when the absolute value of a divisor
(as a result of a previous calculation, or roundoff
or truncation error), is less than the _____________________________ . |
|
|
3, 4. |
In integer arithmetic, overflow
is easily detected when a sum of two positive numbers produces a number that
is _____________ in two’s complement, or when the sum of two negative numbers
produces a number that is _____________ in two’s complement. |
|
|
5. |
Compute the one’s
complement of the longint 0x3C405B28. No work is
required. Give answer in hex. |
|
|
6. |
Compute the two’s
complement of the longint 0x3C405B28. No work is
required. Give answer in hex. |
|
|
7. |
In one-byte integer arithmetic
using two’s complement rules, what does the hex answer BC mean if we obtain
it as the final answer to a problem? Convert your answer to decimal. |
|
|
|
|
|
|
|
|
|
|
8. |
What is a register? |
|
|
|
|
|
|
|
|
9, 10. |
If the binary value
00110011 is ____________________ left to produce the binary number 01100110, that is equivalent to multiplying by _________ . |
|
|
|
|
|
|
11, 12. |
Perform the operation 0453 –
1788 (in decimal) using 10’s complement arithmetic. Show your work, including
how the final answer should be interpreted (sign and value). |
|
|
|
|
|
|
|
|
|
|
|
|
13, 14. |
Perform the operation 428A –
12CB (in hex) using 2’s complement arithmetic. Show your work, including how
the final answer should be interpreted. It is not necessary to convert to
decimal for your final answer; simply state whether the final answer is
positive or negative, and how you can tell. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15. |
Convert the decimal value
0.5 to IEEE 754 single-precision format. You may ask for some assistance if
you get stuck. Give final answer in hex. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16. |
State (in hex) how the
IEEE754 floating-point value 0xA2874321 would be stored |
|
|
|
(a) on a Mac or most Unix
machines |
|
|
|
|
|
|
|
(b) on a PC (Intel
architecture) |
|
|
|
|
|
|
17. |
Explain briefly what is
meant by rounding error and truncation error, and how it is
possible for these types of errors to cascade. |