256 = 100000000 (Cannot be stored in a 9-bit signed variable)
-256 = 011111111 + 1 = 100000000 (Can be stored in a 9-bit signed variable & this is also the smallest value that can be stored)
2 = 000000010
we know that A - B = A + (B' + 1) in 2's Complement method
so ANS = 100000000 + (000000010' + 1)
= 100000000 + (111111101 + 1) = 100000000 + 111111110
= 1 011111110
The last carry over bit being 1 signifies that the result of the operation is negative and has also gone out of bounds of the limit of a 9-bit register to store the data, thereby resulting in an error or otherwise an incorrect result as +254.
Get Answers For Free
Most questions answered within 1 hours.