0000 01011111 10101111 1010 + 1 = 1111 10111111 1011 represents −5 in two’s complement.| Divide by 2 | Quotient | Remainder |
|---|---|---|
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
11010000 11011111 00101111 0010 + 1 = 1111 00110000 11011111 00111000 0000 represent in 8-bit two’s complement?1000 0000 starts with 1 → negative number.0111 11110111 1111 + 1 = 1000 0000 (decimal 128)1000 0000 = −128| Binary | Decimal Value |
|---|---|
0000 0000 | 0 |
0000 0001 | 1 |
| ... | ... |
0111 1111 | +127 |
1000 0000 | −128 |
1000 0001 | −127 |
| ... | ... |
1111 1111 | −1 |