This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: magnitude of the result is >= 2 n-1 b b For unsigned numbers: b Overflow occurs when there is an end-carry b For signed numbers: b Overflow occurs when there is a sign-reversal b We can detect the overflow when the carry-in does not equal the carry-out in the sign-bit CMPT 150 Integer Representation Page 4 Overflow b For example: b We can use an XOR gate to detect overflow CMPT 150 Integer Representation Page 5 2s Complement Addition b Add the numbers together and discard the carry b E.g. for n=6 : CMPT 150 Integer Representation Page 6 2s Complement Subtraction b Take 2s complement of second operand and perform 2s complement addition b n=5 , perform 10 10 3 10 b Now perform 3 10 10 10...
View Full Document
This note was uploaded on 04/27/2011 for the course CMPT 150 taught by Professor Dr.anthonydixon during the Spring '08 term at Simon Fraser.
- Spring '08