Carry Look-Ahead Adder
Medium · Combinational · SystemVerilog
Design a parameterized N-bit carry look-ahead adder that exposes the full carry-chain intermediate signals as output ports.
**Primary outputs**
{sum} is the N-bit result of {a} $+$ {b} $+$ {cin}, taken modulo $2^N$.
{cout} is the carry out of bit $N-1$: it is $1$ when the true arithmetic result of {a} $+$ {b} $+$ {cin} is greater than or equal to $2^N$, and $0$ otherwise.
{overflow} detects signed two's-complement overflow. It equals the XOR of the two most-significant carry bits:
$\text{overflow} = \text{carry\_chain}[N] \oplus \text{carry\_chain}[N-1]$