操作系统.存储器地址的二进制格式.计算机组织



我在理解这里发生的事情时遇到了一些问题,似乎无法理解。

注意事项:关于主题的课程笔记

示例:

Memory location 0x1f6
What is the binary format of this address? 1 1111 0110
What are tag, block index, and block offset? 3, 7, 6

我自己的作品:

Memory location 0x033
What is the binary format of this address? 0 0011 0011
What are tag, block index, and block offset? 0 6, 3
Memory location 0x009
What is the binary format of this address? 0 0000 1001
What are tag, block index, and block offset? 0, 1, 1
Memory location 0x652
What is the binary format of this address? 0110 0101 0010
What are tag, block index, and block offset? 12, 10, 2

这些都是我的尝试,但我不知道我做得是否正确,我有一种感觉,至少在最后一次,我认为这是错误的。有人能给我指正确的方向吗?

我终于弄明白了。块偏移量取决于块大小,在本例中为16字节,因此需要4个二进制数字来表示。接下来,块索引取决于块的数量,在本案中为8(0-7(,需要3个二进制数字。最后,将十六进制内存位置转换为二进制后,标记由剩余的二进制数字组成。

示例

Memory location 0x652
What is the binary format of this address? 0110 0101 0010
What is the binary representation of tag, block index, and block offset? 1100 101 0010
What are tag, block index, and block offset? 12, 7, 2

最新更新