NIMCET 2014 — Computer PYQ
NIMCET | Computer | 2014What is the 2's complement of 0011 0101 1001 1100?
Choose the correct answer:
- A.
1100 1010 1100 1011
- B.
1100 1010 0110 0011
- C.
1100 1010 0110 0100
(Correct Answer) - D.
1100 1010 1111 1111
1100 1010 0110 0100
Explanation
Solution
Concept:
-
1's complement: Inverting all the bits (changing 0 to 1 and 1 to 0).
-
2's complement: Adding 1 to the Least Significant Bit (LSB) of the 1's complement.
2’s complement=1’s complement+1 (LSB)
Step-by-Step Calculation:
-
Given Binary Number:
0011010110011100 -
Find 1's Complement (Invert bits):
1100101001100011 -
Find 2's Complement (Add 1 to LSB):
\begin{array}{r@{\quad}c@{\quad}c@{\quad}c@{\quad}c} & 1100 & 1010 & 0110 & 0011 \\ + & & & & 1 \\ \hline & 1100 & 1010 & 0110 & 0100 \end{array}
Short Trick:
Start from the right (LSB) and keep all bits the same until you encounter the first '1'. Keep that '1' as it is, and then invert all the remaining bits to the left.
-
Original: 0011010110011100
-
Result: 1100101001100100
Conclusion:
The 2's complement of the given number is 1100 1010 0110 0100.
