You are in a computer shop on Elephant Road, and the salesman reads out a laptop's specification in one breath: "16 GB RAM, 512 GB SSD, 12 MB cache." You nod, but a question stays at the back of your mind. Why does one machine need three kinds of memory? Why not a single big memory that is fast and remembers everything? And when load-shedding strikes and the screen goes black, which of the three still holds your work?
The answers come from one idea, the memory hierarchy. A computer keeps a little very fast memory close to the processor, more memory that is slower a step further away, and a huge amount of slow, cheap storage at the bottom, and it arranges things so that the whole feels like one large, fast memory. Exam papers ask about it in a handful of ways, all easy once the picture is clear.
By the end of this chapter you will be able to put the memories in order of speed, size and cost, and say why they come in that order. You will sort any memory as primary or secondary, volatile or non-volatile. You will tell SRAM from DRAM, and PROM, EPROM, EEPROM and flash from one another. You will explain what a cache and virtual memory do, and work out an average access time from a hit ratio in both ways the papers do it. And you will convert memory sizes without slipping between 1,000 and 1,024.
We go in seven parts: why layers exist and what the levels are; primary and secondary, volatile and non-volatile; RAM; ROM and its family; cache and the average access time; virtual memory; and last, the units and a one-page map to carry into the exam hall. How chips, cache tags and page tables work inside belongs to the Computer Architecture and Operating Systems courses; here you get everything a Computer Fundamentals paper asks, with a signpost to the deeper chapter.