How to Subtract r-base Numbers Using Complements

 


In the decimal numbering system, the radix complement is called the ten's complement and the diminished radix complement the nines' complement. In binary, the radix complement is called the two's complement and the diminished radix complement the ones' complement.


Subtraction Using Complements can be done by two ways:


Subtraction Using r's Complement:


The subtraction of two positive numbers (M-N) both of base r can be done as follows;


  1.  Add the minuend M to the r's complement of subtracted N.
  2.  Inspect the result obtained in step 1 for end carry.

  • If end carry occurs, discard it.

  • If end carry doesn't occur, take r's complement if the number obtained in step 1 and place a negative sign in front.

For decimal numbers:

Example: Subtract (72532-3250) using 10's complement.


M= 72532

N= 03250


10's complement of N= 105-3250 = 96750


Now, adding 10's complement of N to M,

72532+96750=169282

Here, end carry occurs as 1. So, 10's complement= 69282



For binary numbers:


Example: Subtract (1000100-1010100) using 2's complement.


M= 1000100


N= 11010100


2's complement of N=10110


Now, adding 2's complement of N to M


10110+1000100= 110000


Here, end carry occurs as 1, so 2's complement = -10000

 

Subtraction Using r-1's Complement:

 

The subtraction of two positive numbers (M-N) both of base r-1 can be done as follows;

  1.  Add the minuend M to the r-1's complement of subtracted N.
  2.  Inspect the result obtained in step 1 for end carry.

  • If end carry occurs, add 1 to the least significant bit, i.e. end-around carry.

  • If end carry doesn't occur, take r-1's complement of the number obtained in step 1 and place a negative sign in front.


For decimal number:

Example: Subtract (453.35-321.17) using 9's complement.

9's complement of 321.17= 678.82

Now, Adding 9's complement of M to N,

453.35+678.82= 1132.17


Here, end carry occur, so 9's complement = 132.18


For binary numbers:


Example Subtract (1000100-1010100) using 1's complement.


M= 1000100


N= 11010100


1's complement of N=101011


Now, adding 1's complement of N to M


101011+1000100= 1101111


Here, end carry doesn't occur as 1, so 1's complement of 1101111= -1000 which is the required answer.





You can use a great app that can help you with Number Systems and Boolean algebra, This app will give you all the answers to your question. Download the "Logic Kit" app on App Store to solve any problem in these subjects. Click  here to download the app.







Previous Post Next Post

Contact Form