Types of Caches
The L1 or Level 1 cache is built inside the CPU itself. It holds the most recently accessed data, so when the data is needed again, the CPU checks this cache first instead of going to the main memory or Level 2 cache. This is based on the concept of “Locality of reference,” where data recently accessed by the CPU is likely to be needed again.
The L2 or Level 2 cache is a separate chip located next to the CPU. It stores recently used data that is not found in the L1 cache. Some CPUs have both L1 and L2 cache built-in and designate the separate cache chip as Level 3 (L3) cache. The cache built into the CPU is faster than a separate cache, and the separate cache is faster than accessing data from RAM. The built-in cache operates at the same speed as the microprocessor.
The disk cache contains the most recently read data from the hard disk. It is much slower than RAM but helps in speeding up disk read operations.
Instruction Cache vs Data Cache
Instruction cache (I-cache) stores instructions only, while data cache (D-cache) stores only data. Distinguishing between instructions and data helps recognize their different access behavior patterns. Programs often have fewer write accesses and exhibit more temporal and spatial locality compared to the data they process.
Unified Cache vs Split Cache
A unified cache stores both instructions and data, while a split cache consists of two separate units – an instruction cache (I-cache) and a data cache (D-cache). These units can be designed to handle instructions and data independently based on their different characteristics.
|Analog and Memory Layout Design Forum|
|Physical Layout Design Forum|
|RTL & Verilog Design Forum|
|Analog Layout Design Interview Questions||Memory Design Interview Questions|
|Physical Design Interview Questions||Verilog Interview Questions|
|Digital Design Interview Questions||STA Interview Questions|