enter image description here


I am learning about memory management in operating systems. I am confused with Address Translation. In this question (pic attached), can anyone explain, how the answer is obtained for Blank #2? What are the steps? Thanks in advance

  • $\begingroup$ You are asked to find the logical address of 0xABCD and the answer you say is a 32 bit address. There are errors in the question I suppose $\endgroup$ Jul 29, 2020 at 5:10
  • 1
    $\begingroup$ @AbhishekGhosh is right, this answer is weird. There are many weird things about this question. But the right answer is actually 0x07CD. Do you need help figuring out where that comes from? $\endgroup$ Jul 29, 2020 at 8:04
  • $\begingroup$ @СергейМакеев Yes, please.. how to get 0x07CD ? $\endgroup$ Jul 29, 2020 at 13:27
  • $\begingroup$ @AbhishekGhosh Ok.. how to find the logical address if the page table & physical memory is given? $\endgroup$ Jul 29, 2020 at 13:30

1 Answer 1

  1. Since the question asked is to find the logical address, it follows that the thing given (0xABCD) is the physical address, the one obtained after translation.
  2. Let's convert the address given to binary, and then split the address as prescribed in the question: 6 bits for page id, 10 bits for offset.
       A    B    C    D
    1010 1011 1100 1101 

    101010 1111001101
  1. Converting the page id 101010 to hex, we get 0x2A, which is indeed one of the numbers in the page table - specifically, it's the location of the page number 1. Therefore, the 6-bit page id before the translation was just the number 1.
  2. Just replace the physical page location with the logical page id, and convert back to hexadecimal.
    Physical: 101010 1111001101
    Logical:  000001 1111001101
              0000 0111 1100 1101
                 0    7    C    D
  • $\begingroup$ Let's convert the address given to binary, and then split the address as prescribed in the question: 6 bits for page id, 10 bits for offset. Your this statement is not quite right though. The physical address is not partitioned into the 6bit 10 bit format. Actually the logical address is (as happens in a usual OS) then after the mapping the offset for the physical address remains the same. But the page to frame map occurs as per the page table. So rather it should be correct to say that after taking away 10 bits from the physical address we are left with 6 bits for the frame number... $\endgroup$ Jul 29, 2020 at 15:10
  • $\begingroup$ Moreover the question has another problem possibly. Suppose that we assume the physical address of 16 bits then after taking away 10 bits for the page offset you are left with 6 bits for the frame... And to make it of the hex format you are padding extra 00 in the front. but what about the frame id 0xEE => 11101110 this should imply that our physical address is of 18 bits so 0xABCD not possibly a potential candidate for physical address $\endgroup$ Jul 29, 2020 at 15:15
  • 1
    $\begingroup$ @AbhishekGhosh Yes, I noticed the 0xEE, that is one of the many things wrong about this question. Maybe they're using it for a "missing page" indicator or something. $\endgroup$ Jul 29, 2020 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.