carry and overflow flags
When you add two numbers on paper and the answer runs off the right side of the box you drew for it, you notice and frown. A processor has the same problem — its words are a fixed width — so the ALU emits a few one-bit warning lights, called condition flags, alongside every result. The most important four are zero (the result was all zeros), negative (the top bit, the sign bit, is 1), carry (a carry came out of the topmost column), and overflow (the signed answer is wrong because it could not fit). They are tiny but they carry the truth about whether the arithmetic actually held.
Carry and overflow sound similar but answer different questions, and confusing them is a classic beginner mistake. The carry flag is about unsigned arithmetic: it is set when the top column produces a carry-out, meaning the true unsigned sum needed one more bit than the word has. The overflow flag is about signed (two's complement) arithmetic: it is set when two same-sign numbers produce a result of the opposite sign, which can only happen if the real answer was out of the signed range. A neat rule for overflow: it occurs exactly when the carry into the sign bit differs from the carry out of it. The same addition can set carry, overflow, both, or neither, depending on how you choose to read the bits.
These flags exist so software can react. After a compare (which is just a subtraction whose result is thrown away but whose flags are kept) a conditional branch looks at the flags to decide which way to go: branch-if-equal tests the zero flag, branch-if-less tests a combination of negative and overflow. The honest point is that the hardware reports both interpretations and refuses to guess which you meant — it is your program's job, through which flag it tests, to declare whether these bits are signed or unsigned.
In 8-bit signed math, add 100 + 50. The true answer 150 exceeds the signed max of 127, the bits come out as minus 106, and overflow is set (two positives gave a negative). Read the same bits as unsigned and there is no carry-out, so the carry flag stays 0.
Carry watches unsigned range; overflow watches signed range. Same bits, two verdicts.
Carry is not overflow. Carry-out matters only for unsigned numbers; overflow matters only for signed numbers. A correct unsigned addition can set the overflow flag, and the hardware does not care — your code chooses which flag is relevant.