Converting virtual to physical address











up vote
0
down vote

favorite












I apologize this is for an assignment but I'm having trouble finding info online on how to do this. And my professor fails to answer my emails. I do have some work done on it but I'm not sure if it's right.




  1. Assume you have a virtual memory system with 32-bit virtual and physical addresses. Assume also that your page size is 4KB.


(a) How many bits are needed for the offset part of the virtual address?



12 bits



(b) How many bits are needed for the page number part of the virtual address?



16 bits



(c) How many different page numbers does this system support? (You can express this as a power of two)



2 ^ 4



(d) If a page table entry takes up 4 bytes, how much space in MB would a page table for this system take up if it were stored in physical memory?



4MB



Mostly I need help on how to approach this. I would appreciate any help :) Thank you everyone for your time.



2) Given the assumptions above and the page map below, translate the following virtual addresses to physical addresses:



Page Number     Frame Number
0 4
1 0
2 3
3 5
4 1
5 2


(a) 0



(b) 42



(c) 4096



(d) 5000



(e) 10000



(f) 20000



Physical addresses: These are the answers I have. I don't know if they're right. They're supposed to be expressed in base 10.



A. 16384



B. 16426



C. 0



D. 904



E. 14096



F. 7712










share|improve this question
























  • Possible duplicate of translate virtual address to physical address
    – Ken White
    Nov 22 at 1:34










  • Yes, this is the question I had looked at while searching online. I'm still having trouble understanding it though.
    – Saiba
    Nov 22 at 1:42










  • I can say that your answers to 1.b and 1.c aren't right (hints: if a virtual address is 32 bits and gets split into 2 fields, page number and offset, then the sizes of both of the fields has to add up to 32 bits. If an integer has N bits, then there are 2^N possible values it can hold).
    – Brendan
    Nov 22 at 2:30










  • Okay I think I get what you're saying. So 1.b should be 20 bits and 1.c should be 2^5 power?
    – Saiba
    Nov 22 at 2:46















up vote
0
down vote

favorite












I apologize this is for an assignment but I'm having trouble finding info online on how to do this. And my professor fails to answer my emails. I do have some work done on it but I'm not sure if it's right.




  1. Assume you have a virtual memory system with 32-bit virtual and physical addresses. Assume also that your page size is 4KB.


(a) How many bits are needed for the offset part of the virtual address?



12 bits



(b) How many bits are needed for the page number part of the virtual address?



16 bits



(c) How many different page numbers does this system support? (You can express this as a power of two)



2 ^ 4



(d) If a page table entry takes up 4 bytes, how much space in MB would a page table for this system take up if it were stored in physical memory?



4MB



Mostly I need help on how to approach this. I would appreciate any help :) Thank you everyone for your time.



2) Given the assumptions above and the page map below, translate the following virtual addresses to physical addresses:



Page Number     Frame Number
0 4
1 0
2 3
3 5
4 1
5 2


(a) 0



(b) 42



(c) 4096



(d) 5000



(e) 10000



(f) 20000



Physical addresses: These are the answers I have. I don't know if they're right. They're supposed to be expressed in base 10.



A. 16384



B. 16426



C. 0



D. 904



E. 14096



F. 7712










share|improve this question
























  • Possible duplicate of translate virtual address to physical address
    – Ken White
    Nov 22 at 1:34










  • Yes, this is the question I had looked at while searching online. I'm still having trouble understanding it though.
    – Saiba
    Nov 22 at 1:42










  • I can say that your answers to 1.b and 1.c aren't right (hints: if a virtual address is 32 bits and gets split into 2 fields, page number and offset, then the sizes of both of the fields has to add up to 32 bits. If an integer has N bits, then there are 2^N possible values it can hold).
    – Brendan
    Nov 22 at 2:30










  • Okay I think I get what you're saying. So 1.b should be 20 bits and 1.c should be 2^5 power?
    – Saiba
    Nov 22 at 2:46













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I apologize this is for an assignment but I'm having trouble finding info online on how to do this. And my professor fails to answer my emails. I do have some work done on it but I'm not sure if it's right.




  1. Assume you have a virtual memory system with 32-bit virtual and physical addresses. Assume also that your page size is 4KB.


(a) How many bits are needed for the offset part of the virtual address?



12 bits



(b) How many bits are needed for the page number part of the virtual address?



16 bits



(c) How many different page numbers does this system support? (You can express this as a power of two)



2 ^ 4



(d) If a page table entry takes up 4 bytes, how much space in MB would a page table for this system take up if it were stored in physical memory?



4MB



Mostly I need help on how to approach this. I would appreciate any help :) Thank you everyone for your time.



