Perform the given arithmetic operation on the following pairs of 8-bit 2’s complement numbers. In each case, indicate whether or not overflow occurs. the numbers: 11010100 + 11101011 if I understood the question then the result is: 10111111 with a discard 1 and there's no overflow since the sign is the same " both are negative " the problem is here: 11010100 - 11101011 how can I do this ? negate the second one ? or what ? I think in 2's complement there should only be addtion to see if there's an overflow. and since all the question have the same sign that got me
11010100 + 11101011 is indeed 10111111 and one carry-bit. If you write 11010100 - 11101011 in a clever way you realize it's actually the same as writing 11010100 + (-11101011). Since -11101011 is signed and negative we have to calculate it's two's complement: -11101011 = 00010100 + 1 = 00010101. This gives us 11010100 + 00010101 which is easier to calculate. Please note that it's also possible to do binary subtraction by hand, but it's a bit more tricky.
Oh , thanks for your help man ^^
Join our real-time social learning platform and learn together with your friends!