COMP03MTL01e

More to Learn
Special cases of two’s complement conversion
There are special cases for two’s complement conversion.
Case 1: Conversion of value 0 to its two’s complement
representation
Consider an 8-bit representation of 010.
0000 00002
Binary representation of 010
= 0000 00002
One’s complement of 010
= 1111 11112
Two’s complement of 0000 00002 = 1 0000 00002 (The overflow bit is ignored.)
= 0000 00002 (equivalent to 010)
The overflow bit should be ignored in this case. The two’s complement of value 0
is exactly the same as the binary bit pattern before conversion.
More to Learn
Special cases of two’s complement conversion
Case 2: Evaluation of two’s complement representation of the
smallest negative integer
Consider an 8-bit representation of the smallest negative integer (i.e. –12810 )
in two’s complement.
Binary representation of 12810 = 1000 00002
(An 8-bit integer is needed to represent 12810.)
One’s complement of –12810 = 0111 11112
Two’s complement of –12810 = 1000 00002
Hence, the two’s complement representation of –12810 is 1000 00002.
More to Learn
Special cases of two’s complement conversion


In order to evaluate the two’s complement of the smallest negative
number, the leftmost sign bit must also be used for representing the
magnitude of the binary number.
It is worth remembering that the smallest negative integer for any
word size is of the following bit pattern.
1 0 0 0 …. 0 0 0 0
The leftmost bit is 1.
All the subsequent bit is 1. bits are 0.
More to Learn
Special cases of two’s complement conversion


In order to evaluate the two’s complement of the smallest negative
number, the leftmost sign bit must also be used for representing the
magnitude of the binary number.
It is worth remembering that the smallest negative integer for any
word size is of the following bit pattern.
1 0 0 0 …. 0 0 0 0
The leftmost bit is 1.
All the subsequent bit is 1. bits are 0.