Carry Look-ahead Adder

To reduce the computation time, engineers devised faster ways to add two binary numbers by using carry look-ahead adders. They work by creating two signals (P and G) for each bit position, based on if a carry is propagated through from a less significant bit position (at least one input is a '1'), a carry is generated in that bit position (both inputs are '1'), or if a carry is killed in that bit position (both inputs are '0'). In most cases, P is simply the sum output of a half-adder and G is the carry output of the same adder. After P and G are generated the carries for every bit position are created. Some advanced carry look ahead architectures are the Manchester carry chain, Brent-Kung adder, and the Kogge-Stone adder.

image

Therefore, for 4-bit adder,

image

And the corresponding schematic is illustrated in the below figure,

image

The worst-case propagation delay of 4-bit Carry Look-ahead Adder is 5∆t, and the propagation delay of a 4-bit Ripple-Carry Adder is 9∆t. Therefore, the Carry Look-ahead Adder is faster than Ripple-Carry Adder.


//Edit by Ray@SEU.IC

//Jan 10th, 2011

//Ver. 1.0

module Carry_Look_Ahead_Adder(A,B,Cin,Sum, Cout);

input [3:0] A,B;

input Cin;

output [3:0]Sum;

output Cout;

wire Cout_0,Cout_1,Cout_2;

wire [3:0] P, G;

assign P[0]=A[0]^B[0];

assign P[1]=A[1]^B[1];

assign P[2]=A[2]^B[2];

assign P[3]=A[3]^B[3];

assign G[0]=A[0]&B[0];

assign G[1]=A[1]&B[1];

assign G[2]=A[2]&B[2];

assign G[3]=A[3]&B[3];

assign Sum[0]=P[0]^Cin;

assign Cout_0=G[0]|P[0]&Cin;

assign Sum[1]=P[1]^(G[0]|P[0]&Cin);

assign Cout_1=G[1]|P[1]&G[0]|P[1]&P[0]&Cin;

assign Sum[2]=P[2]^(G[1]|P[1]&G[0]|P[1]&P[0]&Cin);

assign Cout_2=G[2]|P[2]&G[1]|P[2]&P[1]&G[0]|P[2]&P[1]&P[0]&Cin;

assign Sum[3]=P[3]^(G[2]|P[2]&G[1]|P[2]&P[1]&G[0]|P[2]&P[1]&P[0]&Cin);

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]&Cin;

endmodule


image

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值