In the following problems, assume you are using 2s complement form and do the indicated operation. Leave the answers in binary. Also, assume you are dealing with signed numbers.
Also, assume we are saving the answer in a 8-bit register. In this case, for each problem would the saved answer be correct. If not for which of the following problems would if be incorrect and why?
(-70+(-80))
Here -70 & 80 subtracted
(70)10=(01000110)2
(-70)10=(10111010)2 ----by 2'complement
(80)10=(01010000)2
(-80)10=(10110000)2
Add(-70 & -80)
10111010
+ 10110000
--------------------------
1] 01101010
When 2'complement is taken
10010110 (-150)
Overflow flag indicates that the result is too large to fit in 8 bit.OF is 1when the following conditions satisfies.
When the two +ve operands are added there results should exceed127
When the two -ve operand are subtracted there result should be less than -128
OF=1 because the result is less than -128 i.e -150
Get Answers For Free
Most questions answered within 1 hours.