Apex › Hardware

The ALU — how a CPU computes

The arithmetic logic unit is the adder plus a few logic gates, with a multiplexer that an opcode uses to pick which result to keep. It computes add, subtract, and, or, xor, shifts, and compare all at once and selects one, raising the Z/N/C/V flags that turn a comparison into a branch. Pick an operation and two operands and watch the result and flags.

More in Hardware