324_Book

# then we will have giving twos complement sum equals

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: ER 2. REPRESENTING AND MANIPULATING INFORMATION Integer Addition 32 28 24 20 16 12 8 4 0 0 2 4 6 2 8 10 12 0 14 4 6 10 8 12 14 Figure 2.14: Integer Addition. With a four-bit word size, the sum could require 5 bits. x +y 2w+1 2w 0 Overflow x +u y Figure 2.15: Relation Between Integer Addition and Unsigned Addition. When Û ¾ ½, the sum overﬂows. Ü · Ý is greater than 2.3. INTEGER ARITHMETIC 55 Unsigned Addition (4-bit word) Overflow 16 14 12 10 8 6 4 2 0 0 2 4 6 2 8 10 12 0 14 4 6 10 8 12 14 Normal Figure 2.16: Unsigned Addition. With a four-bit word size, addition is performed modulo 16. 0, and hence discarding it will not change the numeric value. On the other hand, if ¾Û Ü · Ý ¾Û·½ , the leading bit in the Û · ½-bit representation of the sum will equal 1, and hence discarding it is equivalent to subtracting ¾Û from the sum. These two cases are illustrated in Figure 2.15. This will give us a value in the range ¼ Ü · Ý ¾Û ¾Û·½ ¾Û ¾Û , which is precisely the modulo ¾Û sum...
View Full Document

Ask a homework question - tutors are online