Converting virtual to physical address
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.
- 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
add a comment |
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.
- 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
Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 '18 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 '18 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 '18 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 '18 at 2:46
add a comment |
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.
- 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
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.
- 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
operating-system
edited Nov 22 '18 at 2:04
Saiba
asked Nov 22 '18 at 1:30
SaibaSaiba
417
417
Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 '18 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 '18 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 '18 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 '18 at 2:46
add a comment |
Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 '18 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 '18 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 '18 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 '18 at 2:46
Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 '18 at 1:34
Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 2:46
add a comment |
0
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Possible duplicate of translate virtual address to physical address
– Ken White
Nov 22 '18 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 '18 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 '18 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 '18 at 2:46