Skip to main content

Subtraction of Numbers

Complement of a Number   Octal and Hexadecimal Number   Convert Decimal to Binary

Subtraction of numbers by using complement


Subtraction with r’s Complements

The direct method of subtraction taught in elementary schools uses the borrow concept. In this method, we borrow a 1 from a higher significant position when the minuend digit is smaller than the corresponding subtrahend digit. This seems to be easiest when people perform subtraction with paper and pencil. When subtraction is implemented by means of digital components, this method is found to be less efficient than the method that uses complements and addition as stated below.

     The subtraction of two positive numbers (M - N), both of base r, may be done as follows:

1.       Add the minuend M to r’s complement of the subtrahend N.

2.       Inspect the result obtained in step 1 for an end carry:

a.       If the end carry occurs, discard it.

b.      If an end carry does not occur, take r’s complement of the number obtained in step 1 and place a negative sign in front.

If you don't understand about r's complement Click Complement of a Number

The following example illustrate the procedure:

Ex1. Using 10’s complement subtract 72532 – 3250

Sol. M = 72532, N = 03250

       10’s complement of N = 96750

       Now add M + 10’s complement of N

       72352 + 96750 = 1 69282, where 1 is end carry, discard it as per step 1

       Now the answer is 69282

Ex2. Subtract 3250 – 72352

Sol. M = 03250

        N = 72352

        10’s complement of N = 27468

        Now add M + 10’s complement of N

        03250 + 27468 = 30718, There we don’t have any carry then we find 10’s complement of result 30718

        Which is -69282

Ex3. Subtract binary numbers 1010100 – 1000100 using 2’s complement

Sol. M = 1010100, N = 1000100

       2’s complement of N = 0111100

       Now add M + 2’s complement of N

       1010100 + 0111100 = 1 0010000, where 1 is end carry, discard as per step 1

       Now the answer is 0010000 or 10000

Ex4. Subtract binary numbers 1000100 – 1010100

Sol.  M = 1000100, N = 1010100

         2’s complement of N = 0101100

        Now add M + 2’s complement of N

        1000100 + 0101100 = 1110000, here we don’t have any carry then we find 2’s complement of result 1110000

        Which is -10000

 

Subtraction with (r  -1)’s complement

The procedure for subtraction with the (r - 1)’s complement is exactly the same as the one used with the r’s complement except for one variation, called ‘end-around carry,’ as shown below. The subtraction of M-N, both positive numbers in base r, may be calculated in the following manner:

1.       Add the minuend M to (r - 1)’s complement of the subtrahend N.

2.       Inspect the result obtained in step 1 for an end carry.

a.       In an end carry occurs, add 1 to the least significant digit (end-around carry).

b.      If an end carry does not occur, take the (r - 1)’s complement of the number obtained in step 1 and place negative sign in front.

The following examples illustrate the procedure.

Note we are using same examples which we have discussed in r’s complement

Ex1. M = 72532, N = 03250

Sol. 9’s complement of N = 96749

        Now add M + 9’s complement of N

        72532 + 96749 = 1 69281, where 1 is end around carry, let’s add this 1 in 69281

        The answer is 69281 + 1 = 69282

Ex2. M = 03250, N = 72532

Sol. 9’s complement of N = 27467

        Now add M + 9’s complement of N

        03250 + 27467 = 30717, here we don’t have any carry, then we find 9’s complement of 30717

        9’s complement of 30717 is -69282

Ex3. M = 1010100, N = 1000100

Sol. 1’s complement of N = 0111011

        Now add M + 1’s complement of N

        1000100 + 0111011 = 1 0001111, where 1 is end-around carry, let’s add this 1 in 0001111

        The answer is 0001111 + 1 = 0010000

Ex4. M = 1000100, N = 1010100

Sol. 1’s complement of N = 0101011

        Now add M + 1’s complement of N

        1000100 + 0101011 = 1101111, here we don’t have any carry, then we find 1’s complement of 1101111

        1’s complement of 1101111 is -10000


Comments

Popular posts from this blog

Complement of a Number

Subtraction of Binary Numbers  ;  Octal and Hexadecimal Number  ;  Convert Decimal to Binary Complements Complements are used in digital computers for simplifying the subtraction operation and for logical manipulations. There are two types of complements for each base-r system: (1) the r’s complement and (2) the (r-1)’s complement. When the value of the base is substituted, the two types receive the names 2’s and 1’s complement for binary numbers,  10’s and 9’s complement for decimal numbers. The r’s Complement Given a positive number N in base r with an integer part of n digits, the r’s complement of N is defined as r n   - N for N is not equal to 0 and 0 for N = 0. The following numerical example will help clarify the definition. The 10’s complement of (52520) 10 is 10 5 – 52520 = 47480 The number of digits in the number is n= 5 The 10’s complement of (0.3267) 10 is 1 – 0.3267 = 0.6733 No integer part, so 10 n = 10 0 = 1 The 10’s...

mathematics skills

Are you ready to give your mathematics skills a boost? These simple math tricks can help you perform calculations more quickly and easily. They also come in handy if you want to impress your teacher, parents, or friends. 01 The Answer Is 2 Think of a number. Multiply it by 3. Add 6. Divide this number by 3. Subtract the number from Step 1 from the answer in Step 4. The answer is 2. Same Three-Digit Number Think of any three-digit number in which each of the digits is the same. Examples include 333, 666, 777, and 999. Add up the digits. Divide  the three-digit number by the answer in Step 2. The answer is 37. Six Digits Become Three Take any three-digit number and write it twice to make a six-digit number. Examples include 371371 or 552552. Divide the number by 7. Divide it by 11. Divide it by 13. The order in which you do the division is unimportant! The answer is the three-digit number. Examples: 371371 gives you 371 or 552552 gives you 552. A related trick is to take any three-di...

Types of Number System

Different Number Systems – There are some different Number System with correspondence base. Which will describe as follows-   Number System  Base  Representation  Binary Number System      2  (Number) 2  Decimal Number System      10  (Number) 10  Octal Number System      8  (Number) 8  Hexadecimal Number System     16   (Number) 16 Note : Any number can be in decimal form. So there is an another way to solve them quickly. Let’s understand with an example. Ex 1. (4064.10) 10   Sol. This Number can also be written as (4*10 3 ) + (0*10 2 ) + (6*10 1 ) + (4*10 0 ) + (1*10 -1 ) + (0*10 -2 ) Note that after decimal digits we will use decreasing power of 10 from left to right. Ex 2.   (1101.01) 2        Sol. This Number can also be written as (1*2 3 ) + (1*2 2 ) + (0*2 1 ) + (1*2 0 ) + (0*2 -1 ) + (0*2 -2 ) Exercise: From Ques...