Show work and explain the flags please Complete the followin
Solution
a. -7 +(-29)
7 = 000111
-7 = complement of 7 +1= 2\'s complement = 111000 + 1= 111001
29 = 011101
-29 = 2\'s complement of 29 = 100010 + 1 = 100011
carry-> 10000
-7 111001
+(-29)100011
----------------------
Overflow->1 011100 = -36
b.
31 +11
Both are positive numbers so there is no need of 2\'s complement(representation of negative numbers)
carry->11111
31 = 011111
11 = 001011
+
--------------------
Overflow->0 101010 = 42
c. 15-19
= 15+(-19)
15 = 001111
19 = 010011
-19 = 2\'s complement of 19 = 101100 + 1 = 101101
carry->01111
15 001111
+(-19) 101101
-----------------
overflow-> 0 111100 = -4
d. -7 *(-3)
7 = 000111
-7 = 111000+1 = 111001
3 = 000011
-3 = 2\'s complement of 3 = 111100+1 = 111101
-7 *(-3)
->111001
* 111101
----------------
10111001
000000*
111001**
111001***
111001****
111001*****
-----------------
010101---->last 6 bits = 21 (-7)*(-3)
e. -7 * 3
same as above except answer is negative -21
21 = 010101
its 2\'s complement = 101011 = -21
f
21/3
21 = 10101
3 = 11
11 | 10101 | 111
11
----
100
11
------
11
11
---
0
= 111 = 7
g
21 /(-3)
same as above except answer is negative = -7
-7 = 111001


