缓存直接映射_直接映射缓存的工作和实现

缓存直接映射

Prerequisites: Memory mapping and its types

先决条件: 内存映射及其类型

In Direct mapped cache memory, each block mapped to exactly one location in cache memory.

在直接映射的高速缓存中,每个块都精确映射到高速缓存中的一个位置。

直接映射缓存的工作 (Working of Direct Mapped Cache)

  • CPU generates a memory request, so the line number field of the address is used to access the particular line of the cache.

    CPU生成内存请求,因此地址的行号字段用于访问高速缓存的特定行。

  • The tag field of the processor address is then compared with the tag of the line.

    然后将处理器地址的标签字段与该行的标签进行比较。

  • If the two tags match, a cache hit occurs and the desired word is found in the cache and they do not match, a cache miss occurs.

    如果两个标签匹配,则发生高速缓存命中,并且在高速缓存中找到所需的单词,但它们不匹配,则发生高速缓存未命中。

  • If the cache miss occurs, the desired word must be brought from the most memory.

    如果发生高速缓存未命中,则必须从最大内存中获取所需的字。

  • It is then held within the cache along with the new tag substituting the previous one.

    然后将其与替换前一个标签的新标签一起保存在缓存中。

A diagram to show the implementation of direct-mapp

你可能感兴趣的:(python,java,大数据,linux,机器学习)