In this case the system is a machine generated

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A. What is wrong with this code? B. Give a correct implementation of the function that uses only left and right shifts, along with one subtraction. Homework Problem 2.38 [Category 1]: Fill in the following table showing the effects of complementing and incrementing several 5-bit vectors, in the style of Figure 2.20. Show both the bit vectors and the numeric values. 2.5. SUMMARY 83 Ü ¼½½¼½ ¼½½½½ ½½¼¼¼ ½½½½½ ½¼¼¼¼ ˜Ü Ò Ö ´˜Üµ Homework Problem 2.39 [Category 2]: Show that first decrementing and then complementing is equivalent to complementing and then incrementing. That is, for any signed value x, the C expressions -x, ˜x+1, and ˜(x-1) yield identical results. What mathematical properties of two’s complement addition does your derivation rely on? Homework Problem 2.40 [Category 3]: Suppose we want to compute the complete ¾Û-bit representation of Ü ¡ Ý , where both Ü and Ý are unsigned, on a machine for which data type unsigned is Û bits. The low-order Û...
View Full Document

Ask a homework question - tutors are online