- #1
Slimsta
- 190
- 0
Homework Statement
The following binary in signed 2s complement form. Perform the indicated arithmetic operations and verify the answers. Indicate whether overflow occurs for each computation.
a) 110001 – 010010
b) 001011 + 100110
c) 101110 – 110111
d) 100111 + 111001
Homework Equations
The Attempt at a Solution
a) 49-18=31 and
110001 – 010010 = 011111 (which =31)
b) 11+38=49 and
001011 + 100110 = 110000 (which =-48)
--> overflow
c) 46-59=-13 and
101110 – 110111 = 110111
-->2s comp --> = 001001 (which =-13)
d) 39+57=96 and
100111 + 111001 = 100000 (which =32)
--> overflowi hope my answers are right.. can you find any mistakes?
im just a little bit confused as to when to do the 2s comp once i get the answer (like in part C), should i try do the 2s complement just to try get the correct answer and avoid an overflow?