binary math question

Status
Not open for further replies.

222

Junior Member
Apr 22, 2011
8
0
0
Quote from http://en.wikipedia.org/wiki/Two's_complement

"Note that this is detected as an overflow condition since there was a carry into but not out of the most-significant bit."

Can anyone give an example where there is both a carry in and carry out of the MSB in a single addition of two signed binary numbers? More importantly, why does my example not qualify as a overflow as the article implies? Thank you.
 
Last edited:

PottedMeat

Lifer
Apr 17, 2002
12,363
475
126
wait you want carry in & out?
what?
Code:
 1
 11
+11
---
110

oh they're just taking about the range of a signed 8bit number vs. unsigned
 
Last edited:

FoBoT

No Lifer
Apr 30, 2001
63,084
15
81
fobot.com
there is no bumping in OT
bump.gif
 

gophins72

Golden Member
Jul 22, 2005
1,541
0
76
quote from http://en.wikipedia.org/wiki/two's_complement

"note that this is detected as an overflow condition since there was a carry into but not out of the most-significant bit."

can anyone give an example where there is both a carry in and carry out of the msb in a single addition of two signed binary numbers? more importantly, why does my example not qualify as a overflow as the article implies? Thank you.

Code:
   0100          4
+  1100      + (-4)
-------------------
  10000          0
=  0000

Also, the first example in the link you provided has the same example you ask for with explanation, followed by an example of a violation.
 
Status
Not open for further replies.