All Exams Test series for 1 year @ ₹349 only
Question

In computers, subtraction is generally carried out by

The correct answer is

2’s complement

Understanding Subtraction in Computer Systems

In digital computers, arithmetic operations like subtraction are fundamental. While addition is straightforward using binary adders, direct subtraction can be complex, especially when dealing with negative numbers.

To simplify the hardware design and allow subtraction to be performed using addition circuits, computers commonly employ a method based on complements. Complement representation allows us to represent negative numbers and perform subtraction by adding the complement of the subtrahend (the number being subtracted) to the minuend (the number from which subtraction is done).

Why Use Complements for Subtraction?

  • Simplifies Hardware: Instead of building separate circuits for subtraction, the same adder circuit used for addition can perform subtraction when numbers are represented using complements.
  • Handles Negative Numbers: Complements provide a way to represent negative numbers in binary form.

Comparing Different Complement Methods

For binary systems (which computers use), the relevant complement methods are 1's complement and 2's complement. For decimal systems, 9's complement and 10's complement are used.

1's Complement

The 1's complement of a binary number is found by inverting every bit (0 becomes 1, and 1 becomes 0). Subtraction is performed by adding the 1's complement of the subtrahend to the minuend. If there is an end-around carry (a carry out of the most significant bit), it is added to the least significant bit of the result.

However, 1's complement has a drawback: it has two representations for zero (+0 and -0), which complicates arithmetic logic.

2's Complement

The 2's complement of a binary number is found by adding 1 to its 1's complement. This is the most widely used method for representing signed numbers and performing subtraction in computers.

To perform subtraction using 2's complement: A - B is calculated as A + (2's complement of B). Any carry generated out of the most significant bit is simply discarded.

Here's why 2's complement is preferred:

  • Unique Zero Representation: Unlike 1's complement, 2's complement has only one representation for zero.
  • Simpler Arithmetic: Addition and subtraction can be performed using the same hardware logic, and end-around carry is not required for subtraction.

Let's illustrate with an example:

Subtract 5 from 8 using 4-bit binary (8 - 5):

  • 8 in binary is 1000
  • 5 in binary is 0101

Find the 2's complement of 5 (0101):

  • 1's complement of 0101 is 1010
  • Add 1: 1010 + 1 = 1011 (This is the 2's complement of 5)

Now add 8 and the 2's complement of 5:

$$ \begin{array}{@{}c@{\,}c@{}c@{}c@{}c} & 1 & 0 & 0 & 0 & \quad (8) \\ + & 1 & 0 & 1 & 1 & \quad (\text{2's complement of } 5) \\ \hline \text{Carry} \rightarrow & 1 & 0 & 0 & 1 & 1 \end{array} $$

The result is 0011 after discarding the carry. 0011 in binary is 3, which is the correct result of 8 - 5.

10's and 9's Complement

These are complement methods used in decimal systems, not the binary systems used by typical computers. Therefore, they are not used for subtraction in standard computer arithmetic units.

Conclusion on Computer Subtraction

Based on the efficiency and simplicity of hardware implementation, along with the unique representation of zero, 2's complement is the standard method used in computers for performing subtraction.

Comparison of Complement Methods for Subtraction
Method System How Subtraction A - B is Done Carry Handling Zero Representation
1's Complement Binary A + (1's complement of B) End-around carry added Two ( +0, -0)
2's Complement Binary A + (2's complement of B) Carry discarded One (0)
9's Complement Decimal A + (9's complement of B) End-around carry added Two (+0, -0)
10's Complement Decimal A + (10's complement of B) Carry discarded One (0)

Revision Table: Key Concepts

Key Concepts in Computer Arithmetic
Term Explanation
Binary Number System A base-2 system using only digits 0 and 1, fundamental to computers.
Complement A mathematical operation used to simplify subtraction and represent negative numbers in digital systems.
1's Complement Inverting all bits of a binary number.
2's Complement 1's complement plus 1; standard for signed binary arithmetic.
Subtrahend The number being subtracted.
Minuend The number from which another is subtracted.

Additional Information on Computer Subtraction and Complements

The choice of 2's complement for representing signed numbers and performing arithmetic is one of the cornerstones of modern computer architecture. It leads to efficient and fast arithmetic logic units (ALUs) within the CPU.

The range of numbers that can be represented using n bits in 2's complement is from $-(2^{n-1})$ to $(2^{n-1} - 1)$. For example, with 8 bits, numbers from $-(2^{8-1}) = -128$ to $(2^{8-1} - 1) = 127$ can be represented.

Understanding complements is crucial for studying digital logic design, computer organization, and assembly language programming, as arithmetic operations are foundational to how programs execute.

Was this answer helpful?

Important Questions from Number Representation

  1. Which of the following pairs of octal and binary numbers are NOT equal?

  2. The greatest negative number which can be stored in a 8-bit register using 2's complement arithmetic is

  3. Which of the following codes is also known as reflected binary code?

  4. What is the octal equivalent of (F3B1)16?

  5. The 1's complement of binary number 10010 is

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App