I am confused on how to do conversion from one's complement to two's complement. Suppose we have 10101101 in one's complement. How to convert it to two's complement?
Thanks
I am confused on how to do conversion from one's complement to two's complement. Suppose we have 10101101 in one's complement. How to convert it to two's complement?
Thanks
Just look at the definitions:
One's complement means that the bits in the negation of the value are complement (inversion) of all the bits in the original.
Two's complement of an N-bit number is defined as the result of subtracting the original N-bit number from 2^N. The effect of this operation has the same result on the original number as taking the one's complement and adding 1.
In this case then, if 10101101
is the one's complement, just add one to get the two's complement, which would be 10101110
. Or, doing it the long way:
10101101
01010010
(invert the bits per definition of one's complement)2^8 - 01010010
= 100000000 - 01010010
= 10101110