The 2’s complement of the 8-bit binary number 00101100 is
Answer: D
Correct answer: 11010100
The 2’s complement is formed by inverting every bit and adding 1. Starting from 00101100, inversion gives 11010011, and adding 1 gives 11010100. Note that 11010011 - the second option - is the 1’s complement, which is the classic trap. A quicker method for hand working: copy the bits from the right up to and including the first 1, then invert everything to the left of it. Here the rightmost 1 is in the third position, so 100 is copied and 00101 becomes 11010, giving the same answer. 2’s complement is the standard representation for signed integers because it makes subtraction identical to addition - the processor needs no separate subtractor - and because it has only one representation of zero, unlike 1’s complement and sign-magnitude, which have two. In eight bits it represents the range −128 to +127, the asymmetry arising from that single zero.
Please log in or register to report this question.