I can add, sub, mult and divide them and in each case determine if the result would no longer “fit” in the defined datatype… To me that is Over/Undeflow (depending on the operation)
But I have a calculator that seems to indicate BOTH Carry and Overflow in some cases
I dont know if multiplication could generate an overflow without a carry
Carry is usually just the high bit rolling out 0x8 + 0x8 -> 0x10
Overflow is, usually, the result of any result thats too large
And it could be several bits that roll out 0x8 * 0x8 -> 0x40
so no carry but does overflow
I cant think of any case where you could have carry but NOT overflow
well overflow can also happen in + and underflow in -
I dont think they are mutually exclusive 0x8 * 0x2 -> 0x10
which I think would be both carry & overflow
Theoretically, at binary level (0/1), a Carry should be a one bit spill (the carry) you can recover and use, an Overflow should be more than 1 bit, and the result you get may be uncertain due to such “big” loss (as 2 bits ).
In a 4 bit register :
1111 + 1111 = (1 carry) 1101
// 15+15 or 15 * 2 results the same,
// MAYBE the firmware may consider 15 * 2 overflow + carry due to the spill not being
// caused by a sum/subtraction. You should observe the behavior being copied
Between 1985 and 1987, arithmetic overflow in the Therac-25radiation therapy machines, along with a lack of hardware safety controls, caused the death of at least six people from radiation overdoses.[23]
An unhandled arithmetic overflow in the engine steering software was the primary cause of the crash of the 1996 maiden flight of the Ariane 5 rocket.