During subtraction using 2's complement, why it is important to decide on the number of bits we are going to use, (e.g. 4 bit, 8 bit, 16 bit etc) and use the same number of bits to write each number. For example:
Question: (-2-5) base 10
(-2)+(-5)
--> 2 in 2's complement: (1110) base 2, 5 in 2's complement: (1011)
--> (1110) + (1011)
--> 1001 with carry 1, we discard the carry and take 2's complement of 001 --> 111
--> Since MSB is 1, the answer is -(7) base 10, which is correct answer.
but if we do the same quation such that and writing only 3 bits.
2 in 2's complement is (110) base 2
5 in 2's complement is (011) base 2
if we add we will get (001) with carry 1, which we will discard Thus the answer will be (1) base10, which is incorrect answer.
Any specific reason we have to take 4, 8 or 16 bit. Why we cannot get answer with 3 bit, as both 5 and 2 can be represenetd in 3 bits.