The fundamental digital circuit that powers computation in modern computer systems. Discover how the ALU performs arithmetic, logic, and shift operations that make computing possible.
The Arithmetic Logic Shift Unit (ALU) is a fundamental digital circuit within a computer system that performs a variety of microoperations.
Instead of having individual registers directly perform microoperations, computer systems utilize storage registers connected to this common operational unit.
The ALU executes arithmetic, logic, and shift microoperations, then transfers results to destination registers.
Addition, subtraction, increment, decrement
AND, OR, XOR, complement operations
Left shift and right shift operations
An ALU integrates multiple circuit stages into a single unit:
The output (Fi) is selected by multiplexers that choose between arithmetic results (Di), logic results (Ei), and shift operations (shr/shl).
| S3 | S2 | S1 | S0 | C_in | Operation | Function |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | Transfer A | F = A |
| 0 | 0 | 0 | 0 | 1 | Increment A | F = A + 1 |
| 0 | 0 | 0 | 1 | 0 | Addition | F = A + B |
| 0 | 0 | 0 | 1 | 1 | Add with carry | F = A + B + 1 |
| 0 | 0 | 1 | 0 | 0 | Subtract with borrow | F = A + B̄ |
| 0 | 0 | 1 | 0 | 1 | Subtraction | F = A + B̄ + 1 |
| 0 | 0 | 1 | 1 | 0 | Decrement A | F = A - 1 |
| 0 | 0 | 1 | 1 | 1 | Transfer A | F = A |
| 0 | 1 | 0 | 0 | x | AND | F = A ∧ B |
| 0 | 1 | 0 | 1 | x | OR | F = A ∨ B |
| 0 | 1 | 1 | 0 | x | XOR | F = A ⊕ B |
| 0 | 1 | 1 | 1 | x | Complement A | F = Ā |
| 1 | 0 | x | x | x | Shift right A | F = shr A |
| 1 | 1 | x | x | x | Shift left A | F = shl A |
Note: 'x' indicates a "don't care" condition for the input
The Arithmetic Logic Shift Unit is a critical component of a computer's central processing unit (CPU). Its ability to perform a wide array of data manipulation tasks—arithmetic, logical, and shifting—all within a single integrated unit, makes it highly efficient and a cornerstone of computer architecture.
Every calculation, every logical decision, and every data transformation in your computer passes through this remarkable circuit, making it one of the most important innovations in computing history.