World's most popular travel blog for travel bloggers.

[Solved]: Understanding Logical to Physical Addressing

, , No Comments
Problem Detail: 

I am trying to understand the concept of logical to physical addressing.
I am given 72 physical addresses (0-71) with values

A virtual address = 2^(p+w) p = page bits w = word bits

I know the page table is of size 6 indexed 0-5

If a page size is 16 words does that mean that the offset(w)=4, giving me 2^(p+4).

If thats the case how do I determine what the page number (p) if given a logical address of 12? I was thinking it would be 3 because I would need 3 bits to find the index of the page table 0-5, giving me 000 1100, index 0, offset 12. I feel like I might be missing something.

Asked By : MangoHabanero

Answered By : suraj3

I think you are confused in how logical address is get converted into physical address of main memory. Let's take a walk from basics: logical and physical memory are divided into fixed size pages and frames respectively to remove external fragmentation.

As size of logical memory is generally bigger than physical memory so we can't bring all pages from logical memory into physical memory that's why we require a page table that contains the entry of pair(page no. , frame no.).

Now as always CPU generates a logical address of say 15 bits with 10bits for page size and 5bits for identifying frame no. from page table(5bits means that there can be maximum 2^5 pages), now using those 5 bits cpu index page table and find the frame no. in which the required page is residing say that's of 4 bits(that mean a maximum of 2^4 frames ) then the physical address will be made by replacing 5bits by those 4bits + 10bits in logical address.

Your interpretation in question is correct.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/44299

 Ask a Question

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback