CSE370 Fall ’99
Assignment 1
Distributed: 9/27/99
Due: 10/4/99
Reading:
Katz, Chapter 1 (pp. 1-35, for an alternative to the introduction to the material of the course).
Katz, Appendix A (pp. 650-661, this should be review).
Katz, Chapter 5.1 (pp. 241-248, this should also be review).
Exercises:
The written assignments (such as this one) account for what percentage of the final grade? What question would you like to see on the course evaluation that is currently not on the list?
Add yourself to the class mailing list using majordomo. Become familiar with the NT computing environment if you are not already.
(a) 15C.38_{16} to Base 10
(b) 37.24_{10} to Base 2 (compute to a maximum of 10 places to the right of the binary point)
In each of the following arithmetic problems, determine all of the possible binary number systems that are being used for the top operand and the result. The possible choices are: Unsigned, Sign-Magnitude, 1’s Complement, 2’s Complement, Unsigned Floating Point formatted as <mm><ee>, and BCD. "overflow" means that the result cannot be represented as a 4-bit value in the number system.
a. 1000
x -1
To do this, fill in the table below with an ‘X’ for each
of the possible interpretations of each arithmetic problem. One ‘X’ has
been placed to indicate that problem e
can be interpreted as unsigned.
There may be other possible interpretations for problem e as well, so it is possible for a
row to have more than one ‘X’. Unsigned Sign-Mag 1’s Comp 2’s Comp FP BCD a b c d e X
overflow
b. 1000
+ 1
0001_{2}
c. 1000
x 2
1001_{2}
d. 1000
+ 2
overflow
e. 1000
+ 1
1001
a. Let A = 101010 and B = 010110 be 6-bit binary numbers. Calculate C=A+B once for each of the following binary representations: Unsigned, Sign-Magnitude, 1's Complement, and 2's Complement. Express C in the same 6-bit format that used for A and B. If you can't express the answer as a 6-bit result, explain why not. Show your work in binary (no intermediate conversion to decimal), and show what happens to the high-order carry.
4bits |
4bits |
Mantissa |
Exponent |
Which is interpreted as 0.mmmm x 2^{eeee }
Where <mmmm> is a 4 bit unsigned mantissa, and <eeee> is a 4-bit unsigned binary exponent.
Using the format described above: Show the steps involved to add the following numbers, assuming
Let A = 11010100
Let B = 11110111
Compute C = A + B showing all work in binary. Express C using the same format. Note: make sure to give the result using the maximum possible precision that fits within the format.
Comments to: cse370-webmaster@cs.washington.edu (Last Update: )