tvånivåminneshierarki
Tvånivåminneshierarki refers to a computer memory system organized into two primary levels. This hierarchical structure is designed to balance the speed and cost of memory technologies. The top level, typically a small amount of very fast but expensive memory, acts as a cache for frequently accessed data. The second level is a larger, slower, and less expensive memory that stores the bulk of the data. When the processor needs data, it first checks the fast, top-level memory. If the data is present (a cache hit), it can be accessed very quickly. If the data is not found (a cache miss), it must be fetched from the slower, second-level memory, and a copy is then typically placed in the top-level memory for future access. This system aims to provide the performance benefits of fast memory for most operations without the prohibitive cost of having all memory be high-speed. Common examples include CPU caches (L1 and L2) and the combination of RAM and disk storage. The effectiveness of a two-level hierarchy depends on the principle of locality, where data that is accessed is likely to be accessed again soon or data near it will be accessed.