Arithmetic Logic Unit
The processor component that performs arithmetic and logical operations on binary data.
Definition
The arithmetic logic unit (ALU) is the part of a processor that carries out arithmetic (add, subtract) and logical (AND, OR, XOR, shift) operations. Control signals select which operation it performs on the input operands.
Status flags set by the ALU, such as zero and overflow, are what let a processor make decisions: conditional branches test these flags to choose a path. In this way the ALU's arithmetic results drive not only computation but the flow of control itself.
Modern processors contain multiple ALUs, often including vector units that apply one operation to many data elements at once, so that arithmetic throughput scales with parallelism rather than clock speed alone. The status flags an ALU produces feed the branch logic that steers program flow, tying computation to control. This combination, wide parallel arithmetic plus flag-driven branching, is what lets a processor run both number-crunching and decision-heavy code efficiently.
Structure
- An adder for arithmetic, reused for subtraction via two's complement.
- Logic gates for bitwise operations.
- A shifter for multiply/divide by powers of two.
- Status flags: zero, carry, overflow, negative.
Why it matters
The ALU is where a processor actually computes. Its width (bits per operation) and speed directly shape performance, and modern processors include many ALUs, often vector-capable, to execute operations in parallel.
Fusion connection
Wide, vectorized ALUs in modern hardware execute the dense floating-point arithmetic of fusion simulations, which is why vectorization matters so much for their speed.