Complement Methods in Number Systems
(n−1)'s Complement Subtraction
- Find the complement of \( B \)
- Add it to \( A \)
- Handle carry accordingly
Example (9’s Complement)
$$ 725 - 348 $$
Step 1: 9’s complement of 348 → 651
Step 2: $$ 725 + 651 = 1376 $$
Step 3: $$ 376 + 1 = 377 $$
Final Answer: \( 377 \)
1’s Complement Example (Binary)
$$ A = 1011,\quad B = 0101 $$
Step 1: 1’s complement of \( B \):
\( 0101 \rightarrow 1010 \)
Step 2:
$$ 1011 + 1010 = 10101 $$
Step 3: End-around carry:
$$ 0101 + 1 = 0110 $$
Final Answer: \( 1011 - 0101 = 0110 \)
2’s Complement Example (Binary)
$$ A = 1011,\quad B = 0101 $$
Step 1: 2’s complement of \( B \):
1’s complement → \( 1010 \), add 1 → \( 1011 \)
Step 2:
$$ 1011 + 1011 = 10110 $$
Step 3: Ignore carry:
$$ 0110 $$
Final Answer: \( 1011 - 0101 = 0110 \)
Summary
- 1’s complement uses end-around carry
- 2’s complement ignores final carry
- 2’s complement is widely used in computers