7. Using a “word” of 4 bits, list all of the possible signed binary numbers and their decimal equivalents that are representable in:
a) Signed magnitude
b) One’s complement
c) Two’s complement
The “word” of 4-bits means the MSB bit will specify the sign bit and the rest 3-bits will act as magnitude .
Example: -2 can be represented
Signed magnitude representation: The MSB bit is 1 for negative sign and the 2 binary value can be represented by 010 (-2 can be represented by 1010)
1(MSB) |
0 |
1 |
0(LSB) |
Sign binary value of 2
One’s Compliment: invert the values of signed negative values will give the one’s compliment value : 1101
Two’s Compliment : one’s compliment +1 will give the two’s compliment meaning 1101+1=1110
So in 4-bits word one bit is reserved for sign and the remaining 3-bits will be used for the value , so the total 3-bits value can be represented is 23= 8 values{000,001,010,011,100,101,110,111}
Decimal |
Signed Number |
1’s Compliment |
2’s Compliment |
-7 |
1111 |
1000 |
1001 |
-6 |
1110 |
1001 |
1010 |
-5 |
1101 |
1010 |
1011 |
-4 |
1100 |
1011 |
1100 |
-3 |
1011 |
1100 |
1101 |
-2 |
1010 |
1101 |
1110 |
-1 |
1001 |
1110 |
1111 |
-0 |
1000 |
1111 |
- |
+0 |
0000 |
0000 |
0000 |
+1 |
0001 |
0001 |
0001 |
+2 |
0010 |
0010 |
0010 |
+3 |
0011 |
0011 |
0011 |
+4 |
0100 |
0100 |
0100 |
+5 |
0101 |
0101 |
0101 |
+6 |
0110 |
0110 |
0110 |
+7 |
0111 |
0111 |
0111 |