636 views

Suppose we have virtual memory containing 8 pages with 512 bytes per page and physical memory with 16-page frames.

Given the following page table ( where virtual page number gives page number and page frame number gives frame number ), the physical address( in decimal ) corresponding to the virtual address of page number 4, byte 241 is ______ .

### 1 comment

Virtual address bits: log2(8 * 512) = 12 bits.

Physical address bits: log2(16 * 512) = 13 bits.

Binary physical address = 0 0110 1111 0001

The virtual address is 12 bits long, the first 3 bits to identify the pages, the last 9 bits

used as offset to identify bytes in the page.

The physical address is 13 bits long, the first 4 bits to identify the frames, the last 9 bits used as offset to identify bytes in frame.

Virtual address of page 4 corresponds to frame 3, so the physical address is

0011011110001.

# pages = 8

page size = 512 Byte = frame size

# frames = 16

physical memory address consists of frame no.+ byte offset

for 16 frames 4 bit will be frame no. & since page size is 512 Bytes, byte offset = 9 bits.

physical address length = 4+9=13 bits.

Now, it can be seen from the page table that page no. 4 is having frame no. 3, which mean page no. 4 is in frame no. 3 of main memory.

And within the page we have to access byte no. 241.

so physical address will look like: 3,241->convert it to 13 bit binary->0011011110001=(1777) base 10.

### 1 comment

if byte number is 241 and initial address   of  the pageframe  3 is  1536 which is also the first byte address of the given first  byte  then address of the 241 byte must be 1536+240=1776