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 1 exactly 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

FeatureRadix (‘s) ComplementDiminished Radix (‘s) Complement
Mathematical Definition (for )
Binary Equivalent ()2’s Complement1’s Complement
Decimal Equivalent ()10’s Complement9’s Complement
Mathematical Relationship’s Complement = ‘s Complement ‘s Complement = ‘s Complement
Ease of Hardware GenerationSlightly harder (requires an addition step in the LSB).Very easy (requires only inverting NOT gates in binary).
Complement Subtraction Carry ActionDiscard overflow carry ().End-Around Carry (add back to LSB).
Representation of Zero in BinarySingle 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 ()

  1. Pad both and with leading zeros so they have the exact same number of digits ().
  2. Compute the ‘s complement of the subtrahend : .
  3. Add the minuend to the complement:
  4. 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)

  1. Find 2’s Complement of ():
    • 1’s complement =
    • Add 1 to LSB =
  2. Add :
       00000100   (M)
     + 11010000   (2's Comp of N)
     ----------
     0 11010100   (Sum)
     ^
     Cout = 0 (No Carry)
  3. 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.

Part B: Subtraction Using 1’s Complement (‘s complement)

  1. Find 1’s Complement of ():
    • 1’s complement =
  2. Add :
       00000100   (M)
     + 11001111   (1's Comp of N)
     ----------
     0 11010011   (Sum)
     ^
     Cout = 0 (No Carry)
  3. Evaluate Result: Since , the result is negative.
    • Take 1’s complement of the sum ():
      • 1’s complement = (Decimal )
    • Prefix a negative sign.

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

  1. 2’s complement of : 1’s complement of is ; add 1 .
  2. Add:
       1110110   (M)
     + 1111001   (2's Comp of N)
     ----------
     1 1101111   (Sum)
     ^
     Cout = 1 (Carry generated)
  3. 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. 1’s complement of : invert every bit of .
  2. Add:
       1110110   (M)
     + 1111000   (1's Comp of N)
     ----------
     1 1101110   (Sum)
     ^
     Cout = 1
  3. 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 = 1Carry = 0
2’s complementDiscard carry → answer is positive, read directlyAnswer is negative → re-complement the sum, add minus sign
1’s complementAdd carry back to LSB → answer is positiveAnswer 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:

  1. 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:
  2. Multiply by (second digit of multiplier):

    • Second partial product: (shifted left one space)
  3. 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)
  4. 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:

  1. Ignore both radix points and multiply the digit strings as whole numbers.
  2. Count the total number of fractional digits in the two operands ( here).
  3. 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)YearsMarksSolved in
Subtract using 2’s and 1’s complement, check by straight subtraction201513§3 Case 2
Subtract using 2’s and 1’s complement, check by straight subtraction20189§3 Case 1 (same method)
Subtract using 2’s and 1’s complement, check by straight subtraction201910§3 Case 1
Multiply and without converting to decimal20248§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.