How to detect carry and overflow?

624 Views Asked by At

Let's say that

0011 + 0111 = 1010

How to detect whether the operation generate carry and overflow?

1

There are 1 best solutions below

0
On BEST ANSWER

You can distinguish three carry-related functions per bit position:

Generate:
Carry for the bit position is set regardless of the next lower carry-in

Propagate:
Carry-in is forwarded to carry-out

Kill:
Carry-out is $0$ regardless of carry-in

If you are asking for overflow, you basically talk about the carry-out of the most-significant bit (MSB) position. If this MSB carry-out is $1$, the bitlength of the input operands is exceeded.

A description copied from lecture slides:

enter image description here