Question 1 Report
Two's complement is used to represent negative numbers in binary.
| Denary | 8-bit two's complement binary |
|---|---|
| 45 | |
| -45 | |
| -100 |
(a) Complete the table by converting each denary number to 8-bit two's complement binary. Show your working. [6]
(a) Converting each denary number to 8-bit two's complement binary:
45:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
45 = 32 + 8 + 4 + 1 = 00101101. [2]
-45:
The result is 11010011. [2] This "flip and add 1" method is the standard algorithm for finding the two's complement (negative) of a binary number.
-100:
The result is 10011100. [2]
In two's complement, the most significant bit (MSB) indicates the sign: 0 for positive, 1 for negative. The range of an 8-bit two's complement number is -128 to +127.
Everything you need to excel in your exams