An address is a binary number, but the memory needs to switch on one particular row of cells. That conversion is exactly what a decoder does, and in memory it's called the address decoder.
Inside a chip. A memory with k address bits contains a k-to-2ᵏ decoder. Each output is a word line running along one row of cells. For any address, exactly one word line is 1, and only that row connects to the data lines. A 32-word memory has a 5-to-32 decoder.
Word line Wᵢ is the minterm of the address bits for i. With 2 address bits:
- W0 = , W1 = , W2 = , W3 =
In a system. The same idea, one level up: a decoder on the high address bits produces chip selects, so exactly one chip responds (depth expansion).
Very large memories avoid one giant decoder by arranging cells in a grid and decoding rows and columns separately (two dimensional decoding).
A ROM is an address decoder plus an OR gate per data bit, with the stored 1s as connections.