A machine has a 32 bit address and an 8KB machine

Kevin Johnson picture Kevin Johnson · Feb 19, 2013 · Viewed 10.8k times · Source

A machine has a 32-bit address space and a page size of 8KB. The page table is entirely in hardware, with one 32-bit word per entry. When a process is scheduled, its page table is copied to the hardware from memory, at a rate of one word / 100 ns. If each process runs for 100ms (including the time to load the page table), what fraction of the CPU time is devoted to loading the page tables?

Yes; this is a Homework problem. I looked into it and so far I've found that

size of pagetable(bytes) = number of entries *size of entry. Therefore x= 32*8192(bits) = 262144

I know this is the wrong answer and that it's 52; 4288ms which i will be using in the latter equation of

Time to load page table / Total time = CPU use

a solution which I can't quite understand is posted here.

http://www.cs.inf.ethz.ch/ssw/exercises/solution_04.pdf

Answer

Lee Meador picture Lee Meador · Feb 19, 2013

The tricky part here is calculating the size of the page table. Once you have that, multiply it times the time it takes to load each table entry. It's not relevant how big a table entry is - only how long it takes to load it.

So think about a 32 bit address space. How many 8K chunks are there in it? That's the part of the document you referenced that is subracting bits. It takes 13 bits to describe 8K. Notice that 2 ^ 13 = 8K (Quickly calculate it by noting that 1024 takes 10 bits. It's sort of mnemonic and easy to remember. 8 takes 3 bits and 10 + 3 = 13. Or use a calculator to see what power of 2 equals 8K.)

32 bits for the whole address space less 13 gives 19, so there are 2 ^ 19 pages.

Now just multiply 2 ^ 19 times 100 ns and bingo. You have it.