### Complementing Numbers:

09/03/2001

#### Significance of Complementing Numbers:

• Why:
• This an area that we don't normally give much thought to, even though we have no trouble understanding it. First, let's explain why this concept is so important. From a tender age we are taught the subtraction process, but for some reason it isn't until much later that we are taught that adding a negative number is the same as subtraction. In fact, I have run across not a few folks who don't remember ever being taught that as a skill.
• Now, for the point of discussion, consider an important device, with which we can do basic addition but cannot do basic subtraction. We would certainly find ourseves in a quandry with this limitation. Consider that for early computers where every part of a computer was terribly expensive, and having to build a subtractor as well as an adder would be a significant expense.
• Now if we could design a system where a number could be easily converted to a negative equivelant, and then simply added, we have accomplished subtaction with an adder. This is a considerable savings because we only need one adding device, rather than an adder and a subtractor.
• How do we get a Complementing Number:
• Because in this instance we will be dealing with the "decimal" system, we need to limit ourselves to the numbers 0-10 and 0-9.
• Consider that the number "0" is at the opposite end of the "decimal" range where the other number is "10".
• We say that the "10's Complement" is obtained by simply subtracting the original number from 10.
• We also say that the "9's Complement" is obtained by simply subtracting the original number from 9.
•  Original # 10's Comp Original # 9's Comp 0 10 0 9 1 9 1 8 2 8 2 7 3 7 3 6 4 6 4 5 5 5
• How do we use Complementing Numbers (they allow us to to perform subtraction by adding them):
• We know that we can subtract 2 from 6 and get 4, but consider adding the complement of 2 (which is 8) to 6.
• In adding the 8 to 6 we would get 14, but when we subtract by adding complements we throw away the carry.
• Now I know that all of this sounds either terribly silly or useless, but it is actually terribly significant. Most important of all is that it works, and if all we have is devices that will only add, then that makes it all the more important.

#### Self-Complementing Codes:

• The real reason for all of this last part of the presentation, is that since we are dealing with Binary Computing Systems, we need to consider that there was a real need for simple methods of obtaining binary number compliments.
• There were a number of mainframe computers that were developed for business computations, and were developed along the line of Binary configured in Decimal - called basically "Binary Coded Decimal" (BCD).
• As a result there were a series of special binary numerical systems, otherwise known as various forms of special BCD values or variants. Each one was designed to serve a special purpose to fill a particular need.
• The BCD Excess-3, the BCD 2'421, and the BCD 5'421 were just a few of those that made serious efforts to solve some of the dilemas.
• The BCD Excess-3 and the 2'421 codes allowed direct 9's Complement by simple inversion, and also provided automatic rounding up for any number 5 or above.
• However, each number system, in the attempt to solve the problem to allow a "binary digital system" to do decimal arithmetic brought their own problem into the fray.
• Now for those of you who think that all this has been a lot of drivel or a bunch of nonsense, you are very much mistaken. The problem still exists!