How does the OV(Overflow flag) of the 8051 work and how does it differentiate between signed and unsigned digits?
The operations for signed and unsigned numbers are the same, but signed numbers overflow between bit 6 and 7, while unsigned numbers overflow between bit 7 and 8.
The OV flag represents the overflow into bit 7, while the CY flag represents the overflow into bit 8, so for a signed operation, you'd check the OV flag, while for an unsigned operation you'd check the CY flag after the operation.