[TA] Matt Johnson
2007-04-11 14:58:15 UTC
Here's one way to establish the analogy:
stacks of books <-> main RAM
books at table <-> cache
book(s) open <-> registers
The open books are the ones you are working with directly, and so you
could think of those as the CPU registers. Then the analogy doesn't
quite reflect the size difference between registers and cache, but it's
the right idea.
You can tweak that analogy to represent multiple levels of cache and
even disk (virtual memory, not yet covered). I think the thing to keep
in mind is that the "most active material" in the analogy should be the
registers, and each step removed from the registers would be one step
down in the memory hierarchy, from registers to caches (possibly
multiple levels of caches) to memory (and later, to disk!).
Hope that helps.
Matt
stacks of books <-> main RAM
books at table <-> cache
book(s) open <-> registers
The open books are the ones you are working with directly, and so you
could think of those as the CPU registers. Then the analogy doesn't
quite reflect the size difference between registers and cache, but it's
the right idea.
You can tweak that analogy to represent multiple levels of cache and
even disk (virtual memory, not yet covered). I think the thing to keep
in mind is that the "most active material" in the analogy should be the
registers, and each step removed from the registers would be one step
down in the memory hierarchy, from registers to caches (possibly
multiple levels of caches) to memory (and later, to disk!).
Hope that helps.
Matt
So I go to Doe Library to do my research paper, and I get the books I think
I'll need, and carry them back to the table at which I'm sitting. I open a
subset of the books so that I can quickly go from one open book to another. As
the open books fill up my whole table, and I need to open one of the closed
books, I close one or more of the open books so that I can open one or more of
the closed books...
ok, so the part I don't get here is, is the cache *all of the books at my
library table*, or is it *only the open books*? If it's *only the open books*,
then what do the closed books at my table represent (as they no longer live on
the library shelves, but I'm not accessing them right now either)?
Thanks.
I'll need, and carry them back to the table at which I'm sitting. I open a
subset of the books so that I can quickly go from one open book to another. As
the open books fill up my whole table, and I need to open one of the closed
books, I close one or more of the open books so that I can open one or more of
the closed books...
ok, so the part I don't get here is, is the cache *all of the books at my
library table*, or is it *only the open books*? If it's *only the open books*,
then what do the closed books at my table represent (as they no longer live on
the library shelves, but I'm not accessing them right now either)?
Thanks.