Complete the following questions. Although there may be calculators and other tools to assist, you should complete the work manually in order to gain maximum familiarity. However after you have completed the work these tools can be used to confirm and reinforce your answers. Note that during tests or exams no external aids, such as calculators, will be permitted.
2.4 Given n bits, how many unsigned integers can berepresented with the n bits? What is the range of these integers.
a. What is the largest positive number one can represent in an 8-bit 2's complement representation? Write your result in binary and decimal.
b. What is the greatest magnitude negative number one can represent in an 8-bit 2's complement representation. Write your result in binary and decimal.
c. What is the largest positive number one can represent in an n-bit 2's complement representation?
d. What is the greatest magnitude negative number one can represent in an n-bit 2's complement representation?
2.12 If the last digit of a 2's complement binary number is 0, then the number is even. If the last two digits of a 2's complement number are 00 (eg. the binary number 01100) what does that tell you about the number?
2.14 Add the following bit patterns. Leave your results in binary form.
a. 1011 + 0001
b. 0000 + 1010
c. 0101 + 0110
d. 1111 + 0001
2.40 Write the decimal equivalents for these IEEE floating point numbers.
a. 0 10000000 00000000000000000000000
b. 1 10000011 00010000000000000000000
c. 0 11111111 00000000000000000000000
d. 1 10000000 10010000000000000000000
1. Convert each of the following base 10 numbers to base 2, 8, and 16.
2. Convert each of the following base 2 numbers to base 8, 10, and 16.
3. Convert each of the following base 16
numbers to base 2, 8, and 10.
4. Convert 555 which is a number in base 6 to the same value expressed in the bases given below.
5. Determine the data representation of each of the following integers assuming
16 bits are used for each of the representations of sign and magnitude, one’s
complement, and two’s complement. Your answers must be expressed in hexadecimal.
6. Determine the data representation of each of the integers from question 5 again, but assume 32 bits are used and only show the representation for two’s complement. Your answers must be expressed in hexadecimal.
7. For each the following representations of 16 bit integers determine
the integer values they represent assuming each of a sign and magnitude, one’s
complement, and two’s complement representation.
8. Write the decimal value corresponding to each of these IEEE 32-bit floating point numbers as expressed in hexadecimal. Note that the associated bits are from left to right: sign, exponent, mantissa.
9. For each of the following decimal values produce the 32-bit IEEE Floating Point representation. Display your answer in binary clearly identifying the sign, exponent and mantissa.
You may either type or neatly print your solutions.
Staple your assignment answer sheets with a standard computer science cover sheet at the front and deposit in the handin box for COSC 2P12.
Late assignments will be accepted up to 3 days after the due date subject to a 25% penalty.
Note: Any suspected plagiarism will be dealt with harshly in accordance with departmental guidelines as outlined on the Computer Science web site. The page to visit for more information is found here.