1

I am trying to solve the following using two's complement in binary form.

7.5 - 6.75

7.5 - 6.75 can be rewritten as (7.5)+(-6.75)

taking binary of decimal numbers

7.5 = 111.1

6.75 = 110.11

-6.75= 001.00

Now where should I add 1, to the left of "."(period) or to the right?

Martin Thorsen Ranang
  • 2,241
  • 1
  • 30
  • 43
  • 001.01 Please refer to http://stackoverflow.com/questions/15463491/how-to-represent-a-negative-number-with-a-fraction-in-2s-complement – Paris Nelson Aug 20 '13 at 18:55

1 Answers1

1

To perform the subtraction of signed numbers (M – N) with 2’s complements proceed as follows:

  1. The number of digits of M and N should be the same.
  2. Obtain the 2’s complement of N (including the sign bit).
  3. Add the 2’s complement of N to M (including the sign bit).
  4. If the summation produces an end carry. Discard the end carry. After the end carry is discarded, the leftmost bit is the sign bit.
    • If the sign bit is 0, the result is positive,
    • If the sign bit is 1, the result is negative.
  5. If the summation does not produce an end carry, the leftmost bit is the sign bit.

To Produce 2's compliment:

The 2’s complement of the subtrahend 10001 = 01111

1 1 1 1 carry bits
1 0 0 1 1
+ 0 1 1 1 1
1 0 0 0 1 0
Since the summation produces an end carry the result is positive.
Discard the end carry; the result is a positive number.