计算机串口映射_计算机科学组织| 映射技术

计算机串口映射

映射技术 (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 are used.

将数据从主内存传输到缓存的过程称为映射。 在高速缓冲存储器中,使用了三种映射技术

  1. Associative mapping

    关联映射

  2. Direct mapping

    直接映射

  3. Set Associative mapping

    设置关联映射

Components present in each line are:

每行中存在的组件是:

  1. Valid bit: This gives the status of the data block. If 0 then the data block is not referenced and if 1 then the data block is referenced.

    有效位:这给出了数据块的状态。 如果为0,则不引用数据块;如果为1,则引用数据块。

  2. Tag: This is the main memory address part.

    标签:这是主存储器地址部分。

  3. Data: This is the data block.

    数据:这是数据块。

1)关联映射 (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.

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

Associative mapping 1
  • Associative cache controller interprets the CPU generated request as:

    关联的缓存控制器将CPU生成的请求解释为:

  • Associative mapping 2


  • 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)直接映射 (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 is the main memory block number.

    K是主存储块号。

  • N is the number of cache lines.

    N是缓存行数。

  • And, i is the cache memory line number.

    而且, 我是缓存行号。

Direct mapping 1
  • Direct cache controller interprets the CPU generated a request as:

    直接高速缓存控制器将CPU生成的请求解释为:

  • Direct mapping 2


  • 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)设置关联映射 (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 is the main memory block number,

    K是主内存块号,

  • S is the number of cache sets,

    S是缓存集的数量,

  • And, i is the cache memory set number.

    而且, 我是高速缓存集号。

Set Associative Mapping 1
  • Set associative cache controller interprets the CPU generated a request as:

    Set关联缓存控制器将CPU生成的请求解释为:

  • Set Associative Mapping 2


  • 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

计算机串口映射

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值