Memory organization and cache management
In computer systems, caches are used to diminish the slowness of main memory which is larger and cheaper than cache memory. Caches are faster because not far from CPU and not as large as main memory. In modern computers, there may be more than one cache memory. The layers composed a memory hierarchy. The memory hierarchy is sometimes called an illusion to processors because a processor can have as large and fast a memory as it needs at the level of reasonable cost. In short, from a broader perspective it is easy to understand why memory hierarchies are needed; however, to understand how it works you need to narrow the perspective, e.g. taking account only two memory layers at one time. Key concepts are: cache miss and hit ratios. memory and cache and average access speed memory size, cache size block or cache line size set size direct mapping, fully associative mapping, set associative mapping address partitioning (tag bits, index/set bits, block bits) replacement algor