The Wayback Machine - https://web.archive.org/web/20240913183547/https://www.geeksforgeeks.org/terminologies-cache-memory-organization/
Open In App

Terminologies Cache Memory Organization

Last Updated : 23 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Cache Memory is a small, fast memory that holds a fraction of the overall contents of the memory. Its mathematical model is defined by its size, number of sets, associativity, block size, sub-block size, fetch strategy, and write strategy. Any node in the cache hierarchy can contain a common cache or two separate caches for instruction and or data. 

  1. First-Level-Cache : 
    This is the cache closest to the CPU and is called the L1 cache. If there is a split in this cache for data and instruction they are referred to as L1I for instruction and L1D for data.  
  2. Second-Level Cache : 
    This is also called secondary cache when looking globally at the placement of caches between CPU and main memory. 
  3. Main Memory : 
    This is the last level of memory. This is the last place the CPU will look for data. 
  4. Memory Hierarchy : 
    When there is only one cache between CPU and main memory it is difficult to call it a multi-layer cache hierarchical structure. For it to be called so there should usually be two caches between the CPU and the main memory.Caches closer to the CPU are called upstream and or predecessor caches and caches closer to the main memory are called downstream and or successor caches. 
  5. Block : 
    The unit of data for which there is an address tag is called a block. It is also called a Line. This tag tells the program which portion of the main memory is occupying the cache.
  6. Set : 
    This is a collection of blocks the tags for which are checked in parallel. If there is only one set the cache is associative. Usually what happens is that a continuous set of address bits selects which memory block can reside in it.
  7. Associativity : 
    The number of blocks in a set is called the degree of Associativity of the cache structure. If the number is one it is a direct-mapped cache. 
  8. Sub-block : 
    It is a unit of datum with which a valid bit is associated. Its size is less than equal to block size. 
  9. Fetch Size : 
    The maximum amount of memory that can be fetched from the next memory level is called the fetch size. It is a multiple of sub-block size and can be small or larger than block size.  
  10. Read : 
    A read request to a cache is a request to present a consecutive collection of words of a predefined length at a given address. The CPU generates instruction fetch and load references both of which are read. 
  11. Write : 
    It contains an address and a predefined number of sub-blocks and a mask. 
  12. Read Miss : 
    It is a read request for data not contained completely contained in the cache. A miss occurs either when none of the tags in the appropriate set matches the high-order address bits of the request, or you can see that in Read miss higher-order bits request when one or more of the requested sub-blocks in a matching block is invalid.  
  13. Local (Read) Miss Ratio : 
    The number of read misses in a cache divided by the total number of read requests to that cache.  
  14. Global (Read) Miss Ratio : 
    The number of read misses to that cache divided by the number of read requests generated by the CPU. 
  15. Solo (Read) Miss Ratio : 
    The miss ratio of the cache in a memory hierarchy when it is the only cache in the hierarchy. 
  16. (Local) Read Traffic Ratio : 
    This is the number of words fetched from the next level in the hierarchy divided by the number of words fetched from the cache. Global traffic ratio is the same numerator divided by the number of words fetched by the CPU.
  17. (Local) Write Traffic Ratio : 
    This is the ratio of the number of words written out by a cache to the number of words written out to the previous level. 
  18. Fetch Strategy : 
    The basic choices are write-through and write-back, but they must be accompanied by a selection of write buffering (width and depth) and a strategy for dealing with a write miss.  
  19. Replacement Strategy : The most common choices are Random and Least Recently Used (LRU). For a direct-mapped cache, there is only one block per set, so there is no choice. 
  20. Hit Ratio: It is the ratio of number of hits in cache to the total number of references.                                                                                                 

              Hit Ratio = number of hits/total number of references 

.     21. Miss Ratio: It is the ratio of number of misses in cache to the total number of references.

.            Miss Ratio = number of misses / total number of references = 1 – Hit ratio
      22. Miss Penalty: It is the time required to bring a block from main memory to cache memory in case of cache miss.

 



Similar Reads

