2082 6

BIT151 · 2082 · 5 marks

Subtract (1197)10 from (1234)10 using the 999's complement and 10's complement methods.

Subtract $(1197){10}$ from $(1234){10}$ using the 999's complement and 10's complement methods. [5]

Microprocessor and Computer ArchitectureChapter 4: Arithmetic and Logical OperationsNines complement and tens complement methodsNumerical: 9's and 10's complement subtraction

Subtraction Using 9's and 10's Complement Methods

"Subtract $(1197){10}$ from $(1234){10}$" means the minuend is 1234 and the subtrahend is 1197, so the value wanted is $1234 - 1197$. Both numbers have four digits, so every complement below is taken to four digits.

9's complement method

The 9's complement of the subtrahend is found by subtracting each digit from 9:

$$9999 - 1197 = 8802$$

Adding this to the minuend replaces the subtraction:

$$1234 + 8802 = 10036$$

  1 2 3 4
+ 8 8 0 2
---------
1 0 0 3 6   (carry out of the most significant digit)

A carry out of the most significant digit tells us the result is positive. In the 9's complement method that carry is not simply discarded: it is added back into the least significant digit, which is why the rule is called the end around carry.

$$0036 + 1 = 0037$$

Therefore $1234 - 1197 = +37$.

10's complement method

The 10's complement is one more than the 9's complement:

$$8802 + 1 = 8803$$

$$1234 + 8803 = 10037$$

  1 2 3 4
+ 8 8 0 3
---------
1 0 0 3 7   (carry out of the most significant digit)

Here the carry is simply discarded rather than added back, because the extra 1 has already been built into the complement. What remains is the answer directly.

Therefore $1234 - 1197 = +37$, agreeing with the 9's complement method and with ordinary decimal subtraction.

Summary

MethodComplement of 1197SumCarry out?Handling of the carryResult
9's complement880210036YesAdded back to the least significant digit$+37$
10's complement880310037YesDiscarded$+37$

Had the operands been the other way round, $1197 - 1234$, no carry would have been produced, and the rule for that case is to recomplement the sum and attach a minus sign, which gives $-37$.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.