Determining if a binary addition has overflow

643 Views Asked by At

that if
Im trying figure out how to determine whether a binary addition has overflow. My understanding is that if the cin is not equal to cout then there is overflow.

So that in that case for the following example: 01110101 + 10111011 = 00110000. Has overflow. Is that correct.

1

There are 1 best solutions below

0
On

You have overflow if there is carry out, regardless of whether there is carry in or not? If you have just two bits, $10+10$ overflows without a carry in. $10+10+1$(carry in) overflows even though carry in and carry out are equal.