Cache Hits in Memory Organization
The user has a memory machine. It has one layer for data storage and another layer for the cache. The user has stored an array with length N in the first layer. When the CPU needs data, it immediately checks in cache memory whether it has data or not. If data is present it results in CACHE HITS, else CACHE MISS, i.e., data is not in cache memory so
8 min read
Cache Memory in Computer Organization
Cache memory is a small, high-speed storage area in a computer. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various independent caches in a CPU, which store instructions and data. The most important use of cache memory is that it is used to reduce the average time to
9 min read
Difference between Virtual memory and Cache memory
Cache Memory: Cache memory increases the accessing speed of CPU. It is not a technique but a memory unit i.e a storage device. In cache memory, recently used data is copied. Whenever the program is ready to be executed, it is fetched from main memory and then copied to the cache memory. But, if its copy is already present in the cache memory then t
2 min read
Computer Organization and Architecture | Computer Organization and Architecture | Question 1
Where does the swap space reside? (A) RAM (B) Disk (C) ROM (D) On-chip cache Answer: (B) Explanation: Quiz of this Question
1 min read
Introduction to Crypto-terminologies
Cryptography is an important aspect when we deal with network security. 'Crypto' means secret or hidden. Cryptography is the science of secret writing with the intention of keeping the data secret. Cryptanalysis, on the other hand, is the science or sometimes the art of breaking cryptosystems. Both terms are a subset of what is called Cryptology. C
4 min read
Cache Memory Design
Prerequisite - Cache Memory A detailed discussion of the cache style is given in this article. The key elements are concisely summarized here. we are going to see that similar style problems should be self-addressed in addressing storage and cache style. They represent the subsequent categories: Cache size, Block size, Mapping function, Replacement
5 min read
Differences between Associative and Cache Memory
1. Associative Memory: The time required to find an object stored in memory can be significantly reduced if the stored data can be identified by the content of the data for its own use rather than by access. A memory unit accessed by a material is known as an associative memory or a content addressable memory (CAM). This type of memory is accessed
2 min read
Concept of Cache Memory Design
Cache Memory plays a significant role in reducing the processing time of a program by provide swift access to data/instructions. Cache memory is small and fast while the main memory is big and slow. The concept of caching is explained below. Caching Principle : The intent of cache memory is to provide the fastest access to resources without comprom
4 min read
Factors affecting Cache Memory Performance
Computers are made of three primary blocs. A CPU, a memory, and an I/O system. The performance of a computer system is very much dependent on the speed with which the CPU can fetch instructions from the memory and write to the same memory. Computers are using cache memory to bridge the gap between the processor's ability to execute instructions and
5 min read
Cache Memory Performance
Types of Caches : L1 Cache : Cache built in the CPU itself is known as L1 or Level 1 cache. This type of cache holds most recent data so when, the data is required again so the microprocessor inspects this cache first so it does not need to go through main memory or Level 2 cache. The main significance behind above concept is "Locality of reference
5 min read
Difference between Cache Coherence and Memory Consistency
1. Cache coherence :Cache coherence in computer architecture refers to the consistency of shared resource data that is stored in multiple local caches. When clients in a system maintain caches of a shared memory resource, problems with incoherent data can arise, which is especially true for CPUs in a multiprocessing system.In a shared memory multip
2 min read
Difference between Cache Memory and Register
In the context of a computer’s architecture, two terms that may be familiar are the cache memory and the register, however, few people may not know the differences and functions of each of the two components. Both of them are important to the CPU but they have different roles and are used in different manner. In this article, we will look at some i
5 min read
2D and 2.5D Memory organization
The internal structure of Memory either RAM or ROM is made up of memory cells that contain a memory bit. A group of 8 bits makes a byte. The memory is in the form of a multidimensional array of rows and columns. In which, each cell stores a bit and a complete row contains a word. A memory simply can be divided into this below form. 2n = N where n i
4 min read
Memory Stack Organization in Computer Architecture
A stack is a storage device in which the information or item stored last is retrieved first. Basically, a computer system follows a memory stack organization, and here we will look at how it works. A portion of memory is assigned to a stack operation to implement the stack in the CPU. Here the processor register is used as a Stack Pointer (SP). The
4 min read
Why Linked List is implemented on Heap memory rather than Stack memory?
Pre-requisite: Linked List Data StructureStack vsHeap Memory Allocation The Linked List is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers. It is implemented on the heap memory rather than the stack memory. This article discusses the reason behind
14 min read
Random Access Memory (RAM) and Read Only Memory (ROM)
Memory is a fundamental component of computing systems, essential for performing various tasks efficiently. It plays a crucial role in how computers operate, influencing speed, performance, and data management. In the realm of computer memory, two primary types stand out: Random Access Memory (RAM) and Read-Only Memory (ROM). Understanding the diff
8 min read
DNS Spoofing or DNS Cache poisoning
Prerequisite - Domain Name Server Before Discussing DNS Spoofing, First, discuss what is DNS.A Domain Name System (DNS) converts a human-readable name (such as www.geeksforgeeks.org) to a numeric IP address. The DNS system responds to one or more IP-address by which your computer connects to a website (such as geeksforgeeks.org) by using one of the
3 min read
Multilevel Cache Organisation
Cache is a random access memory used by the CPU to reduce the average time taken to access memory. Multilevel Caches is one of the techniques to improve Cache Performance by reducing the "MISS PENALTY". Miss Penalty refers to the extra time required to bring the data into cache from the Main memory whenever there is a "miss" in the cache. For clear
5 min read
Write Through and Write Back in Cache
Prerequisite - Multilevel Cache Organisation Cache is a technique of storing a copy of data temporarily in rapidly accessible storage memory. Cache stores most recently used words in small memory to increase the speed at which data is accessed. It acts as a buffer between RAM and CPU and thus increases the speed at which data is available to the pr
3 min read
Types of Cache Misses
Cache line prefetching is a technique used in computer processors to improve memory access performance. It involves fetching multiple contiguous cache lines from memory into the processor's cache in advance, anticipating that they will be needed in the near future. The cache is a small but fast memory located on the processor chip that stores recen
3 min read
Cache Coherence
Prerequisite - Cache Memory Cache coherence : In a multiprocessor system, data inconsistency may occur among adjacent levels or within the same level of the memory hierarchy. In a shared memory multiprocessor with a separate cache memory for each processor, it is possible to have many copies of any one instruction operand: one copy in the main memo
4 min read
Virtually Indexed Physically Tagged (VIPT) Cache
Prerequisites: Cache MemoryMemory AccessPagingTransition Look Aside Buffer Revisiting Cache AccessWhen a CPU generates physical address, the access to main memory precedes with access to cache. Data is checked in cache by using the tag and index/set bits as show here. Such cache where the tag and index bits are generated from physical address is ca
8 min read
Analytical Approach to optimize Multi Level Cache Performance
Prerequisite - Multilevel Cache OrganizationThe execution time of a program is the product of the total number of CPU cycles needed to execute a program. For a memory system with a single level of caching, the total cycle count is a function of the memory speed and the cache miss ratio.m(C) = f(S, C, A, B) m(C) = Cache miss ratioC = Cache SizeA = A
3 min read
Simultaneous and Hierarchical Cache Accesses
Prerequisite : Cache Organization Introduction :In this article we will try to understand about Simultaneous Cache access as well as Hierarchical Cache Access in detail and also understand how these access actually works whenever CPU (Central Processing Unit) requests for Main Memory Block which is being stored currently in cache memory. Before jum
9 min read
Basic Cache Optimization Techniques
Generally, in any device, memories that are large(in terms of capacity), fast and affordable are preferred. But all three qualities can't be achieved at the same time. The cost of the memory depends on its speed and capacity. With the Hierarchical Memory System, all three can be achieved simultaneously. The cache is a part of the hierarchy present
5 min read
Difference between Buffer and Cache
Among all the categories existing in the field of computing, both buffers and caches are important for improving system efficiency. But they are different from each other concerning their functions and the modes they employ. Thus, it is vital to comprehend the difference between a buffer and a cache for those who wants to consider their system more
5 min read
LRU Cache - Complete Implementation
What is LRU Cache?Cache replacement algorithms are efficiently designed to replace the cache when the space is full. The Least Recently Used (LRU) is one of those algorithms. As the name suggests when the cache memory is full, LRU picks the data that is least recently used and removes it in order to make space for the new data. The priority of the
5 min read
Computer Organization | Amdahl's law and its proof
It is named after computer scientist Gene Amdahl( a computer architect from IBM and Amdahl corporation) and was presented at the AFIPS Spring Joint Computer Conference in 1967. It is also known as Amdahl's argument. It is a formula that gives the theoretical speedup in latency of the execution of a task at a fixed workload that can be expected of a
6 min read
Computer Organization | Micro-Operation
In computer central processing units, micro-operations (also known as micro-ops) are the functional or atomic, operations of a processor. These are low level instructions used in some designs to implement complex machine instructions. They generally perform operations on data stored in one or more registers. They transfer data between registers or
3 min read
Computer Organization | Different Instruction Cycles
Introduction : Prerequisite - Execution, Stages and Throughput Registers Involved In Each Instruction Cycle: Memory address registers(MAR) : It is connected to the address lines of the system bus. It specifies the address in memory for a read or write operation.Memory Buffer Register(MBR) : It is connected to the data lines of the system bus. It co
11 min read