Carry Look-Ahead Adder
Medium · Combinational · SystemVerilog · VHDL
A premium problem. Subscribe to open it in the editor, run the testbench and see where your design lands.
Design a parameterized carry look-ahead adder that also exposes its generate, propagate, and carry signals.
cout and sum together form the (N+1)-bit value of a + b + cin: sum is the low N bits and cout is the carry out of bit N-1. overflow is 1 when, with a and b read as two's-complement, a + b + cin does not fit in sum.
gen[i] = a[i] & b[i] and prop[i] = a[i] ⊕ b[i]. carry_chain[i] is the carry into bit i of the addition, so carry_chain[0] = cin and carry_chain[N] = cout.
This module is combinational.
- Arithmetic