Binary addition follows the same rules as denary addition but carries at 2 instead of 10. There are four basic rules:
| Operation | Result | Carry |
|---|---|---|
| 0 + 0 | 0 | 0 |
| 0 + 1 | 1 | 0 |
| 1 + 0 | 1 | 0 |
| 1 + 1 | 0 | 1 (carry) |
| 1 + 1 + 1 | 1 | 1 (carry) |
Example: Add 01101011 + 00110110:
01101011 + 00110110 ---------- 10100001
Result: 10100001 = 161 in denary (107 + 54 = 161 ✓)
Overflow occurs when the result of an addition is too large to be stored in the available number of bits. In an 8-bit system, if the result exceeds 255 (unsigned) or goes outside the signed range, a carry out of the most significant bit indicates overflow.
Computers represent negative numbers using two's complement notation. This allows the same addition circuits to handle both positive and negative numbers.
In n-bit two's complement:
For 8-bit two's complement:
| Bit position | 7 (MSB) | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | −128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Example: 11110100 in 8-bit two's complement:
= −128 + 64 + 32 + 16 + 0 + 4 + 0 + 0 = −128 + 116 = −12
For positive numbers, two's complement is the same as unsigned binary (as long as the MSB is 0).
Method 1 — Invert and add 1:
Example: Represent −37 in 8-bit two's complement:
0010010111011010 (one's complement)11011011To subtract A − B, compute A + (−B), where −B is the two's complement of B. This means computers only need addition circuits — no separate subtraction hardware.
Example: 53 − 37 = 16
Two's complement of 37 = 11011011
00110101 + 11011011 = 100010000
The carry out of bit 7 is discarded → 00010000 = 16 ✓
An alternative method where the MSB is a sign bit (0=positive, 1=negative) and the remaining bits represent the magnitude. This is not two's complement. Cambridge 9618 focuses on two's complement as the standard method.
11111111 = −1 in 8-bit two's complement (−128+127 = −1)8 questions · instantly marked · Cambridge 9618 standard
| Term | Definition |
|---|
10 questions · 10 marks · 10 minutes