World's most popular travel blog for travel bloggers.

Two's complement overflow

, , No Comments
Problem Detail: 

I know that in the case of a 16 bit word, if we have x - 115 in decimal, the smallest x that would cause overflow would be (32767 + 115 + 1)= 32883 because it would represent a number that is larger than the largest positive integer we could represent in a 16 bit word. However, I was wondering what would the largest value of x be? would it be (2^16)? which would cause 2 carries after the addition. Or would the largest x be a number that would only result in 1 carry alone?

Asked By : O.A.
Answered By : Yuval Filmus

You get overflow if the result is larger than the maximal integer, in this case 32767. You get underflow if it is smaller than the minimal one, in this case -32768. (In the context of floating-point operations, underflow happens when a non-zero number is rounded to zero.)

Best Answer from StackOverflow

Question Source :

3200 people like this

 Download Related Notes/Documents


Post a Comment

Let us know your responses and feedback