A memory receives its address on k address lines, one bit per line. k bits can make 2ᵏ different patterns, so k lines can pick out 2ᵏ words.
- 3 bits → 8 words
- 10 bits → 1024 words (1K)
- 16 bits → 65,536 words (64K)
- 20 bits → 1M words
Going the other way: N words need the smallest k with 2ᵏ ≥ N. That is log₂N, rounded up. 1000 words need 10 bits; addresses 1000–1023 just go unused.
The rule that catches people: address bits count words, not bits or bytes. If a question gives the capacity in bits, divide by the word size first, then take log₂.
A mental shortcut for sizes written with K, M or G: split the number. 16K = 2⁴ × 2¹⁰ = 2¹⁴, so 16K words need 4 + 10 = 14 address bits. Add 20 for M and 30 for G.
The same counting appears with select lines on a multiplexer and the inputs of a decoder: in every case n bits choose one of 2ⁿ things.