Nines complement subtraction

When you are doing arithmetic by hand because your calculator’s batteries just gave up and your laptop is in the other room, it’s best if you can check your calculations with a different process than you had used in the first place. By using a different process for checking your work, you very much diminish any chance of your making the same error twice.

For checking subtractions, the use of nines complement arithmetic offers just that advantage

We all learned how to do subtraction in elementary school. A few illustrative examples of that process are shown in Figure 1. The only thing specially selected about these examples is that they are each with a different number of significant digits just to show that the processes of subtraction apply to each and every one of them.

Figure 1 Rudimentary subtraction examples.

Now envision yourself having worked day and night, you’re burning the midnight oil and you’re bleary and utterly exhausted. Pushing on like the trooper you are, there are some scraps of paper in front of you on which you have done some subtraction calculations and you want to check some of those penciled in numbers. There is a way to do that which will minimize the possibility of you repeating any error just in case you’ve made one because the procedure and steps you take next will not be the same procedures and steps you’d already used.

The first step is to replace each numeral in the smaller number with its nines complement. The nines complement is that number which when added to the original number adds up to nine. Thus, the nines complement of 3 is 6, the nines complement of 7 is 2 and so on. You then add that nines complemented number to the original larger number (Figure 2).

Figure 2 Adding to the nines complemented number.

The most significant digit of this first sum will always be 1. It will never be anything else no matter how many significant digits you’re working with.

Next, you slide that most significant 1 down and underneath the least significant digit of your intermediate sum and do another addition (Figure 3).

Figure 3 The slide and add step.

The result of this second addition will always be equal to the result of the straight subtraction process.

If the number of significant digits of the smaller original number is less than the number of signficant digits of the larger original number, we rewrite that smaller number with leading zeros. Normally, we don’t write those leading zeroes, but we will do it here. Then, knowing that the nines complement of zero is nine, we proceed in exactly the same fashion as described above and we get exactly the correct result.

Figure 4 Using Leading Zeros when the smaller number has less significant digits.

John Dunn is an electronics consultant, and a graduate of The Polytechnic Institute of Brooklyn (BSEE) and of New York University (MSEE).

Related articles:

Thinking in math
Engineering writing instruction takes a math-based approach
10 free math analysis and design tools for engineers
Use math tools in your engineering designs







googletag.cmd.push(function() { googletag.display(‘div-gpt-ad-native’); });

The post Nines complement subtraction appeared first on EDN.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *