Related Concepts: 1.01 Positional Number Systems & Base Conversions | 1.03 Signed Representation, Overflow & Two’s Complement | 2.04 Error Control, Parity Generators & Checkers
1.02 Base Complements & Subtraction Mechanics
Overview
Complement arithmetic allows computers to perform subtraction using only addition operations. This eliminates the need for physical subtraction circuitry, enabling a single binary adder circuit to perform both addition and subtraction.
1. Formal Mathematics of Complements
For a positive number represented in base with an integer part of digits and a fractional part of digits, we define two types of complements.
1.1 The Radix Complement (‘s Complement)
The radix complement (‘s complement) of a number in base is defined as:
Binary Implementation (2’s Complement, )
For a binary integer (), the 2’s complement of an -bit number is .
- Pencil-and-Paper Shortcut: Starting from the right (Least Significant Bit), copy all bits up to and including the first
1exactly as they are. Then, invert all remaining bits to the left.
Decimal Implementation (10’s Complement, )
For a decimal integer, the 10’s complement of is .
- Pencil-and-Paper Shortcut: Subtract the least significant non-zero digit from , and subtract all other digits to the left from .
1.2 The Diminished Radix Complement (‘s Complement)
The diminished radix complement (‘s complement) of a number in base is defined as:
If has no fractional part (), this simplifies to:
Binary Implementation (1’s Complement, )
For a binary integer, the 1’s complement of is .
- Pencil-and-Paper Shortcut: Simply invert every single bit of the binary string ( and ).
Decimal Implementation (9’s Complement, )
For a decimal integer, the 9’s complement of is .
- Pencil-and-Paper Shortcut: Subtract each individual digit of the number from .
Key Relationship:
(For integers, ‘s complement is simply the ‘s complement plus 1 in the LSB position).
1.3 Comparison Table: Radix vs. Diminished Radix Complements
| Feature | Radix (‘s) Complement | Diminished Radix (‘s) Complement |
|---|---|---|
| Mathematical Definition | (for ) | |
| Binary Equivalent () | 2’s Complement | 1’s Complement |
| Decimal Equivalent () | 10’s Complement | 9’s Complement |
| Mathematical Relationship | ’s Complement = ‘s Complement | ‘s Complement = ‘s Complement |
| Ease of Hardware Generation | Slightly harder (requires an addition step in the LSB). | Very easy (requires only inverting NOT gates in binary). |
| Complement Subtraction Carry Action | Discard overflow carry (). | End-Around Carry (add back to LSB). |
| Representation of Zero in Binary | Single unique representation (0000...0000). | Two representations: (0000...0000) and (1111...1111). |
2. Complement Subtraction Mechanics
Subtraction of two numbers in base is executed by adding the complement of the subtrahend {the number being taken away, } to the minuend {the number being taken from, } (PYQ 2015, 2018, 2019 — 9 to 13 marks).
graph TD Sub["Subtraction M - N"] --> Pad["Pad M and N to Equal n-bit Length"] Pad --> Method{"Complement Type"} Method -->|r's Complement| Add2["Add M + r's Comp of N"] Add2 --> Carry2{"Carry generated?"} Carry2 -->|Yes: Cout = 1| Disc2["Discard Carry. Result is Positive & in True Form"] Carry2 -->|No: Cout = 0| Neg2["Result is Negative. Take r's Comp of Sum & add - sign"] Method -->|r-1's Complement| Add1["Add M + (r-1)'s Comp of N"] Add1 --> Carry1{"Carry generated?"} Carry1 -->|Yes: Cout = 1| EndAround["End-Around Carry: Add 1 to LSB. Result is Positive"] Carry1 -->|No: Cout = 0| Neg1["Result is Negative. Take (r-1)'s Comp of Sum & add - sign"]
2.1 The Radix (‘s) Complement Subtraction Algorithm ()
- Pad both and with leading zeros so they have the exact same number of digits ().
- Compute the ‘s complement of the subtrahend : .
- Add the minuend to the complement:
- Check the end carry digit ():
- Case A: Carry Occurs () Discard the carry (which mathematically subtracts ). The remaining digits represent the correct positive result:
- Case B: No Carry Occurs () The result is negative. The remaining digits are in their complemented form. To find the true magnitude, take the ‘s complement of the sum and prefix a negative sign:
3. Step-by-Step Worked Subtraction Examples
There are two distinct outcomes to drill, and the examiner has asked for both. Case 1 is (no carry, negative answer); Case 2 is (carry generated, positive answer). Most students only practise one and lose marks on the other — especially the end-around carry step, which only ever appears in Case 2.
Case 1: — No Carry, Negative Result
Worked Exam Problem (PYQ 2018, 2019 — 9 to 10 marks)
Question (2019, verbatim): Perform the subtraction with the following binary numbers using (i) 2’s complement and (ii) 1’s complement. Check the answer by straight subtraction. .
Let (Decimal ) and (Decimal ).
- Step 1: Pad to equal bit length (8-bit standard):
Part A: Subtraction Using 2’s Complement (‘s complement)
- Find 2’s Complement of ():
- 1’s complement =
- Add 1 to LSB =
- Add :
00000100 (M) + 11010000 (2's Comp of N) ---------- 0 11010100 (Sum) ^ Cout = 0 (No Carry) - Evaluate Result:
Since , the result is negative and in 2’s complement form.
- Take 2’s complement of the sum ():
- 1’s complement =
- Add 1 to LSB = (Decimal )
- Prefix a negative sign.
- Take 2’s complement of the sum ():
Part B: Subtraction Using 1’s Complement (‘s complement)
- Find 1’s Complement of ():
- 1’s complement =
- Add :
00000100 (M) + 11001111 (1's Comp of N) ---------- 0 11010011 (Sum) ^ Cout = 0 (No Carry) - Evaluate Result:
Since , the result is negative.
- Take 1’s complement of the sum ():
- 1’s complement = (Decimal )
- Prefix a negative sign.
- Take 1’s complement of the sum ():
Part C: Verification by Straight Subtraction
Since , perform using direct binary borrowing:
110000 (N = 48)
- 000100 (M = 4)
--------
101100 (Result = 44)Prefixing the negative sign and padding to 8-bit gives . All three methods yield the same result.
Notice what did not happen here
Because no carry was generated, the 1’s complement answer needed no end-around carry. Students who have only ever seen this case walk into the exam not knowing the end-around step exists. Case 2 below is where it fires.
Case 2: — Carry Generated, Positive Result
Worked Exam Problem (PYQ 2015 — 13 marks)
Question (verbatim): Perform the subtraction with the following binary numbers using (i) 2’s complement and (ii) 1’s complement. Check the answer by straight subtraction: .
Let (Decimal ) and (Decimal ). Pad both to 7 bits:
Part A: Using 2’s Complement — discard the carry
- 2’s complement of : 1’s complement of is ; add 1 .
- Add:
1110110 (M) + 1111001 (2's Comp of N) ---------- 1 1101111 (Sum) ^ Cout = 1 (Carry generated) - Evaluate: A carry occurred, so discard it. The remaining 7 bits are the answer in true positive form.
Part B: Using 1’s Complement — add the carry back (End-Around Carry)
- 1’s complement of : invert every bit of .
- Add:
1110110 (M) + 1111000 (1's Comp of N) ---------- 1 1101110 (Sum) ^ Cout = 1 - End-Around Carry: in 1’s complement you must not throw the carry away — add it back into the LSB:
1101110 + 1 (End-around carry) --------- 1101111
Part C: Verification by Straight Subtraction
1110110 (M = 118)
- 0000111 (N = 7)
---------
1101111 (Result = 111)All three methods agree.
The one rule that decides everything
Look only at the carry out of the MSB:
Carry = 1 Carry = 0 2’s complement Discard carry → answer is positive, read directly Answer is negative → re-complement the sum, add minus sign 1’s complement Add carry back to LSB → answer is positive Answer is negative → re-complement the sum, add minus sign Memory hook: 2’s complement throws the carry away, 1’s complement recycles it.
4. Non-Decimal Base Multiplication
Performing arithmetic directly in bases other than decimal is a common exam requirement.
Worked Exam Problem (PYQ 2024 — 08 marks)
Question (verbatim): Multiply the following numbers in the given base without converting to decimal. (i) and , (ii) and .
Part (ii) is solved first because it has no radix point; part (i) adds the fraction handling.
4.1 Part (ii):
Direct Octal Arithmetic Rule: Perform standard digit-by-digit multiplication. When a product exceeds the base (), divide the product by . Record the remainder in the current column and carry the quotient to the next column.
Step-by-Step Multiplication:
-
Multiply by (first digit of multiplier):
- with remainder (write 3, carry 4)
- with remainder (write 2, carry 4)
- with remainder (write 3, carry 2)
- First partial product:
-
Multiply by (second digit of multiplier):
- Second partial product: (shifted left one space)
-
Multiply by (third digit of multiplier):
- with remainder (write 1, carry 6)
- with remainder (write 0, carry 6)
- with remainder (write 3, carry 3)
- Third partial product: (shifted left two spaces)
-
Add the partial products in Base-8:
002323 003670 + 330100 -------- 336313- Column 0:
- Column 1: rem (write 1, carry 1)
- Column 2: rem (write 3, carry 1)
- Column 3: (write 6)
- Column 4: (write 3)
- Column 5: (write 3)
4.2 Part (i): — Handling the Radix Point
The fraction trick: do not try to multiply fractional digits in place. Instead:
- Ignore both radix points and multiply the digit strings as whole numbers.
- Count the total number of fractional digits in the two operands ( here).
- Place the radix point that many digits from the right of the product.
This works for any base, because shifting a radix point places is just multiplying by , and the two shifts cancel at the end.
Step 1 — strip the points: .
Step 2 — partial products (base-6 rule: on each digit product, divide by 6, write the remainder, carry the quotient):
Multiply by :
- write , carry
- write , carry
- write , carry
- write
- Partial product 1:
Multiply by (shift left one place):
- write , carry
- write , carry
- write , carry
- write
- Partial product 2: (shifted one place)
Multiply by (shift left two places):
- write , carry
- write , carry
- write , carry
- write , carry write
- Partial product 3: (shifted two places)
Step 3 — add the partial products in base-6:
0003152
0045500
+ 1034400
----------
1131452- Col 0:
- Col 1:
- Col 2: write , carry
- Col 3: write , carry
- Col 4: write , carry
- Col 5:
- Col 6:
Step 4 — restore the radix point (2 fractional digits total, counted from the right):
Sanity check (for your own confidence only — never write this in the answer script, the question forbids converting): , , product ; and . ✓
Exam Traps in Non-Decimal Multiplication
- The question says “without converting to decimal.” Converting to decimal, multiplying, and converting back will lose most of the marks even if the final number is right. Show the digit-by-digit carries.
- Every digit you write must be . A "" or "" in a base-6 answer is an instant error signal.
- Carry the quotient, write the remainder — students routinely do it the other way round under time pressure.
- Fractional digits are counted, not computed. One fractional digit in each operand always gives two in the product.
Past Year Questions (PYQs)
Question (as asked) Years Marks Solved in Subtract using 2’s and 1’s complement, check by straight subtraction 2015 13 §3 Case 2 Subtract using 2’s and 1’s complement, check by straight subtraction 2018 9 §3 Case 1 (same method) Subtract using 2’s and 1’s complement, check by straight subtraction 2019 10 §3 Case 1 Multiply and without converting to decimal 2024 8 §4.1, §4.2 Pattern to notice: the subtraction question appears in three of the last ten papers and always demands all three methods (2’s complement, 1’s complement, straight subtraction). Answering with only one method caps you at roughly a third of the marks.