Introduction                                                                                                                                   Print this page
<< Previous |  First |  Last |  Next >>       


Examples:

+3 = +3
-3 = 10 2 -3 = 97

2's complement is a special case of complement representation. The negative number -k is equal to 2 n -k. In 4 bits system, positive numbers 0 to 2n-1 is represented by 0000 to 0111 and negative numbers -2n-1 to -1 is represented by 1000 to 1111. Such a representation has only one zero and arithmetic is easier. To negate a number complement all bits and add 1

Example:

119 10 = 01110111 2

Complementing bits will result

10001000
            +1           add 1
10001001
That is 10001001 2 = - 119 10

<< Previous |  First |  Last |  Next >>