4
\$\begingroup\$

I am implementing a 32 bit CLA Adder like how a 16 bit adder is implemented in Wikipedia

Problem is how do I determine if the block overflows? I will need the carry into bit 32 (which is now in the last 4 bit CLA Adder) and XOR with carry out of bit 32(Check difference in MSB)?

UPDATE

Is my overflow logic correct

where Cin is the carry into the whole 16 bit block, P* is the Block Propagate, G* the block generate, and carry into bit 32 (typo, bit 16 MSB actually)

\$\endgroup\$
1
\$\begingroup\$

I thought about seeing what my brain could regurgitate of long ago explnatins, as opposed to commin sense observations, BUT here's a page which does it all very well indeed.

They explain a "nice" 'trick'.

  • Two's compelment overflow detection can be achieved by XORing the carry-in and the carry-out bo=its of the leftmost full adder.

Their diagram. See above ref for detailed comment:

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ Thats a 1 bit adder, the problem with using a >1 bit adder is that the carry into the MSB is hidden somewhere in the adder itself. Hope you got me? I could have an output for my block adder for Cin to MSB but that seems off place? Alternatively, I could have evey block output an Overflow bit, is this the usual implementation? It will give quite abit redundant logic \$\endgroup\$ – Jiew Meng Oct 23 '11 at 13:22
  • \$\begingroup\$ The last stage output is the XOR of the two inputs and the carry in; thus the carry in is the xor of the two inputs and the output. \$\endgroup\$ – supercat Sep 15 '15 at 16:46
1
\$\begingroup\$

If you are designing the CLA (carry lookahead adder) block, you could have the block output the carry from the bit 2 digit (which must already be calculated in order to form the correct value for bit 3 of the sum).

If the CLA block interface is a given, you can derive overflow from the sign bits of the two adder inputs, A(31) and B(31), and the sign bit of the output sum. If A and B are the same sign, the sum sign must match them iff there is no overflow. For more detail, see this page or this page.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.