Carry Look Ahead Adder Verilog Code | 16 bit Carry Look Ahead Adder Verilog Implementation

Carry Look Ahead Adder Verilog Code

16 bit Carry Look Ahead Adder

Carry look ahead adder is a fast adder architecture.  In Ripple Carry Adder output carry depends on previous carry . But in carry look ahead adder the output carry is function of input bits and initial carry only. So output carry is calculated with combinational logic without waiting for previous carry.  For more information about carry look ahead adder you can refer to this wikipedia article.

A carry-lookahead adder (CLA) or fast adder is a type of adder used in digital logic. A carry-lookahead adder improves speed by reducing the amount of time required to determine carry bits. It can be contrasted with the simpler, but usually slower, ripple carry adder for which the carry bit is calculated alongside the sum bit, and each bit must wait until the previous carry has been calculated to begin calculating its own result and carry bits (see adder for detail on ripple carry adders). The carry-lookahead adder calculates one or more carry bits before the sum, which reduces the wait time to calculate the result of the larger value bits.

Basic structure of 4-bit Carry Look Ahead Adder is shown below.

carry_lookahead_adder

 

The Verilog Code for 16-bit Carry Look Ahead Adder is given below-

 

16 bit Carry Look Ahead Adder Testbench

 

Carry Look Ahead Adder Simulation Result is as follows:

carry_look_ahead_simulation

 

carry_look_ahead

Cadence RTL compiler is used to synthesize the verilog  code with Uofu standard library.  We got the following schematic after mapping the hdl code to the standard library. This is basically the synthesized view.

carry

 

If you have any query/suggestion please feel free to comment below the post.

0 0 vote
Article Rating
Subscribe
Notify of
guest
5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Miles
Miles
2 years ago

In 4-bit carry look ahead, one line is incorrect:

**incorrect** assign cout= g[3] | (p[3]&g[2]) | p[3]&p[2]&g[1] | p[3]&p[2]&p[1]&p[0]&c[0];
**Corrected** assign cout= 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[0];

This was probably a typographical error, but I want to point it out for anyone having trouble using this code

Mohammad Abidur Rahman
Mohammad Abidur Rahman
1 year ago
Reply to  admin

I did it. code is correct

monika Dnayneshwar kedar
monika Dnayneshwar kedar
6 months ago
Reply to  admin

I am trying this code in the Xilinx_ISE_DS_Win_14.7_1015_1 but iam not getting the ouput.

Mathieu Martel
Mathieu Martel
5 days ago

Code is wrong and testbench is very poor quality for testing no wonder there are bugs in design you need to fix your main 16bit adder. Person below linked edaplayground code, you can modify it and see it doesnt work. A=3635, B=77d4 testbench should get correct answer of 0ae09 but the dut returns 0ad09. Top-level 16bit should not send carry from 4bit to each other in c1c2c3c4, you need to reuse carry select unit logic to generate c0 c1 c2 c3 instead with p and g from 4-bit adders.