Binary arithmetic - overflow and carryout at same time? In binary arithmetic, When you subtract 2 signed numbers you must discard the carry out. My question is, is it possible for overflow to occur and a carry out? So, on paper there would be two extra bits and you would have to discard one?
Also, if your subtracting 2 signed numbers, how do you differentiate between overflow and a carry out?
 A: Overflow and carry out are philosophically the same thing. Both indicate that the answer does not fit in the space available.  The difference is that carry out applies when you have somewhere else to put it, while overflow is when you do not.  As an example, imagine a four bit computer using unsigned binary for addition.  If you try to add $1010_2+111_2$ without the word length restriction, you get $10001_2$  The high bit does not fit in our word.  If this word is all the space allocated to this variable, it represents overflow as the result is too large to represent. If we have a two word space allocated to this variable, it becomes a carry out and is stored in the higher word.  We would then represent the addition as $0000\ 1010_2+0000\ 0111_2=0001\ 0001_2$ and the carry is explicit.
A: When you subtract two signed numbers, the Carry flag is irrelevant; the Overflow flag is all that counts. The Carry flag is for unsigned integer operations. So there is only ever one bit to worry about.
A: Yes, you can have an overflow and a carry flag in the same operation. This is because an overflow flag is hooked up to an XOR gate, where the inputs are the carries from the two bits on the left. The carry flag gets triggered if there is a carry on the left most bit (the signed bit for signed numbers). So if you have a carry on the left most bit, but not on the one second from the left, you have an overflow and a carry. If you have a carry on the bit second from the left and not on the left most bit, you have only an overflow.
Here's a picture of an adder/subtractor where the V is the overflow, and the C is the carry. Each bit of the sum is calculated using a full adder, and each bit may have a carry. V is an XOR gate connected to the two left most carries.

What the overflow represents is when an operation causes the sum to fall outside the maximum or minimum bounds. For example, with an 8 bit signed operation, the maximum number of the sum is 255. while the minimum is -256.
So if you try to do 255 + 1 (01111111 + 00000001) you get an overflow. Notice how there was a carry on the second bit from the left, but not the left most. The sum comes out as -256, which is wrong.
An example where you get both an overflow and a carry would be -64 + (-256) (11000000 + 10000000). There is a carry on only the left most bit. The sum comes out as 64, which is wrong.
An example where you get only a carry would be -64 + 64 (11000000 + 01000000). There is a carry on both the left most and second from the left. The sum comes out as zero, which is right.
A: In processors, overflow flag indicates that sign bit has been changed during adding or subtracting operations But carry flag means adding or subtracting two registers has carry or borrow bit.
