Binary addition uses the same column-by-column method as denary addition but with only two digits. The rules are:
| A | B | Sum | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Example: Add 00110101 (53) and 00101001 (41):
Result: 01011110 = 90 ✓
Overflow occurs when the result of an arithmetic operation is too large to be stored in the available number of bits. For 8-bit unsigned binary, the maximum value is 255. If a result exceeds this, a carry beyond the 8th bit occurs — this bit is lost, causing an incorrect result.
Example: 11000000 (192) + 10000000 (128) = 100000000 = 256, but stored in 8 bits as 00000000 — overflow error.
A logical shift moves all bits left or right by a specified number of positions. Vacated positions are filled with 0s. Bits shifted out are lost.
| Original | Operation | Result | Denary |
|---|---|---|---|
| 00001010 (10) | Left shift by 2 | 00101000 | 40 (×4) |
| 00010100 (20) | Right shift by 2 | 00000101 | 5 (÷4) |
An arithmetic shift preserves the sign bit (MSB). Used for signed (two's complement) numbers.
Example: Arithmetic right shift of 11001000 (–56) by 1: → 11100100 (–28). The sign bit (1) is preserved; value halved.
5 questions · 10 marks
| Term | Definition |
|---|
Timed exam conditions · 10 minutes