Chapter 6 The Memory Hierarch y n Lu 11210240054@fudan.edu.cn
Chapter 6 The Memory Hierarchy Jin Lu 11210240054@fudan.edu.cn
Problem 6. 1(p. 460) In a DRAM array r: the number of rows c: the number of columns b: the number of bits needed to address the rows b the number of bits needed to address the columns Target: minimizing max(br, bc) Organization r max(br, bc 16*1 16*4 128*8 16 c448 512*4 1024*4
Problem 6.1 (p.460) In a DRAM array r : the number of rows c : the number of columns br : the number of bits needed to address the rows bc : the number of bits needed to address the columns Target : minimizing max(br , bc ) Organization r c br bc max(br, bc) 16*1 16*4 128*8 512*4 1024*4 4 4 16 32 16 32 32 5 5 5 5 4 5 8 4 3 4 4 2 2 2 4 2 2 2
Problem 6.2(p. 468) What is the capacity of a disk with 2 platters, 10,000 cylinders, an average of 400 sectors per track, and 512 bytes per sector 10000400*512*(2*2)=8.192(GB
Problem 6.2 (p.468) • What is the capacity of a disk with 2 platters, 10,000 cylinders, an average of 400 sectors per track, and 512 bytes per sector. 10000 * 400 * 512 * (2 * 2) = 8.192 (GB)
Problem 6.3(p. 471) Tava rotation =1/2*T, max rotation 1/2(60secs/15000RPM)*1000ms/sec Tayatransfer=(60 secs/15000 RPM)*1/500 sectors/track 1000 ms/sec Parameter Value Rotational rate 15.000RPM avg seek 8 ms Average #sectors/track 500 access avg seel ek +T avg rotation avg transter
Problem 6.3 (p.471) • Estimate the average time (in ms) to access a sector on the following disk: Parameter Value Rotational rate 15,000 RPM Tavg seek 8 ms Average #sectors/track 500 Tavg rotation = 1/2 * Tmax rotation =1/2*(60 secs/15000 RPM) * 1000 ms/sec Tavg transfer = (60 secs/15000 RPM) * 1/500 sectors/track * 1000 ms/sec Taccess = Tavg seek + Tavg rotation + Tavg transfer
Problem 6.4(p. 481) Permute the loops the following function so that it scans the three-dimensional array a with a stride-1 reference pattern int sumarray 3d(int aNINiNDo int i,j, k, sum =0; for(i=0; i<N; i++)//k forf=0;j<N;j++)∥ for (k=0; k<N; k++)/li sum +=akon:
Problem 6.4 (p.481) • Permute the loops the following function so that it scans the three-dimensional array a with a stride-1 reference pattern. int sumarray3d(int a[N][N][N]){ int i,j,k,sum = 0; for(i = 0; i < N; i++) //k for(j = 0; j < N; j++) //i for(k = 0; k < N; k++) //j sum += a[k][i][j]; }