As given, the numbers are in 2’s complement number system.
They asked to perform arithmetic operation and verify the answer –> By verify, I’m assuming the mean us to perform binary arithmetic and then verify whether the answer is same if we’ve first converted the numbers in decimal and then performed decimal arithmetic.
101011 + 111000 = 1100011
101011 = –21 , 111000 = –8 and –21 + (–8) = –29
1100011 = –29.
001110 + 110010 = 1000000
001110 = 14 , 110010 = –14 and 14 + (–14) = 0
1000000 = –64.
Here, if we observe decimal arithmetic results in 0 and binary arithmetic results in –64; also we can se operands are of 6 bits and result is in 7 bits. Now, in result if we ignore the 7th bit, we get 000000 ie 0.
Similarly, in 1st example also we can ignore the 7th bit, we still get 100011 = –29.
TLDR, in 2’s complement addition WE HAVE to discard any extra bit that we get.
Note: 0 – 0 = 0; 1 – 1 = 0; 1 – 0 = 1; 0 – 1 = 1 and 1 Borrow
111001 = –7 , 001010 = 10 and –7 – 10 = –17
101111 = –17
101011 = –21 , 100110 = –26 and –21 – (–26) = 5
000101 = 5