How many memory references does it take to execute this instruction?

Just one. It accesses location 200 to get the data and then puts that value into the register BX.

Of course the instruction had to be loaded from memory before it could be executed so we should probably count that also. Therefore, it takes 2 references.

One to fetch the instruction.

One to fetch the data from location 200.

How many memory references would that same instruction take on a machine with a single level page table? (Including fetching the instruction.)

Four!

Look up the physical address of the instruction in the page table.

Fetch the instruction from that physical memory location.

Look up the physical address of the data in the page table. I.e. Translate the virtual address 200 to a physical address.

Fetch the data from the memory.

How many memory references would that same instruction take on a machine with a two level page table?

Six

Look up the second level page table for the instruction in the outer page table.

Look up the physical address of the instruction in the second level page table.

Fetch the instruction from that physical memory location.

Look up the second level page table for the data in the outer page table.

Look up the physical address of the data in the second level page table. I.e. Translate the virtual address 200 to a physical address.

Fetch the data from the memory.

Memory accesses take time.

A single level page table makes the machine twice as slow as it would be without the virtual memory.

A two level page table makes the machine three times as slow as it would be without the virtual memory.


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: