Consider the following two 8 bit binary numbers. A=10001000 and B=01111001 Deter
ID: 1932930 • Letter: C
Question
Consider the following two 8 bit binary numbers. A=10001000 and B=01111001 Determine the decimal equivalent for A and B assuming they are both unsigned binary numbers (0 =>255 decimal) and the equivalent 2's compliment numbers (-128 => +127). Calculate A+B, A-B and B-A. Also, using 2's compliments, calculate A+(-B) and B+(-A) and compare your answers. If a resulting answer is negative (most significant bit = 1), take the two's compliment of that result to determine it's positive equivalent. Also check all of your answers by converting the results to decimal and verifying they are correct.Explanation / Answer
A=10001000 and B=0111 1001 assuming unsigned value of A=136 value of B=121 assuming signed value of A=-120 value of B=121 b) assuming unsigned A+B=0000 0010(257) i.e. overflow A+B=(0000 0010) 2 A-B=(0000 1111)15 B-A=-15(11110001) c) A+(-B) =(1000 1000)+(10000111) =(0000 1111)=15 B+(-A) =(0111 1001)+(0111 1000) =(1111 0001)=-15 d)