for Robot Artificial Inteligence

14. Cache Memory

|

Cache Memory

  • in computer architecture, a high speed memory (static RAM - SRAM) is placed between the CPU and the main memory RAM (DRAM - Dynamic RAM). this memory primarily used to store the Frequently used data and instructions by the CPU.

  • this intermediate memory is known as Cache Memory which plays important role by significantly improving the CPU performance.

  • the Operating system loads the program which consist of machine code instructions. During the program execution, the CPU fetches the data and instructions from the main memory RAM.

  • the data and instructions are retrieved(取回) from RAM when CPU uses them for the first time. A copy of this data or instructions is then stored in cache memory which is placed between CPU and main memory RAM.

  • the cache memory consist of SRAM(static RAM) which is significantly faster than main memory DRAM. the CPU stores the Frequently needed data into the cache memory.

  • the next time, whenever the CPU needs that data or instructions, it will first looks in to the cache memory. if the required data is found in the cached, it is fetched from cache memory instead of main memory. this significantly improves the CPU speed.

  • the CPU does not directly access the main memory and the disk memory

  • CPU will first search data from the cache memory. thus the data is copied from disk memory to RAM(main memory) and from RAM to the cache memory where CPU can access.

  • in computer system, a cache memory is a high speed intermediate memory placed between the CPU and the main memory(RAM)

  • cache memory is used to increase the execution of computer programs by providing quick access to CPU to the Frequently used data.

  • these Frequently used data/values belong to the program/process which currently being executed by the CPU.

why Computer system needs Cache Memory?

  • the main memory RAM cannot support the CPU’s high processing speed and therefore intermediate high speed memory layers are placed between the main memory(RAM) and the CPU to improve the system performance

  • thses high speed intermediate memory components are known as Cache memory.

  • the cache memory is used in different levels depending upon the system architecture and usually provided in three levels L1, L2 and L3

  • Cache memory is a small-sized type of volatile computer memory that provides high-speed data access to the CPU and stores Frequently used computer programs, application and data. it stores and retain data only till the computer system is powered on

  • there are three types / levels of cache memory (L1, L2 and L3) used depending upon the access speed and its location on mother board from CPU.

  • cache memory is the fastest memory in a computer. the cache(L1) memory is the closest to the CPU and directly embedded inside the processor chip.

  • The L2 cache memory is generally placed on the RAM and L3 cache memory is placed on the mother board.

types of chace memory

  • A computer system can have different levels and sizes of cache memories depending on the CPU architecture. the most common levels of cache are L1, L2 and L3 cache where L1 is closest to the CPU(inbuilt inside CPU) and hence its access time is much faster compared to L2 cache. the L3 cache is closest to the main memory RAM and access time is relatively slower as compared to L1&L2 Cache.

  • Level1 (L1) cache:
    • it is also primary or internal cache. it is built directly into the processor chip. it has small capacity from 8kB to 128kB
  • Level2(L2) cache;
    • it is slower than L1 cache. its storage capacity is more, i-e. from 64kb to 16 MB. the current processors contain adavance transfer cache on processor chip that is a type of L2 caches. the common size of this cache is from 512kb to 8Mb
  • Level(L3) cache:
    • this cache is sperate from processor chip on the motherboard. it exists on the computer that uses L2 advanced transfer cache. it is slower than L1 and L2 cache but faster than DRAM. the personal computer ofen has up to 8Mb of L3 caches.
  • the cache memory sizes are restricted due to cost and size consideration. the cache memory uses SRAM which is expensive

  • the two main type of cache memoris are:
    • Memory cache(L1,L2,L3)
    • Disk cache
  • Memory cache is a portion of the high-speed static RAM(SRAM) and is effective because most program access the same data or instructions repeatedly. by keeping as much of this information as possible in SRAM, the computer avoid accsing the slower main memory(DRAM) which makes the computer perform faster and more efficiently.

  • Disk cache is used by operating system to store frequently accessed data and instruction. as the disk cache memory is a part of the RAM, it is faster to access and retrieve information from the cache memory compared to getting the information of files from the hard disk. the disk caching significantly improve the system performance.

Comments