gpt4 book ai didi

32-bit - 一台机器有一个32位的地址和一个8KB的机器

转载 作者:行者123 更新时间:2023-12-02 22:12:57 24 4
gpt4 key购买 nike

A machine has a 32-bit address space and a page size of 8KB. The page table is entirely in hardware, with one 32-bit word per entry. When a process is scheduled, its page table is copied to the hardware from memory, at a rate of one word / 100 ns. If each process runs for 100ms (including the time to load the page table), what fraction of the CPU time is devoted to loading the page tables?

是的;这是一道作业题。我调查了一下,到目前为止我发现

页表大小(字节)= 条目数 * 条目大小。所以x= 32*8192(位)= 262144

我知道这是错误的答案,它是 52; 4288毫秒我将在

的后一个等式中使用它

加载页表的时间/总时间 = CPU 使用

此处发布了一个我不太理解的解决方案。

http://www.cs.inf.ethz.ch/ssw/exercises/solution_04.pdf

最佳答案

这里棘手的部分是计算页表的大小。一旦你有了它,将它乘以加载每个表条目所需的时间。表条目有多大并不重要 - 重要的是加载它需要多长时间。

所以考虑一个 32 位地址空间。里面有多少个8K的chunk?那是您引用的文档中减去位的部分。描述8K需要13位。请注意 2 ^ 13 = 8K(通过注意 1024 占用 10 位来快速计算它。它有点助记且易于内存。8 占用 3 位,10 + 3 = 13。或者使用计算器查看 2 的幂等于多少8K.)

整个地址空间的 32 位减去 13 得到 19,所以有 2 ^ 19 页。

现在只需将 2 ^ 19 乘以 100 ns 就可以了。你有它。

关于32-bit - 一台机器有一个32位的地址和一个8KB的机器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14947828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com