Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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)

share|improve this question

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
1  
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 – Jiew Meng Oct 23 '11 at 13:22

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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