Electronic – Overflow detection in a CSA (Carry-save Adder)

digital-logicintegrated-circuitmathverilog

How do you detect overflow when you have a CSA?

I have 3 16-bit two's complement inputs and a 16-bit output and I'm wondering how do I detect overflow?

Best Answer

In a carry-save adder there are three inputs and two outputs. Many different output-pairs represent the same number. Carry-save adders have no carry-propagation overhead, so they are good for adding together many operands at low latency, but the cost for that speed is that you don't really know anything about the result (even whether it is positive or negative) until you add the final two outputs together using a "normal" adder (e.g. ripple-carry, carry-select, carry-skip, or carry-lookahead.)

I know of no way to determine overflow just by looking at most significant bits (like you can in an adder that carries.) For example, here's an example that overflows in 3-bit 2's complement (3+3-2 = 4).

  0 1 1     (3)
  0 1 1     (3)
  1 1 0     (-2)
  -----
  1 1 0     (-2)
0 1 1       (6)

And another with all the same most significant bits that doesn't overflow:

  0 1 1     (3)
  0 1 1     (3)
  1 0 1     (-3)
  -----
  1 0 1     (-3)
0 1 1 0     (6)