Suppose A and B are signed numbers, find the logic expression of the overflow flag when A and B are added. R = result. (Hint: Recall that overflow happens to signed addition if and only if 1) adding two positives and getting a negative, or 2) adding two negatives and getting a positive.)
A = a31a30a30…a2a1a0
B = b31b30b30…b2b1b0
R = r31r30r30…r2r1r0
Recall that overflow happens to signed addition if and only if
1) adding two positives and getting a negative
if you assume carry of kth bit is ck, This case arises when ck-1 is 1 and ck is 0
2) adding two negatives and getting a positive.
If a ck-1 = 0 , then the only way that 1 can be carried out is if xk-1 = 1 and yk-1 = 1. That way, the sum is 0, and the carry out is 1. This is the case when you add two negative numbers, but the result is non-negative
from these two cases Overflow can be written as O =
Get Answers For Free
Most questions answered within 1 hours.