2) Given the assumptions above and the page map below, translate the following virtual addresses to physical addresses:



Page Number     Frame Number
0 4
1 0
2 3
3 5
4 1
5 2


(a) 0



(b) 42



(c) 4096



(d) 5000



(e) 10000



(f) 20000



Physical addresses: These are the answers I have. I don't know if they're right. They're supposed to be expressed in base 10.



A. 16384



B. 16426



C. 0



D. 904



E. 14096



F. 7712










share|improve this question















I apologize this is for an assignment but I'm having trouble finding info online on how to do this. And my professor fails to answer my emails. I do have some work done on it but I'm not sure if it's right.




  1. Assume you have a virtual memory system with 32-bit virtual and physical addresses. Assume also that your page size is 4KB.


(a) How many bits are needed for the offset part of the virtual address?



12 bits



(b) How many bits are needed for the page number part of the virtual address?



16 bits



(c) How many different page numbers does this system support? (You can express this as a power of two)



2 ^ 4



(d) If a page table entry takes up 4 bytes, how much space in MB would a page table for this system take up if it were stored in physical memory?



4MB



Mostly I need help on how to approach this. I would appreciate any help :) Thank you everyone for your time.



2) Given the assumptions above and the page map below, translate the following virtual addresses to physical addresses:



Page Number     Frame Number
0 4
1 0
2 3
3 5
4 1
5 2


(a) 0



(b) 42



(c) 4096



(d) 5000



(e) 10000



(f) 20000



Physical addresses: These are the answers I have. I don't know if they're right. They're supposed to be expressed in base 10.



A. 16384



B. 16426



C. 0



D. 904



E. 14096



F. 7712







operating-system






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 2:04

























asked Nov 22 at 1:30









Saiba

336




336












  • Possible duplicate of translate virtual address to physical address
    – Ken White
    Nov 22 at 1:34










  • Yes, this is the question I had looked at while searching online. I'm still having trouble understanding it though.
    – Saiba
    Nov 22 at 1:42










  • I can say that your answers to 1.b and 1.c aren't right (hints: if a virtual address is 32 bits and gets split into 2 fields, page number and offset, then the sizes of both of the fields has to add up to 32 bits. If an integer has N bits, then there are 2^N possible values it can hold).
    – Brendan
    Nov 22 at 2:30










  • Okay I think I get what you're saying. So 1.b should be 20 bits and 1.c should be 2^5 power?
    – Saiba
    Nov 22 at 2:46


















  • Possible duplicate of translate virtual address to physical address
    – Ken White
    Nov 22 at 1:34










  • Yes, this is the question I had looked at while searching online. I'm still having trouble understanding it though.
    – Saiba
    Nov 22 at 1:42










  • I can say that your answers to 1.b and 1.c aren't right (hints: if a virtual address is 32 bits and gets split into 2 fields, page number and offset, then the sizes of both of the fields has to add up to 32 bits. If an integer has N bits, then there are 2^N possible values it can hold).
    – Brendan
    Nov 22 at 2:30










  • Okay I think I get what you're saying. So 1.b should be 20 bits and 1.c should be 2^5 power?
    – Saiba
    Nov 22 at 2:46
















Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 at 1:34




Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 at 1:34












Yes, this is the question I had looked at while searching online. I'm still having trouble understanding it though.
– Saiba
Nov 22 at 1:42




Yes, this is the question I had looked at while searching online. I'm still having trouble understanding it though.
– Saiba
Nov 22 at 1:42












I can say that your answers to 1.b and 1.c aren't right (hints: if a virtual address is 32 bits and gets split into 2 fields, page number and offset, then the sizes of both of the fields has to add up to 32 bits. If an integer has N bits, then there are 2^N possible values it can hold).
– Brendan
Nov 22 at 2:30




I can say that your answers to 1.b and 1.c aren't right (hints: if a virtual address is 32 bits and gets split into 2 fields, page number and offset, then the sizes of both of the fields has to add up to 32 bits. If an integer has N bits, then there are 2^N possible values it can hold).
– Brendan
Nov 22 at 2:30












Okay I think I get what you're saying. So 1.b should be 20 bits and 1.c should be 2^5 power?
– Saiba
Nov 22 at 2:46




Okay I think I get what you're saying. So 1.b should be 20 bits and 1.c should be 2^5 power?
– Saiba
Nov 22 at 2:46

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422704%2fconverting-virtual-to-physical-address%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422704%2fconverting-virtual-to-physical-address%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Trompette piccolo

Slow SSRS Report in dynamic grouping and multiple parameters

Simon Yates (cyclisme)