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

With 4 - bit 2's complement arithmetic, which of the following additions will result in overflow ?
(i) 1100 + 0100
(ii) 1100 + 1111
(iii) 0101 + 0100
(iv) 1010 + 1100

The correct answer is
(iii) and (iv)

Understanding 4-Bit 2's Complement Overflow

This question asks us to identify which additions performed using 4-bit 2's complement arithmetic result in an overflow. Overflow occurs when the outcome of an arithmetic operation is outside the range that can be represented by the given number of bits.

In 4-bit 2's complement representation, the range of numbers is from $-(2^{4-1})$ to $(2^{4-1} - 1)$, which is -8 to +7.

A key rule for detecting overflow in signed number addition is:

  • Overflow occurs if the addition of two operands with the same sign bit results in a value with the opposite sign bit.
  • Specifically: Adding two positive numbers yields a negative result, OR adding two negative numbers yields a positive result.

Analyzing 4-Bit Additions

Addition (i): 1100 + 0100

First, let's determine the values represented by the binary numbers:

  • $1100$: The sign bit is 1, indicating a negative number. To find its magnitude, we take the 2's complement: invert bits ($0011$) and add 1 ($0100$), which is 4. So, $1100$ represents -4.
  • $0100$: The sign bit is 0, indicating a positive number. It directly represents +4.

Now, let's perform the addition:

  1  
  1100 
(-4)
+    0100 
(+4)
-------
10000

Discarding the carry-out bit (the 5th bit), the 4-bit result is $0000$, which represents 0.

We added a negative number (-4) and a positive number (+4). The result is 0. Since the sign bits of the operands were different (1 and 0), overflow does not occur.

Addition (ii): 1100 + 1111

Values:

  • $1100$ represents -4.
  • $1111$: The sign bit is 1. 2's complement: invert ($0000$) + 1 = $0001$, which is 1. So, $1111$ represents -1.

Addition:

  1  
  1100 
(-4)
+    1111 
(-1)
-------
11011

Discarding the carry-out bit, the 4-bit result is $1011$.

$1011$: Sign bit is 1. 2's complement: invert ($0100$) + 1 = $0101$, which is 5. So, $1011$ represents -5.

We added two negative numbers (-4 and -1). The result (-5) is negative. Since the sign bits were the same (1 and 1) and the result's sign bit is also 1, no overflow occurred.

Addition (iii): 0101 + 0100

Values:

  • $0101$ represents +5.
  • $0100$ represents +4.

Addition:

    0101 
(+5)
+    0100 
(+4)
-------
  1001

The 4-bit result is $1001$.

$1001$: Sign bit is 1. 2's complement: invert ($0110$) + 1 = $0111$, which is 7. So, $1001$ represents -7.

We added two positive numbers (+5 and +4). The expected result is +9. However, the 4-bit result $1001$ represents -7. Since two positive numbers resulted in a negative number, overflow occurred.

Addition (iv): 1010 + 1100

Values:

  • $1010$: Sign bit is 1. 2's complement: invert ($0101$) + 1 = $0110$, which is 6. So, $1010$ represents -6.
  • $1100$ represents -4.

Addition:

  1  
  1010 
(-6)
+    1100 
(-4)
-------
10110

Discarding the carry-out bit, the 4-bit result is $0110$.

$0110$: Sign bit is 0, representing a positive number. It directly represents +6.

We added two negative numbers (-6 and -4). The expected result is -10. However, the 4-bit result $0110$ represents +6. Since two negative numbers resulted in a positive number, overflow occurred.

Conclusion on Overflow

Based on the analysis:

  • Addition (i) resulted in 0. No overflow.
  • Addition (ii) resulted in -5. No overflow.
  • Addition (iii) resulted in -7 (representing +9). Overflow occurred.
  • Addition (iv) resulted in +6 (representing -10). Overflow occurred.

Therefore, additions (iii) and (iv) result in overflow.

Was this answer helpful?

Important Questions from Number Representation

  1. What is the full form of EBCDIC?

  2. The 2's complement representation of the number (-100)10 in an 8 bit computer is

  3. Consider the values A = 2.0 × 1030, B = -2.0 × 1030 C = 1.0. Assume, that the floating point numbers are represented with 32 bits. What are the values of X and Y, when the following sequence of operations are executed on a computer?

    X = A + B

    Y = A + C

    X = X + C

    Y = Y + B

  4. The 32-bit IEEE 754 single precision representation of a number is 0xC2710000. The number in decimal representation is ________. (rounded off to two decimal places)
  5. Which of the following pairs of octal and binary numbers are NOT equal?

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