Standard RAM is volatile; when power to the PC is lost, all data currently stored in RAM is lost. This fact explains why you must save your work when using an application. One type of memory, called flash memory, stores data even when the power is turned off. ROM is a form of flash memory used in PCs. Other machines that use flash memory are digital cameras. When you take pictures with some digital cameras, the pictures are stored in a flash memory chip rather than on photo graphic film. Because you do not want to lose the pictures you have taken, the memory must store the pictures until you can transfer them to your PC, even when the camera is turned off.
Cache Memory
Moving data between RAM and the CPU's registers is one of the most time-consuming operations a CPU must perform, simply because RAM is much slower than the CPU. A partial solution to this problem is to include a cache memory in the CPU. Cache (pronounced cash) memory is similar to RAM, except that it is extremely fast compared to normal memory and it is used in a different way.
When a program is running and the CPU needs to read data or program instructions from RAM, the CPU checks first to see whether the data is in cache memory. If the data is not there, the CPU reads the data from RAM into its registers, but it also loads a copy of the data into cache memory. The next time the CPU needs that same data, it finds it in the cache memory and saves the time needed to load the data from RAM.
Since the late 1980s, cache memory has been built into most PC CPUs. This CPU-resident cache is often called Level-1 (L1) cache. The first CPU caches came with 0.5 KB, then 8 KB, then 16 KB, then 32 KB. Today Celeron processors have 128 – 256 KB built in.
In addition to the cache memory built into the CPU, cache is also added to the motherboard. This motherboard-resident cache is often called Level-2 (L2) cache. Many PCs sold today have 512 KB or 1024 KB of motherboard cache memory; higher-end systems can have from 2 MB to 4 MB of L2 cache.