The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+4 votes
465 views
The condition for overflow in the addition of two 2's complement numbers in terms of the carry generated by the two most significant bits is ___________.
asked in Digital Logic by Veteran (42.9k points) | 465 views

What would have been the condition for overflow, if instead of "in terms of the carry generated", the question had asked for "in terms of the carry propagated"?

2 Answers

+5 votes
Best answer

The condition for overflow in the addition of two 2's complement numbers in terms of the carry generated by the two most significant bits is when carry on MSB but not From MSB, or Carry from MSB but not on MSB. i.e.,

$$C_{out} \oplus C_{n-1} = 1.$$

i.e. For overflow to happen during addition of two numbers in 2's complement form

They must have same sign and result is of opposite sign

Overflow occurs if

1. (+A) + (+B) = −C

2.(−A) + (−B) = +C

PS: Overflow is useful for signed numbers and useless for unsigned numbers

answered by Veteran (55.6k points)
selected by
explain with example na iam not getting what u have said plzzzzzzzzzzzzzzzz

Vishal, Overflow is the condition when result produced by addition cannot be stored in space allocated. Say You Want to add $2$, 4-bit numbers, then if result produced after addition is 5-bit, then we cannot fit the result in 4-bit, And we say Overflow has happened.

In 2's complement representation $0111 = (7)_{10}$ And performing addition : $0111 + 0111$. Result obtained is $1110 = (-2)_10$, in 2's complement representation not $14$ which should be answer. But there is not way we could represent $14$ in 2's complement representation in 4-bits. So Overflow.

+2 votes

condition for overflow in terms of carry generated $C_{out}$ =  $C_{out} \bigoplus C_{n-1}$

answered by Veteran (10.8k points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,157 questions
36,985 answers
92,166 comments
34,824 users