The subtraction performed in the example above contained the subtrahend the number we subtract) less than minuend (the number that subtracts the other number ). Now you know that subtraction might contain subtrahend greater than the minuend .On those situations the subtraction method will become less efficient .The make it easier additive approach known as complementary subtraction is used.
In order to understand complementary subtraction, we need to know what complement of a number means. For a number, which has digit numbersital in it a complement is the difference between the number and the base raised to the nth power minus one.
When the value of the base r is substituted in the name, the name types becomes2’s and 1’s complement for binary numbers and 10’s and 9’s complement for decimal numbers.
In the example above, we have 1 in the right most position so we place 1 in the right most position and then invert the remaining bits.
This can be illustrated using the following example.
No comments:
Post a Comment