直接映射的缓存的地址字段中有多少位? [英] How many bits are in the address field for a directly mapped cache?

查看:155
本文介绍了直接映射的缓存的地址字段中有多少位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个基于直接映射缓存的问题,所以我假设

This is a question based on Direct Mapped Cache so I am assuming that it's ok to ask here as well.

这是我正在研究的问题:

问题:高速工作站具有64位字和64位地址,其字节级别的地址分辨率。假定具有8192条64字节行的直接映射的高速缓存,在以下每个高速缓存的地址字段中有多少位?1)字节2)索引3)标记?

Here is the problem I am working on:
The Problem: " A high speed workstation has 64 bit words and 64 bit addresses with address resolution at the byte level. Assuming a direct mapped cache with 8192 64 byte lines, how many bits are in each of the following address fields for the cache? 1) byte 2) Index 3) Tag?"

首先,我在此问题中定义了术语,并使用了另一个堆栈溢出直接映射缓存问题和我在缓存作为参考(如果我的定义有误,请更正我错误的)

First I defined the terms in this problem and used the other Stack Overflow Direct Mapped Cache question and my other question on Caching as references(Please correct me if any of my definitions are wrong)


  • 64位字-处理器一次可以处理64位

  • 64位地址带字节级寻址-RAM中有2 ^ 64个存储单元,每个存储单元存储一个字节。
  • 缓存是高速的并划分为缓存行

  • 直接映射的缓存是将RAM内存块映射到一个缓存行(不确定

  • 64 bit words - processor can process 64 bits at a time
  • 64 bit addresses w byte level addressing - there are 2^64 memory locations in RAM and each memory location stores a byte.
  • Cache is high speed and is partitioned into cache lines
  • Directly Mapped Cache is where a RAM memory block is mapped into one cache line(not sure of the significance of this

现在以直接映射缓存作为参考

Now working off Direct Mapped Cache as a reference


  1. 字节-由于字节行由64个字节组成,因此您需要6位才能标识该字节行中的单个字节

  2. 索引-因为有8192个行的字节行,所以至少需要10位才能标识每一行

现在这是我被困的地方。其他帖子说:所有其他位都是TAG位。而本讲座帖子说:每行都有一个标记,用于指示从中复制行的M地址。我猜想M就是RAM。

Now heres the part of where I am stuck. The other post said "All the other bits are TAG bits." while this lecture post said "Each line has a tag that indicates the address in M from which the line has been copied". I am guessing that M means the RAM.

所以在这里,所有其他位将是64-6-10 = 48位。但是您是否不需要TAG中的所有64位来指示高速缓存中的数据来自RAM中的哪个存储位置?有人可以澄清我在这里的困惑吗?

So here, all the other bits would be 64 - 6 - 10 = 48 bits. But wouldn't you need all 64 bits in the TAG to indicate what memory location in the RAM the data in the cache came from? Can someone clarify the confusion I have here?

推荐答案

看完缓存视频,我能够弄清楚这一点。 (强烈推荐此视频)

如果有任何错误,请纠正我

After watching this Caching Video, I was able to figure this out. (Highly recommend this video)
Please correct me if any of this is wrong

该地址总共有64位。现在,对于缓存地址的不同组成部分,

In total the address has 64 bits. Now for the different components of the cache address


  • 字节-字节行中有64个字节。一个字为64位或8个字节长。因此,一个字节行可以容纳8个字。因为您需要确定要处理的单词(处理器一次处理一个单词),所以为此

  • Index需要 3 位-您需要确定地址所指向的缓存行。感谢@Leeor的评论,您将需要 13 位来执行此操作,因为有8192条缓存行

  • Tag-其余位用于TAG 。那是64-3-13 = 48位

  • Byte - There are 64 bytes in a byte line. A word is 64 bits or 8 bytes long. Therefore a byte line can hold 8 words. Because you need to identify which word is to be processed(Processor processes one word at a time), you're going to need 3 bits for this
  • Index - You need to identify which cache line the address refers to. Thanks to @Leeor's comment, youre going to need 13 bits to do this because there are 8192 cache lines
  • Tag - the rest of the bits are for the TAG. That be 64 - 3 - 13 = 48 bits

这篇关于直接映射的缓存的地址字段中有多少位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