01Chapter 1: Why memory is a hierarchyComputers store data in several kinds of memory instead of one. This chapter explains why, what each level looks like, and what rules the levels follow. The later chapters build cache mapping and timing formulas on this foundation.6 min read
02Chapter 2: Temporal and spatial localityThis chapter assumes you know what a cache is at a high level (a small, fast memory between the CPU and main memory). It also assumes you are comfortable with byte addresses, powers of two, and weighted averages. The chapter explains the property of programs that makes caches work. Later chapters co7 min read
03Chapter 3: Cache basics: blocks, lines, hits and missesThis chapter assumes you can convert between binary and hexadecimal, work with powers of two, and know that memory is byte-addressable. It also assumes you know that the CPU fetches instructions and data from memory. Nothing about mapping is needed yet. This chapter fixes the vocabulary that every l7 min read
04Chapter 4: Hit ratio, miss ratio and miss penaltyThis chapter assumes you know what a cache block, a hit and a miss are (from the previous chapter), can work with powers of two, and can compute a weighted average. Here we turn "hits and misses" into numbers: the hit ratio, the miss ratio and the miss penalty. These are the inputs to the average me6 min read
05Chapter 5: Average memory access timeThis chapter assumes you know what a cache hit and a miss are, and that you can convert between a hit ratio and a miss ratio. It builds on the earlier chapters on hit ratio, miss ratio and miss penalty. It does not need address splitting or mapping yet.5 min read
06Chapter 6: Splitting an address into tag, index and offsetThis chapter assumes you can convert between binary and hexadecimal, work with powers of two and base-2 logarithms, and know that memory is byte-addressable unless a question says otherwise. It also assumes you know what a cache block and a hit are from the earlier chapters.6 min read
07Chapter 7: Direct-mapped cacheThis chapter assumes you can read binary and hexadecimal, know that cache sizes are powers of two, and have seen the idea of a cache block from the earlier chapters. A direct-mapped cache is the simplest way to decide where a memory block may live in the cache. Each block has exactly one possible li5 min read
08Chapter 8: Fully associative cacheThis chapter assumes you can split an address into tag, index and offset, and that you know how a direct-mapped cache places a block in exactly one line. It also assumes you can work with powers of two in binary.5 min read
09Chapter 9: k-way set-associative cacheThis chapter assumes you can split an address into tag, index and offset. It also assumes you know how a direct-mapped cache and a fully associative cache work. You should be comfortable with powers of two and log2.5 min read
10Chapter 10: Cache size, tag bits and total storageThis chapter assumes you can split an address into tag, index and offset, and that you know direct-mapped, fully associative and k-way set-associative placement. It also assumes you are comfortable with powers of two and base-2 logarithms. Here you use those ideas to count the bits a cache needs, wh6 min read
11Chapter 11: Replacement policies: LRU, FIFO and randomThis chapter assumes you can split an address into tag, index and offset. It also assumes you know how direct-mapped, fully associative and k-way set-associative caches place blocks. You should be comfortable counting hits and misses on a reference string.6 min read
12Chapter 12: Write-through, write-back and allocation on write missThis chapter assumes you can split an address into tag, index and offset, and that you know hit, miss and miss penalty. Reads were enough up to now. A write is harder, because it creates two copies of the same data: one in the cache and one in main memory. A write policy decides when those copies ar5 min read
13Chapter 13: Compulsory, capacity and conflict missesThis chapter assumes you can split an address into tag, index and offset, and that you know how direct-mapped, fully associative and set-associative caches place blocks. It also assumes you know LRU replacement. Here you will learn to say why a cache missed, and which design change would have preven5 min read
14Chapter 14: Multilevel caches and access timeThis chapter assumes you can compute average memory access time (AMAT) for one cache level. You should also know hit ratio, miss ratio and miss penalty, and the difference between direct-mapped and set-associative caches. Here we extend AMAT to two or more cache levels and learn to read GATE questio7 min read
15Chapter 15: GATE problem patterns and strategiesThis chapter turns the earlier chapters into a repeatable method for numerical cache questions in GATE CS. It assumes you can split an address into tag, index and offset, and that you know direct-mapped, fully associative and set-associative placement. It also assumes you can compute AMAT, and that 5 min read