Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

translate virtual address to physical addres

Status
Not open for further replies.

naspek

Member level 1
Joined
Feb 17, 2010
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,546
1. The problem statement, all variables and given/known data

A virtual memory system has a page size of 512 bytes, seven virtual pages, and four
physical page frames. The page table is as follows:
VPN.........PFN
0..............2
1..............0
2..............-
3..............1
4..............3
5..............-
6..............-
Note: VPN -> Virtual Page Number, PFN -> Page Frame Number


What physical address, if any, would each of the following virtual addresses
correspond to?
i. 0
ii. 2010
iii. 2046
iv. 3030
v. 1026

3. The attempt at a solution

i. 0============ 0000 0000 0000
ii. 2010========= 0111 1101 1010
iii. 2046========= 0111 1111 1110
iv. 3030======== 1011 1101 0110
v. 1026======== 0100 0000 0010

i've translate it to binary number already..
but.. i don't how to proceed(how to use the table given)..
can someone plz guide me..
 

This sounds like a homework question ^_-

You can either build a more complete page table or solve it mathematically. The page table method will help you to better learn and understand how this system works.

For example, you know that each page is 512 bytes, regardless of weather it's virtual or physical. Also, some of your virtual memory is unassigned (free), as indicated by the dashes. So some of the answers could be 'unallocated'.

So since your page size is 512b, page 0 would start at byte 0 and go to byte 511, page 1 would be 512-1023, 2 would be 1024 - 1535, and so on. You have to be careful, because the zero byte will screw you up. The zero byte still counts as a byte.

For the first example, virtual location 0 would map to byte 0 in physical page 2, which is physical byte 1024.

To look at it another way, 512 = 1 1111 1111. That's 9 bits. So bits 0-8 give you your address and the bits above that give you your page number. So, in the example of the second address which is 2010, bits 9-11 are 011 = 3, so this is on virtual page 3. Looking in our table, page 3 maps to physical page 1. So we just change bits 9-11 to 001 to get our answer of 0011 1101 1010, or 986. Hopefully that explains it well enough.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top