Hi Friend,
The answer is signed numbers go out of their range after an arithmetic operation, The overflow flag is set during arithmetic operations when the resulting number of bits will not fit (including the twos complement bit) in the register of the arithmetic logic unit (ALU).Computers have a limited number of bits to perform math directly in the CPU. This can be overcome to some degree by software that detects these overflows and moves information to other memory locations, allowing for some HUGE numbers, but in general, most math in a computer is limited to the ranges specified by the various types, and that maximum range for that type. So that if you add two large integer values and the result exceeds the number of bits that the ALU can handle the overflow flag is set.
Overflow Flag (O) – This flag will be set (1) if the result of a signed operation is too large to fit in the number of bits available to represent it, otherwise reset (0). After any operation, if D[6] generates any carry and passes to D[7] OR if D[6] does not generates carry but D[7] generates, overflow flag becomes set, i.e., 1. If D[6] and D[7] both generate carry or both do not generate any carry, then overflow flag becomes reset, i.e., 0.
Example: On adding bytes 100 + 50 (result is not in range -128…127), so overflow flag will set.