Dale - Computer Science Illuminated 109

Dale - Computer Science Illuminated 109 - the number. a....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
82 Chapter 3 Data Representation a. How many positive integers can be represented? b. How many negative integers can be represented? c. Draw the number line showing the three smallest and largest positive numbers, the three smallest and largest negative numbers, and zero. 11. Use the number line on page 58 to calculate the following expressions, where A is ± 499999 and B is 3. a. A + B b. A ± B c. B + A d. B ± A 12. Use the formula for the ten’s complement to calculate the following numbers in the scheme described in on page 59. a. 35768 b. ± 35768 c. ± 4455 d. ± 12345 13. In calculating the ten’s complement in Exercise 12, did you have trouble borrowing from so many zeros? Such calculations are error prone. There is a trick that you can use that makes the calculation easier and thus less prone to errors: Subtract from all 9’s and then add 1. A number subtracted from all 9’s is called the nine’s complement of
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the number. a. Prove that the nines complement of a number plus 1 is equal to the tens complement of the same number. b. Use the nines complement plus one to calculate the values in Exer-cise 12 b, c, and d. c. Which did you find easier to use, the direct calculation of the tens complement or the nines complement plus 1? Justify your answer. 14. Evaluate the following expressions, where A is 00110011 and B is 01010101 a. A + B b. A B c. B A d. B e. ( A) 15. Is the twos complement of a number always a negative number? Explain. 16. The ones complement of a number is analogous to the nines comple-ment of a decimal number. Use the scheme outlined in Exercise 13 to calculate the results of Exercise 14, using the ones complement rather than the twos complement....
View Full Document

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online