Share |

Solved Problem - Binary Subtraction

Question

Perform the following sums using binary numbers:

  1. 75-42
  2. -75-42
  3. -75-(-42)

 

Answer

First we choose to use 8-bit true magnitude format. In this format:

+75 = 01001011 ; +42 = 00101010

 

1.01001011+75 in true magnitude format
+110101102's complement of +42
________
00100001this is +33 in true magnitude format
2.101101012's complement of +75
+110101102's complement of +42
________
10001011sign bit is 1 so perform 2's complement
011101012's complement of last line
11110101replace sign bit
________
11110101-117 in true magnitude format
3.-75-(-42) = -75+42 = 42-75 and so
00101010+42 in true magnitude format
+101101012's complement of +75
________
11011111sign bit is 1 so perform 2's complement
001000012's complement of last line
10100001replace sign bit
________
10100001-33 in true magnitude format