Talk:Carry look-ahead adder

From Wikipedia, the free encyclopedia

Contents

[edit] More editing needed

The section with all the logic formulae has been copied verbatim from a textbook without proper thought being given to it. For example, the logic diagram refers to "the previous diagram" when there isn't one. The constant tone of "this is really complicated, children, so don't worry about it" doesn't belong in an enyclopaedia entry, especially since CLA is really rather simple.

I've deleted the whole section on CLA requiring O(n^2) logic gates or O(n^3) transistors because it's quite simply wrong.

JoeBruno (talk) 09:28, 7 April 2008 (UTC)

[edit] Real life

No one uses this basic form of CLA in real life. I've started a page on kogge-stone, though. Perhaps we should just do one on prefix adders in general. There is a school with some very good slides on prefix adders. PSU copied their kogge-stone diagram for a homework assignment. The homework assignment is one of the top hits for kogge-stone if anyone is interested in looking. —The preceding unsigned comment was added by 141.213.66.199 (talk • contribs) 20:57, 19 September 2006 (UTC)

[edit] Bad examples

The examples given have errors, please double check, i.e. does not make sense!

Let's try a little experiment. Here is a series of numbers. See how long it takes you to find the most significant digit (the number to the far left).

 345678987 + 6543210123456

The most significant digit is 9. How can we tell? We can look at the far left digits being added. 3 + 6 = 9. If we were to add 1 to this value, the most significant digit would be 1 (9 + 1 = 10). So, we have to look at the digit to the right of this one, to see if there is a carry. Do the same for the following problem: —The preceding unsigned comment was added by 66.129.224.36 (talkcontribs) 18:32, 28 September 2006 (UTC)


Thanks for the description of method - it was really easy to understand after that!

Matty2002 (talk) 11:31, 21 November 2007 (UTC)

[edit] "or" or "xor" to calculate P

Article says:

For binary arithmetic, or is faster than xor and takes less transistors to implement, and therefore P(A,B) is usually used instead of P^{\prime}(A,B).

Surely as the full adder calculates A xor B as part of its process, it's more efficient to use that partial result (which is then xored with the resulting carry to give the output of the adder) than add an extra or gate? 87.75.164.162 21:00, 19 October 2006 (UTC)

Efficient, yes. But not as fast, which is the main deal. —Preceding unsigned comment added by 141.213.52.83 (talk • contribs)

Why not as fast? The xor must be calculated anyway before the output can stabilise, so surely there's no additional delay from using its results for the propogate signal? Or does the propogate signal need to be produced faster than the output signal? JulesH 09:29, 10 March 2007 (UTC)

[edit] Verilog implementation

I've got an implementation of a 4-bit CLA adder in verilog. Does anyone think it would be a useful addition to the article? 87.75.164.162 21:53, 19 October 2006 (UTC)

       // pgadder is a full adder that generates propogate & generate outputs
       // rather than a carry bit
       module pgadder (a, b, c, o, p, g);

       input a, b, c;
       output o, p, g;

       assign g = a & b;       // generate a carry bit if a & b are both 1
       assign p = a ^ b;       // propogate a carry bit if either a or b is 1

       assign o = p ^ c;       // output is a^b^c.
 
       endmodule
       // main module
       module cla_adder_4 (a, b, c_in, out, c_out);

       input [3:0] a, b;       // input to sum
       input c_in;             // carry in
       output [3:0] out;       // output
       output c_out;           // carry out

       wire [3:0] out;         // used to connect adder output to our output
       wire c_out;             //            "                 "

       wire [3:0] c;           // carry bits from look-ahead to adders
       wire [3:0] p;           // propogate bits from adders to look-ahead
       wire [3:0] g;           // generate bits from adders to look-ahead

       // adders
       pgadder pga0 (a[0], b[0], c[0], out[0], p[0], g[0]);
       pgadder pga1 (a[1], b[1], c[1], out[1], p[1], g[1]);
       pgadder pga2 (a[2], b[2], c[2], out[2], p[2], g[2]);
       pgadder pga3 (a[3], b[3], c[3], out[3], p[3], g[3]);

       // carry prediction
       assign c[0] = c_in;
       assign c[1] = g[0] | p[0]&c_in;
       assign c[2] = g[1] | p[1]&g[0] | p[1]&p[0]&c_in;
       assign c[3] = g[2] | p[2]&g[1] | p[2]&p[1]&g[0] | p[2]&p[1]&p[0]&c_in;
       assign c_out = g[3] | p[3]&g[2] | p[3]&p[2]&g[1] | p[3]&p[2]&p[1]&g[0] 
                           | p[3]&p[2]&p[1]&p[0]&c_in;

       endmodule