1
$\begingroup$

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.

  • 0
    What are cin and cout?2017-01-21
  • 0
    carry in and carry out2017-01-21

1 Answers 1

0

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.