计算机串口映射

(Mapping techniques)

The process of transfer the data from main memory to cache memory is called as mapping. In the cache memory, there are three kinds of mapping techniques

映射技术

  1. Associative mapping
    关联映射
  2. Direct mapping
    直接映射
  3. Set Associative mapping
    设置关联映射

Components present in each line are:

每行中存在的组件是:

  1. Valid bit:
    有效位:这给出了数据块的状态。 如果为0,则不引用数据块;如果为1,则引用数据块。
  2. Tag:
    标签:这是主存储器地址部分。
  3. Data:
    数据:这是数据块。

(1) Associative mapping)

In this technique, a number of mapping functions are used to transfer the data from main memory to cache memory. That means any main memory can be mapped into any cache line. Therefore, cache memory address is not in the use. Associative cache controller interprets the request by using the main memory address format. During the mapping process, the complete data block is transferred to cache memory along with the complete tags.

在这种技术中,许多映射功能用于将数据从主存储器传输到高速缓存。 这意味着任何主存储器都可以映射到任何高速缓存行。 因此,缓存内存地址未被使用。 关联缓存控制器使用主内存地址格式解释请求。 在映射过程中,完整的数据块与完整的标签一起传输到高速缓存。




qos映射实验 映射技术_qos映射实验


  • Associative cache controller interprets the CPU generated request as:
    关联的缓存控制器将CPU生成的请求解释为:
  • qos映射实验 映射技术_java_02


  • The existing tag in the cache controller compared with the CPU generated tags.
    高速缓存控制器中的现有标签与CPU生成的标签进行比较。
  • If anyone of the tag in the matching operation becomes hit. So, based on the word offset the respective data is transfer to CPU.
    如果匹配操作中的任何标签被命中。 因此,基于字偏移量,相应的数据将传输到CPU。
  • If none of the tags are matching operation become miss. So, the references will be forwarded to the main memory.
    如果所有标签都不匹配,则会丢失操作。 因此,引用将被转发到主存储器。
  • According to the main memory address format, the respective main memory block is enabled then transferred to the cache memory by using the associative mapping. Later the data will be transfer to the CPU.
    根据主存储器地址格式,启用各个主存储块,然后使用关联映射将其传输到高速缓存。 之后,数据将被传输到CPU。
  • In this mapping technique, replacement algorithms are used to replace the cache block when the cache is full.
    在这种映射技术中,当高速缓存已满时,将使用替换算法替换高速缓存块。
  • Tag memory size = number of lines * number of tag bits in the line.
    标签存储器大小=行数*行中标签位数。

Tag memory size = 4*3 bits

标签存储器大小= 4 * 3位

Tag memory size = 12 bits

标签存储器大小= 12位


(2) Direct mapping)

In this mapping technique, the mapping function is used to transfer the data from main memory to cache memory. The mapping function is:

在这种映射技术中,映射功能用于将数据从主内存传输到高速缓存。 映射函数为:

K mod N = i

Where,

哪里,

  • K
    K是主存储块号。
  • N
    N是缓存行数。
  • And, i
    而且, 我是缓存行号。


qos映射实验 映射技术_大数据_03


  • Direct cache controller interprets the CPU generated a request as:
    直接高速缓存控制器将CPU生成的请求解释为:
  • qos映射实验 映射技术_大数据_04


  • Line offset is directly connected to the address logic of the cache memory. Therefore the corresponding cache line is enabled.
    线偏移量直接连接到高速缓存的地址逻辑。 因此,启用了相应的缓存行。
  • Existing tag in the enabled cache line is compared with the CPU generated the tag.
    将启用的缓存行中的现有标签与CPU生成的标签进行比较。
  • If both are matching operation then it becomes hit. So, the respective data is transfer to CPU based on the word offset.
    如果两者都匹配操作,那么它将被命中。 因此,基于字偏移将相应的数据传输到CPU。
  • If both are not matching operation then it becomes a miss. So, the reference is forward into the main memory.
    如果两者都不匹配,则将成为未命中对象。 因此,该引用被转发到主存储器中。
  • According to the main memory address format, the corresponding block is enabled, then transferred to the cache memory by using the direct mapping function. Later the data is transfer to the CPU based on the word offset.
    根据主存储器地址格式,启用相应的块,然后使用直接映射功能将其传送到高速缓存。 之后,数据将根据字偏移量传输到CPU。
  • In this mapping technique, a replacement algorithm is not required because the mapping function itself replaces the blocks.
    在这种映射技术中,不需要映射算法,因为映射功能本身可以替换块。
  • The disadvantage of direct mapping is each cache line is able to hold only one block at a time. Therefore. The number of conflicts misses will be increased.
    直接映射的缺点是每条高速缓存行一次只能容纳一个块。 因此。 冲突未命中的数量将会增加。
  • To avoid the disadvantage of the direct mapping, use the alternative cache organization in which each line is able to hold more than one tags at a time. This alternative organization is called as a set associative cache organization.
    为避免直接映射的缺点,请使用备用缓存组织,在该组织中,每行可以一次容纳多个标签。 此替代组织称为集合关联缓存组织。
  • Tag memory size = number of lines * number of tag bits in the line.
    标签存储器大小=行数*行中标签位数。

Tag memory size = 4*1 bits

标签存储器大小= 4 * 1位

Tag memory size =4 bits

标签存储器大小= 4位


(3) Set Associative Mapping)

In this mapping technique, the mapping function is used to transfer the data from main memory to cache memory. The mapping function is:

在这种映射技术中,映射功能用于将数据从主内存传输到高速缓存。 映射函数为:

K mod S = i

Where,

哪里,

  • K
    K是主内存块号,
  • S
    S是缓存集的数量,
  • And, i
    而且, 我是高速缓存集号。


qos映射实验 映射技术_mysql_05


  • Set associative cache controller interprets the CPU generated a request as:
    Set关联缓存控制器将CPU生成的请求解释为:
  • qos映射实验 映射技术_qos映射实验_06


  • A set offset is directly connected to the address logic of the cache memory. So, respective sets will be enabled.
    设置的偏移量直接连接到高速缓存的地址逻辑。 因此,将启用各个集合。
  • Set contain multiple blocks so to identify the hit block there is a need of multiplexer to compare existing tags in the enabled set one after the another based on the selection bit with the CPU generated a tag.
    集合包含多个块,因此要标识命中块,需要多路复用器根据选择位将启用的集合中的现有标签一个接一个地比较,并将其与CPU生成的标签进行比较。
  • If anyone is matching, the operation becomes hit. So, the data is transfer to the CPU. If none of them is matching, then operation becomes a miss. So, the reference is forward to the CPU.
    如果有人匹配,该操作将被命中。 因此,数据被传输到CPU。 如果它们都不匹配,则操作会丢失。 因此,该参考将转发给CPU。
  • The main memory block is transferred to the cache memory by using a set associative mapping function. Later data is transfer to CPU.
    通过使用一组关联映射功能将主存储块传输到高速缓存。 以后将数据传输到CPU。
  • In this technique, replacement algorithms are used to replace the blocks in the cache line, when the set is full.
    在该技术中,当集合已满时,将使用替换算法替换高速缓存行中的块。
  • Tag memory size = number of sets in cache * number of blocks in the set * tag bit.
    标签存储器大小=缓存中的集合数*集合中的块数*标记位。

Tag memory size = 2 * 2 * 2 bits.

标签存储大小= 2 * 2 * 2位。

Tag memory size = 8 bits.

标签存储器大小= 8位。

翻译自: https://www.includehelp.com/cso/mapping-techniques.aspx

计算机串口映射