Mastering 1s and 2s complement subtraction is an indispensable requirement for higher secondary computer application students, university candidates, and digital electronics engineers. In hardware systems, Arithmetic Logic Units (ALUs) do not feature separate circuitry for subtraction; instead, subtraction is performed by adding the complemented subtrahend to the minuend using standard binary adder circuits.
Building directly on our foundational guide on number system conversions: binary, octal, and hex and our processor breakdown in CPU architecture 32-bit vs. 64-bit, understanding complement arithmetic clarifies how signed numbers are stored and processed inside computer hardware.
1. Why Digital ALUs Rely on 1s and 2s Complement Subtraction
Constructing independent digital subtractor circuits with borrow-detection lines requires significant transistor overhead and introduces gate propagation delays. Modern processors eliminate this complexity by using 1s and 2s complement subtraction to convert a subtraction problem ($A – B$) into an addition problem:
A – B = A + (-B)
By representing the negative operand ($-B$) as a complement value, the CPU uses the same parallel full-adder logic units to execute both addition and subtraction, saving silicon area and boosting clock speeds as defined in the method of complements mathematical foundation.
2. Deriving 1’s and 2’s Complements of Binary Numbers
Before carrying out 1s and 2s complement subtraction, you must know how to transform positive binary integers into their complement forms:
- 1’s Complement: Invert each bit individually (change 0 to 1, and 1 to 0). For example, the 1’s complement of $(101100)_2$ is $(010011)_2$.
- 2’s Complement: Find the 1’s complement of the number and add 1 to the least significant bit (LSB):
2’s Complement = 1’s Complement + 1
Using $(101100)_2$: 1’s complement is $(010011)_2$. Adding $1$ gives $(010100)_2$. - Shortcut Rule for 2’s Complement: Reading the number from right to left (LSB to MSB), copy all bits unchanged up to and including the first 1; invert all remaining bits to the left.
Before finding any complement, you must ensure both numbers have an identical number of bits. If the minuend has 6 bits and the subtrahend has 4 bits, you must prefix the subtrahend with two leading zeros before taking its complement.
3. Rules for 1’s Complement Subtraction
When calculating $(A – B)$ using 1’s complement arithmetic, follow these steps:
- Ensure both $A$ and $B$ have the same bit-length.
- Find the 1’s complement of the subtrahend ($B$).
- Add the 1’s complement of $B$ to the minuend ($A$).
Case I: Minuend Greater than Subtrahend ($A > B$ → Carry Generated)
If an end-around carry is generated from the most significant bit, the result is positive. Add the carry bit back to the least significant bit (LSB) to obtain the final answer:
Minuend A = 1010
Subtrahend B = 0100 → 1’s complement of B = 1011
1010
+ 1011
——
1 0101 → (1 is End-Around Carry)
+ 1 → (Add carry back to LSB)
——
0110 → Result: +(0110)β = +6 in Decimal
Case II: Minuend Smaller than Subtrahend ($A < B$ → No Carry)
If no end carry is generated, the result is negative. Take the 1’s complement of the addition sum and attach a negative sign:
Minuend A = 0100
Subtrahend B = 1010 → 1’s complement of B = 0101
0100
+ 0101
——
1001 → (No End Carry generated; result is negative)
1’s complement of 1001 = 0110
Result: -(0110)β = -6 in Decimal
4. Rules for 2’s Complement Subtraction
Modern computers prefer 2’s complement subtraction because it avoids the extra addition step required by the end-around carry in 1’s complement:
- Equalize the bit count of both numbers.
- Find the 2’s complement of the subtrahend ($B$).
- Add the 2’s complement of $B$ to the minuend ($A$).
Case I: Minuend Greater than Subtrahend ($A > B$ → Carry Generated)
If an end carry occurs, the result is positive. Simply discard (omit) the carry bit:
Minuend A = 1101
Subtrahend B = 1001 → 2’s complement of B = 0111
1101
+ 0111
——
1 0100 → (Discard end carry bit)
Result: +(0100)β = +4 in Decimal
Case II: Minuend Smaller than Subtrahend ($A < B$ → No Carry)
If no carry bit is generated, the result is negative. Take the 2’s complement of the sum and prefix it with a negative sign:
Minuend A = 1001
Subtrahend B = 1101 → 2’s complement of B = 0111
1001
+ 0111
——
0000 (with no carry: sum = 10000? Let’s check 9 – 13 = -4)
1001 (9) + 0011 (2’s comp of 1101 is 0011):
1001
+ 0011
——
1100 → (No Carry; result is negative)
2’s complement of 1100 = 0100
Result: -(0100)β = -4 in Decimal
5. Signed Number Representation and the Dual Zero Problem
In digital computing, sign bits and representation methods lead to differences in numeric ranges between 1s and 2s complement subtraction architectures:
- The Dual Zero Problem in 1’s Complement: 1’s complement yields two distinct representations of zero: $+0$ ($00000000$) and $-0$ ($11111111$). This ambiguity complicates condition checks and comparison logic.
- Single Zero in 2’s Complement: Taking the 2’s complement of $00000000$ yields $00000000$ (with carry discarded), leaving only one unique zero.
- Asymmetric Range: For an $n$-bit register, 1’s complement covers $-(2^{n-1} – 1)$ to $+(2^{n-1} – 1)$, whereas 2’s complement covers $-2^{n-1}$ to $+(2^{n-1} – 1)$, allowing one additional negative integer without extra bits.
6. Technical Comparison: 1s vs. 2s Complement Subtraction
For board examinations and technical laboratory tests, review this direct comparison:
| Evaluation Metric | 1’s Complement Arithmetic | 2’s Complement Arithmetic |
|---|---|---|
| Derivation Formula | Invert all binary bits (NOT gate) | 1’s Complement + 1 |
| End Carry Handling (A > B) | Carry must be added back to LSB (End-Around Carry) | Carry is discarded |
| Negative Result (A < B) | Take 1’s complement of answer, prefix negative sign | Take 2’s complement of answer, prefix negative sign |
| Representations of Zero | Two ($+0$ and $-0$) | One unique zero ($00000000$) |
| Dynamic Range (8-Bit) | $-127\text{ to }+127$ | $-128\text{ to }+127$ |
| Hardware Efficiency | Slower due to dual-addition cycles | Faster; widely used in modern CPUs and ALUs |
7. WBCHSE Board Examination Practice Questions
Review these typical examination problems on 1s and 2s complement subtraction:
- Problem 1: Perform $(28)_{10} – (15)_{10}$ using 8-bit 2’s complement method.
Binary of $28 = 00011100$; Binary of $15 = 00001111$.
2’s complement of $15 = 11110001$.
Sum: $00011100 + 11110001 = (1) 00001101$. Discarding carry gives $(00001101)_2 = +13$. - Problem 2: Perform $(12)_{10} – (25)_{10}$ using 8-bit 1’s complement arithmetic.
Binary of $12 = 00001100$; Binary of $25 = 00011001$.
1’s complement of $25 = 11100110$.
Sum: $00001100 + 11100110 = 11110010$ (No carry generated).
1’s complement of $11110010 = 00001101$. Result is $-(00001101)_2 = -13$.
Conclusion
Mastering 1s and 2s complement subtraction simplifies digital arithmetic by unifying addition and subtraction within a single adder pipeline. Using 2’s complement eliminates redundant zeros and streamlines carry handling, making it the industry standard across modern microprocessors, digital signal processors, and high-performance ALUs.