Memory hierarchy
Financial cost can be a limitation to creating the most efficient computer system. Memory can typical have a small size and low latency or a large size and high latency.
Naive approach: Exposed Hierarchy
One naive approach to memory hierarchy is to have all the memory components exposed to the processor. It is then the programmer’s responsibility to decide where to store data.
{
"url":"[CS1W9 Lecture Slides.pdf](https://git.is.horse/insert/university/obsidian-notes/-/raw/9d95afcbbdb7a4c77ca9f62b32e35c6f31e269e7/University/Year%201/Semester%201/4CCS1CS1%20Computer%20Systems%201/Week%209.%20Memory%20hierarchy%20and%20cache%20systems/CS1W9%20Lecture%20Slides.pdf)",
"page":[11],
"scale":1.5,
"rect":[72, 30, 92, 218]
}Problems include that it requires complex load and store instructions in the instruction set. Programs will be competing against each other.
Better approach: implicit memory hierarchy
Complexities of the memory are hidden from the processor. The hardware handles whether data is stored in fast or slow memory depending on usage patterns.
{
"url":"[CS1W9 Lecture Slides.pdf](https://git.is.horse/insert/university/obsidian-notes/-/raw/9d95afcbbdb7a4c77ca9f62b32e35c6f31e269e7/University/Year%201/Semester%201/4CCS1CS1%20Computer%20Systems%201/Week%209.%20Memory%20hierarchy%20and%20cache%20systems/CS1W9%20Lecture%20Slides.pdf)",
"page":[12],
"scale":1.5,
"rect":[50, 35, 38, 264]
}The processor will see fast memory as long as hardware keeps the required data within the cache. But the processor needs to handle different latencies on the fly (sometimes data will come in fast, sometimes slow)