0

I presented the Hexadecimal values for these integers in the title, just to preserve space, however I am actually trying to add them in Binary.

The overflow conditions (from what I could understand) for signed binary Addition are as follows:

Suppose we have 2 8-bit signed integers x and y.

If we are adding x and y, and they are both positive, but the result is negative, then there is overflow.

Likewise, if we are adding x and y, and they are both negative, but the result is positive, then there is overflow.

Lastly, if the Most Significant Bit Carry-In value is not equal to the MSB Carry-Out value, then there is overflow (I think this is the condition I am having the most trouble understanding, but that will be more clear after you've viewed the way I worked out both of these problems)

Now for the actual addition, I have attached my work:

Calculations for both problems.

Firstly, am I even doing signed addition correctly? If so, then what is the point of 2's complement if I am just going to add these signed integers without even using it?

Secondly, in the first problem and the second, there is an extra 9th bit, however overflow only occurs in the second problem. What gives?

I thought I understood the concept of signed binary, however now that I am actually performing computations with 8-bit binary numbers, I have run into lots of confusion, especially where overflow is thrown into the mix. If you need any clarification or if I am breaking any rules, please let me know so I can edit my post accordingly.

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128

0 Answers0