CompilerDesign
October 6, 2023DigitalLogicDesign
October 6, 2023DigitalLogicDesign
Question 3

Using a 4bit 2’s complement arithmetic, which of the following additions will result in an overflow?
1. 1100 +1100 2. 0011 +0111 3. 1111 +0111
1 only


2 only


3 only


1 and 3 only

Question 3 Explanation:
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.
So, only (2) causes overflow.
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.
So, only (2) causes overflow.
Correct Answer: B
Question 3 Explanation:
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.
So, only (2) causes overflow.
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.
So, only (2) causes overflow.
Subscribe
Login
0 Comments