In: Computer Science
a) Using Binary Signed Magnitude arithmetic, find the ‘sum’ of 5810 + (-2310). Show your work. (use 8 bits)
b) Using two’s complement binary arithmetic, find the sum of 45 and -16. Show your work. (use 8 bits)
a)Addition using 1's complement:-
Addition of the positive number with a negative number when the positive number has a greater magnitude.
Initially, calculate the 1's complement of the given negative number. Sum up with the given positive number. If we get the end-around carry 1, it gets added to the LSB.
(58)10 --------->(00111010)2
(-23)10----------->(-00010111)2
b)Addition using 2's complement:-
Case 1: Addition of the positive number with a negative number when the positive number has a greater magnitude.
Initially find the 2's complement of the given negative number. Sum up with the given positive number. If we get the end-around carry 1 then the number will be a positive number and the carry bit will be discarded and remaining bits are the final result.
(45)10---------------->(00101101)2
(-16)10----------------->(-00010000)2