CPUhierarchie
CPU hierarchy refers to the layered structure of memory components that a central processing unit (CPU) accesses. This hierarchy is designed to bridge the speed gap between the very fast CPU and slower main memory (RAM). At the top of the hierarchy are CPU registers, which are the fastest and smallest storage locations directly accessible by the CPU. Below registers are CPU caches, typically divided into multiple levels such as L1, L2, and L3. L1 cache is the smallest and fastest, closest to the CPU cores. L2 cache is larger and slightly slower than L1, while L3 cache is the largest and slowest of the cache levels, often shared among multiple cores. When the CPU needs data, it first checks the L1 cache. If the data is not found, it checks L2, then L3, and finally main memory. This caching system reduces the average time to access memory, significantly improving overall system performance by keeping frequently used data close to the CPU. The principle behind this hierarchy is locality of reference, the tendency for a CPU to access the same data or instructions repeatedly within a short period or to access data located near previously accessed data.