How to translate this logical address into physical address?

15,339

address 1027 maps to p 0 because 1027 % 2048(2K)=1027 floor(1027/2048)=0. So 1027 maps to 1027th byte of page 0 in virtual address.

Page 0 Virtual Address is mapped to frame number 9 according to page table.

frame 9 has a base address of 9 * 2048 = 18432 . Frame 9 has a base address of 18342 in the physical memory.

Now 1027th byte of frame 9 is at 18342 + 1027 = 19369 address of the physical memory.

change the numbers to binary and you have your answer.
See this answer and follow the link given there to understand the concept.

Cheers ...

Share:
15,339
user2032090
Author by

user2032090

Updated on June 04, 2022

Comments

  • user2032090
    user2032090 almost 2 years

    Given that:

    Logical addresss space=16
    bits Physical address space=16 
    bits Page size=2K
    

    How the logical address 1027 will be mapped to physical address for the following page table?

    
    p      f
    0      9
    1      7
    2      3
    

    Thank You!

    • user2032090
      user2032090 about 11 years
      p is the index in the page table and f is the corresponding frame in the physical address space. I have calculated the sizes of p which is 5 bits out of 16 bits and offset (d) which is 11 bits.
  • user2032090
    user2032090 about 11 years
    O thank you so much @Deepthought. I'm new to memory management and was very much confused whether I'm translating logical addresses to physical ones or not. You have solidified my concept. Thanks. Going to choose your answer as best! Thanks once again!