开发者

simple paging system

开发者 https://www.devze.com 2023-02-27 20:33 出处:网络
I have this question and I am not sure how to solve it: Consider a simple paging system with the following parameters:

I have this question and I am not sure how to solve it:

Consider a simple paging system with the following parameters:

  1. 2^32 bytes of physical memory
  2. page size of 2^10 bytes
  3. 2^16 pages of logical add开发者_JS百科ress space

How many bits are there in logical memory?

How many bytes in a frame?


How many bits are there in logical memory (you mean address)?

  • 16 (2^16 is the number of pages) + 10 (2^10 is the size of page table) = 26 bits

How many bytes in a frame?

  • A frame is the same size as a page, so 2^10 bytes are required.


1)size of 1 page is 2^10 bytes and there are 2^16 pages of logical address space so if we multiply both we calculate total bytes of pages in logical address;

2^16 * 2^10 = 2^26 bytes 1 byte = 8 bits so (2^26)*(2^3) is your answer.

2) page is 2^10 and 2^16 pages of logical space so again if we multiply both we find how many bytes in a frame 2^16 * 2^10 = 2^26 bytes


I'm going to answer this with some questions that will hopefully lead you to the answers yourself (rather then simply answering the questions), I hope that this is ok.

How many bits are there in logical memory?

What do you define as Logical Memory? (may help: http://en.wikipedia.org/wiki/Logical_address) (also just in case you're not certain, a byte = 8 bits, so if you can get an answer in bytes, then you can figure out bits)

How many bytes are in a frame?

Can you clarify what a frame is? I would be happy to answer this one more clearly once I know specifically what you are referring to (sorry if this should be more obvious, I have a guess, but I'm worried that might be part of your assignment and don't want to give you the answer until you've tried clarifying).

Your overall question reminds me of Virtual Memory which I had a homework assignment in my operating systems class, but it wanted you to find where a particular address would exist at, if you want some additional reading you can check it out here: http://blog.onaclovtech.com/2010/10/virtual-memory.html

The whole idea of virtual memory is that you can always assume your address will be within a specific range of addresses. So even if you have a 500GB drive (for example) you might just have a range of 4096bytes and a whole LOT of pages. So you know your addresses will ALWAYS fall into the address range of the 4096bytes

0

精彩评论

暂无评论...
验证码 换一张
取 消