Using a 4-bit 2's complement arithmetic, which of the following ad...
Only (ii) is the answer.
In 2's complement arithmetic, overflow happens only when
1. Sign bit of two input numbers is 0, and the result has sign bit 1
2. Sign bit of two input numbers is 1, and the result has sign bit 0.
Overflow is important only for signed arithmetic while carry is important only for unsigned arithmetic.
A carry happens when there is a carry to (or borrow from) the most significant bit. Here, (i) and (iii) cause a carry but only (ii) causes overflow.
View all questions of this test
Using a 4-bit 2's complement arithmetic, which of the following ad...
Explanation:
To determine whether an addition will result in an overflow, we need to consider the range of values that can be represented in 4-bit 2's complement arithmetic.
In 4-bit 2's complement arithmetic, the range of values that can be represented is -8 to +7. The leftmost bit (most significant bit) is the sign bit, where 0 represents a positive number and 1 represents a negative number.
i. 1100 + 1100
When we add these two numbers, we get:
1100
+ 1100
--------
1 1000
The leftmost bit in the result is 1, indicating a negative number. However, since the leftmost bit (sign bit) does not match the next most significant bit, there is no overflow in this addition. Therefore, option i does not result in an overflow.
ii. 0011 + 0111
When we add these two numbers, we get:
0011
+ 0111
--------
1010
The leftmost bit in the result is 1, indicating a negative number. However, the leftmost bit (sign bit) does not match the next most significant bit. This indicates an overflow in the addition. Therefore, option ii results in an overflow.
iii. 1111 + 0111
When we add these two numbers, we get:
1111
+ 0111
--------
1 0110
The leftmost bit in the result is 1, indicating a negative number. However, since the leftmost bit (sign bit) does not match the next most significant bit, there is no overflow in this addition. Therefore, option iii does not result in an overflow.
Conclusion:
Based on the analysis above, only option ii (0011 + 0111) results in an overflow. Therefore, the correct answer is option 'B' (ii only).
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).