The operands range between and when twos complement

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: of Ü and Ý . Let us define 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 overflow when the full integer result cannot fit within the word size limits of the data type. As Equation 2.9 indicates, overflow 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 overflow, and Ü + Ý is simply Ü · Ý . This is shown as the region forming a sloping plane labeled “Normal.” When Ü · Ý ½ , the addition overflows, 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 “Overflow.” When executing C programs, overflows are not signalled as errors. At time...
View Full Document

Ask a homework question - tutors are online