Arithmetic operation of binary numbers - Is my answer correct?

244 Views Asked by At

Does the arithmetic operation -

102 (base 10)- 39 (base 10), represented in 8-bit, when converted to binary have an overflow or underflow?

My Ans - It has no problem. I mean there is neither overflow nor underflow because 8- bit numbers can range from -127 to +127. The answer to the binary operation is +63 and so it is within the range. Hence there is no over flow or under flow. Is my answer correct?

2

There are 2 best solutions below

3
On BEST ANSWER

Yes, you are entirely correct.

There would certainly be overflow if we were adding $39_{10}$ to $102_{10}$ in two's complement, since the sum exceeds $127$, which is the maximum positive base 10 value representable in two's complement. However, there is no problem whatsoever when subtracting $39_{10}$ from $102_{10}$.

2
On

Yes it's correct.....................................