Convert to 8 bit binary and perform integer subtraction on 140-235. Does overflow happen?
To obtain the 2's complement of a number:
First obtain it's 1's complement( i.e interchanging 0's to 1's and
1's to 0's for it's binary number) & then add 1 to that 1's
complement
For Binary addition
Addition | Sum | Carry |
0+0 | 0 | 0 |
0+1 | 1 | 0 |
1+0 | 1 | 0 |
1+1 | 0 | 1 |
From the above
Result it is having 8-bits only. So there is no overflow
Occurs
Get Answers For Free
Most questions answered within 1 hours.