24 votes 24 votes The addition of $4-bit$, two's complement, binary numbers $1101$ and $0100$ results in $0001$ and an overflow $1001$ and no overflow $0001$ and no overflow $1001$ and an overflow Digital Logic gateit-2006 digital-logic number-representation normal isro2009 + – Ishrat Jahan asked Oct 31, 2014 edited Jun 19, 2018 by Pooja Khatri Ishrat Jahan 14.3k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Mk Utkarsh commented Aug 2, 2018 i edited by Hira Thakur Nov 2, 2023 reply Follow Share $\left ( 1101 \right )_2 = (-3)_{10}$ $\left ( 0100 \right )_2 = (+4)_{10}$ A positive and a negative number will never result in an overflow 8 votes 8 votes jatinmittal199510 commented Apr 11, 2021 reply Follow Share Overflow condition can be written in any of the three ways – $C_{n} \oplus C_{n-1}=1$ which says that either 1st MSB or 2nd MSB should give carry but not both. $A_{n}B_{n}\bar{C_{n-1}} + \bar{A_{n}}\bar{B_{n}}C_{n-1}=1$ where $A_n$ and $B_n$ are the MSB (which are sign bits) and $C_{n-1}$ is the carry from the 2nd MSB. $A_{n}B_{n}\bar{R_{n}} + \bar{A_{n}}\bar{B_{n}}R_{n}=1$ where $R_{n}$ is the MSB (sign bit) of result of the addition. From the third condition above, we can see that overflow will happen when: 1. $A_n,B_n$ is 0 (which means positive numbers) and $R_n$ is 1 (which means a negative number). 2. $A_n,B_n$ is 1 (which means both are negative numbers) and $R_n$ 0 (which means a positive number). Conclusion: For overflow to happen, two positive numbers are added and the result is negative OR two negative numbers are added and the result is positive. In the above question, one number is positive and the other is negative so there will be no overflow in the resulting number and the sum will be simply $0001$, Overflow = $0$, Carry = $1$. PS: 2nd result can be derived from 1st result by replacing the value of $C_n$ with $A_nB_n + C_{n-1}(A_n \oplus B_n)$ and 3rd result can be derived from the 2nd result by thinking a bit. Let me know if you find it difficult to derive it. 2 votes 2 votes Please log in or register to add a comment.
Best answer 63 votes 63 votes Answer: C. The addition results in $0001$ and no overflow with $1$ as carry bit. In 2's complement addition Overflow happens only when: Sign bit of two input numbers is $0$, and the result has sign bit $1$. Sign bit of two input numbers is $1$, and the result has sign bit $0$. Rajarshi Sarkar answered Apr 12, 2015 edited Jun 26, 2018 by Milicevic3306 Rajarshi Sarkar comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments LRU commented Dec 2, 2021 reply Follow Share Thanks. I got it now. 1 votes 1 votes Overflow04 commented Oct 26, 2022 reply Follow Share @Kabir5454 @ankitgupta.1729 I am forgetting a small concept, when we do the 2’s complement of the given negative number and then do the addition. In above e.g we are directly adding. 0 votes 0 votes Abhrajyoti00 commented Oct 26, 2022 reply Follow Share @GateOverflow04 When you are asked to perform binary subtraction, say $A-B$. Then you take the 2’s complement of $B$, then it becomes $(-B)$. After that we perform addition of $A+(-B)$ to get the required result of $A-B$In above eg, they are asking the addition of two binary numbers already in 2's complement from. So no need to take 2's complement. Here you just do simple addition and check if Carry In = Carry Out -> No overflow. Else overflow 2 votes 2 votes Please log in or register to add a comment.
1 votes 1 votes when ever positive and negative no is added it may cause over flow kvkumar answered Jun 26, 2016 1 flag: ✌ Low quality (abir_banerjee) kvkumar comment Share Follow See 1 comment See all 1 1 comment reply raja11sep commented Dec 2, 2021 reply Follow Share Addition of positive and negative number can never cause an overlow. 1 votes 1 votes Please log in or register to add a comment.
–3 votes –3 votes 2's complement of 1101 is 0011 2,s complement of 0100 is 1100 now we add 0011 nd 1100 gives 1111 so it doesnot give any extra bit in carry so no overflow nd convert 1111 in original form of no 0001 so (c) option is correct saket nandan answered Jun 16, 2015 saket nandan comment Share Follow See 1 comment See all 1 1 comment reply BishalPrashant00 commented Dec 20, 2018 reply Follow Share Can we calculate the 2's complement of a positive no. as you mentioned? So, far my knowledge is concerned 2's complement notation of a positive no. is the no. itself. Can you please help me with this 1 votes 1 votes Please log in or register to add a comment.