What is purpose of the overflow bit? What is signed, 2s complement representation?
The purpose of the overflow bit is to indicate that the result of an arithmetic operation could no longer be represented in the available number of bits. For example. Consider your inputs to be 4-bit binary numbers using two’s complement representation. Thus the following… Binary Decimal 0000 = 0 0001 = 1 0010 = 2 0011 = 3 0100 = 4 0101 = 5 0110 = 6 0111 = 7 1000 = -8 1001 = -7 1010 = -6 1011 = -5 1100 = -4 1101 = -3 1110 = -2 1111 = -1 The MSB is the sign bit… 0 = positive, 1 = negative. To find the magnitude (absolute value) of a negative number, simply take the 2s complement of it. Positive numbers do not require any conversion. Thus… it is possible to add 2 positive 4 bit numbers and the resulting 4 bit number can be negative. For example 5 0101 +4 0100 —- —– 9 1001 (with a carry of zero) Notice that 1001 is not 9 but actually -7, an incorrect result. Therefore an overflow is generated in this case. The same situation is potentially possible when adding 2 negative number