The Arithmetic and Logic Unit (ALU) performs arithmetic operations (add, subtract, increment, decrement) and logic operations (AND, OR, XOR, NOT, shifts). An n-bit ALU is commonly built from n identical bit-slices. In each slice, a multiplexer driven by function-select lines chooses which operation's result reaches the output, so k select lines can choose among at most 2k operations. Subtraction is done by adding the 2's complement, so the adder is the core of the arithmetic side and its carry chain sets the ALU's speed. The two adder designs to know are the ripple-carry adder (little hardware, slow) and the carry look-ahead adder (more hardware, fast).
Convention used throughout (unless a question says otherwise): numbers are in 2's complement. Bits are numbered 0 (LSB) to n−1 (MSB), C0 is the carry into bit 0 and Cn is the final carry-out. A full adder (FA) takes Ai,Bi,Ci and produces Si and Ci+1 a fixed delay after its inputs are stable. All delays are worst case. When delays are counted in gates, each gate (including XOR) counts as 1 gate delay and fan-in is unlimited. If a question gives its own figures, use those.
SUBTRACTION AND OVERFLOW (2'S COMPLEMENT)
A−B=A+B+1 (use C0=1),V=Cn⊕Cn−1
An adder/subtractor passes each Bi through an XOR gate with a mode line M and sets C0=M: M=0 adds and M=1 subtracts. V=1 signals signed (2's complement) overflow. For unsigned numbers, Cn=1 after an addition means the result does not fit in n bits. After a subtraction done as A+B+1, Cn=1 means A≥B (no borrow).
Ripple-carry adder (RCA): n full adders are cascaded, with the carry-out of bit i feeding the carry-in of bit i+1. In the worst case (for example A=11…1, B=00…01), a carry generated at bit 0 must ripple through every stage, so the carry chain is the critical path.
RIPPLE-CARRY ADDER WORST-CASE DELAY
TCn=ntc,TSn−1=(n−1)tc+ts
tc is one FA's carry delay and ts is its sum delay, measured from when its carry-in is stable (its Ai, Bi are already stable). If one figure tFA is given for both outputs, both times equal ntFA. The delay grows linearly with n.
Carry look-ahead adder (CLA): instead of waiting for the carry to ripple, every carry is written directly in terms of C0 and per-bit generate and propagate signals, so all carries can be formed at once.
GENERATE, PROPAGATE AND SUM
Gi=AiBi,Pi=Ai⊕Bi,Si=Pi⊕Ci
Gi=1: bit i produces a carry whatever Ci is. Pi=1: bit i passes an incoming carry on to Ci+1. Some texts use Pi=Ai+Bi. The carry equations below still hold with that choice, but the sum can then no longer be formed as Pi⊕Ci.
CARRY RECURRENCE AND ITS LOOK-AHEAD EXPANSION
Ci+1C1C2C3C4=Gi+PiCi=G0+P0C0=G1+P1G0+P1P0C0=G2+P2G1+P2P1G0+P2P1P0C0=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0
Each expanded carry is a two-level AND-OR expression in the G's, P's and C0, so every carry is ready 2 gate delays after the P, G signals, whatever its position. The cost is fan-in: Ci has i+1 product terms and its largest AND gate has i+1 inputs.
BLOCK (GROUP) GENERATE AND PROPAGATE FOR A 4-BIT BLOCK
G∗=G3+P3G2+P3P2G1+P3P2P1G0,P∗=P3P2P1P0,C4=G∗+P∗C0
Fan-in limits force wide adders to be built from k-bit CLA blocks. Each block's G∗, P∗ take 2 gate delays after the bit-level Pi, Gi. A second-level look-ahead unit applies the same carry equations to the block signals, giving the carry into every block at once instead of rippling between blocks. With a fixed block size k, the number of look-ahead levels grows as logkn, so the delay grows as O(logn).