This page assumes you have seen almost nothing. Before you can read the parent note on locality, we must earn every word it uses: address, memory location, access, reference, cache, block, hit/miss, reuse distance, stride, and the bits of arithmetic notation (Ai, ∣⋅∣, ⌈⋅⌉, ∑, P(⋅)) it leans on. We build them in the exact order they depend on each other.
Everything starts here. Forget circuits — picture a very long street of identical boxes in a row. Each box holds a small number. Each box has a permanent house-number painted on it.
A subtle but vital point drawn in the figure: consecutive addresses sit physically side by side. Address 0x1004 is the box immediately to the right of 0x1000. "Close in number" means "close in space." Hold onto that — it is the whole engine of spatial locality.
Recall
A memory location vs. an address ::: The location is the box (the physical slot); the address is the number painted on it.
The parent note squeezes each flavour of locality into a tiny formula. Each formula is one question about the list A1,A2,…. Let us earn the arithmetic first.
Why does the topic need this? To measure how far apart two consecutive addresses are:
Stride=∣Ai+1−Ai∣
Here Ai+1−Ai is "next box number minus this box number." If the program stepped forwards the difference is positive; if it jumped backwards it is negative. We only care how big the jump was, not its direction — so we wrap it in ∣⋅∣.
Recall
Why absolute value in the stride formula ::: A backward step (Ai+1<Ai) gives a negative difference, but we only care about the distance jumped, so we strip the sign.
The topic writes this counting job with a name; the machinery of "count the unique items between two markers" is what the formula in the parent means. No new symbol — just the word "count."
Once these foundations are in place you are ready for Cache organization fundamentals and Cache mapping strategies (how the shelf is arranged), the Working set model (formalising "the small portion in use"), and Loop blocking and tiling (fixing the bad-stride matrix case). Later, Virtual memory reuses locality at a coarser page grain.