1011 0110 + 1001 0011 in 8 bits — binary arithmetic
exam standardthe result does not fit
Answer
01001001 with carry out 1
Why this example is worth doing
Two bytes whose sum exceeds 255, so the ninth bit is lost and the register holds a wrapped value. The page distinguishes carefully between what the hardware does — discard into the carry flag — and what it means, which depends entirely on whether the operands are signed. The same bits are an unsigned overflow here and, read as signed values, a signed overflow too, and the page shows both readings.
Try your own input in the Binary arithmetic. Add, subtract, multiply and divide in binary with every carry and borrow shown.
How the answer is reached
10110110 + 10010011 (8-bit, unsigned)
| operand | bits | hex | unsigned | signed |
|---|---|---|---|---|
| A | 10110110 | 0xB6 | 182 | -74 |
| B | 10010011 | 0x93 | 147 | -109 |
| row | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| carry in | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
| A | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 |
| + B | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 |
| result | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
C = 1 · V = 1 · N = 0 · Z = 0
unsigned182 + 147 = 329, kept as 73— carry out: the true sum needs one more bit
signed-74 + -109 = -183, kept as 73— V = 1: the signed answer is wrong
C is carry-out (unsigned overflow); V is carry-into-MSB XOR carry-out-of-MSB (signed overflow). They are independent: either, both or neither can be set.