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.
- 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 |
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.
- 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 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
add a comment |
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.
- 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 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
add a comment |
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
add a comment |
active
oldest
votes
active
oldest
votes
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.
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.
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 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