1

Let's say that

0011 + 0111 = 1010

How to detect whether the operation generate carry and overflow?

Bilis
  • 125
  • What do you mean by carry and overflow? There are several ways of defining those. You need to be more precise. – vladimirm Aug 15 '14 at 13:16
  • You might be interested in the arithmetic flags set by CPUs and machine level instructions that access or depend on those flags. However that is more of a programming topic than a mathematical (even though it needs to be consistent to be useful). – hardmath Aug 15 '14 at 13:44

1 Answers1

0

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

Axel Kemper
  • 4,943