324_Book

# The operands range between and when twos complement

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of Ü and Ý . Let us deﬁne the operation +u for arguments Ü and Ý such that ¼ Ü Ý ¾Û as: Û Ü+ Ý u Û ´ Ü·Ý Ü·Ý ¾ Ü·Ý Û ¾ Û Ü·Ý ¾ Û ¾ Û ·½ (2.9) This is precisely the result we get in C when performing addition on two Û-bit unsigned values. An arithmetic operation is said to overﬂow when the full integer result cannot ﬁt within the word size limits of the data type. As Equation 2.9 indicates, overﬂow occurs when the two operands sum to ¾Û or more. Figure 2.16 shows a plot of the unsigned addition function for word size Û . The sum is computed u modulo ¾ ½ . When Ü · Ý ½ , there is no overﬂow, and Ü + Ý is simply Ü · Ý . This is shown as the region forming a sloping plane labeled “Normal.” When Ü · Ý ½ , the addition overﬂows, having 56 CHAPTER 2. REPRESENTING AND MANIPULATING INFORMATION the effect of decrementing the sum by 16. This is shown as the region forming a sloping plane labeled “Overﬂow.” When executing C programs, overﬂows are not signalled as errors. At time...
View Full Document

Ask a homework question - tutors are online