Question: 10 . Consider now a machine with 32-bit virtual addresses and 16-bit physical addresses. The memory is byte-addressable. This machine has a linear (i.e., single-level)

10 . Consider now a machine with 32-bit virtual addresses and 16-bit physical addresses. The memory is byte-addressable. This machine has a linear (i.e., single-level) page table with a page size of 4 Kbytes. Consider the following C code to be executed on this machine:

int A[1024*256]; //1 Mbyte array

int sum = 0;

for (int i = 0; i < 256; i++) {

sum = sum + A[i*1024];

}

Here, A is a 32-bit integer array (i.e., each element of the array occupies 4 bytes). The first element of the array is stored at virtual address 0. In the following subquestions, we focus on access to array A by ignoring access to other variables and instructions.

1 How many bits in a virtual memory address should be used for the page offset? Give your answer as a base 10 number (and only write down the number).

2 Assume the machine does not have a translation lookaside buffer (TLB). To execute the code, how many accesses to the page table are required? Give your answer as a base 10 number (and only write down the number).

3 We now want to add a TLB to speed up virtual memory address translation. What is the minimum number of TLB entries required to ensure no TLB misses for the above code? Give your answer as a base 10 number (and only write down the number).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!