324_Book

# B to make tiny reentrant we must replace all calls to

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: this problem is a straightforward application of the formula for disk access time. The average rotational latency (in ms) is surfaces ¢ 10,000 tracks ¢ 2 platter ¢ 2 platters surface disk Ì Ú ÖÓØ Ø ÓÒ 1/2 ¢ ÌÑ 2 ms 1/2 ¢ ´60 secs / 15,000 RPMµ ¢ 1000 ms/sec Ü ÖÓØ Ø ÓÒ The average transfer time is Ì Ú ØÖ Ò× Ö ´ 60 secs / 15,000 RPMµ ¢ 1/500 sectors/track ¢ 1000 ms/sec 0.008 ms Putting it all together, the total estimated access time is Ì ×× Ì Ú × · Ì Ú ÖÓØ Ø ÓÒ · Ì Ú ØÖ Ò× Ö 8 ms · 2 ms · 0.008 ms 10 ms Problem 6.4 Solution: [Pg. 298] To create a stride-1 reference pattern, the loops must be permuted so that the rightmost indices change most rapidly. 1 2 3 4 5 6 7 8 9 10 11 12 13 int sumarray3d(int a[N][N][N]) { int i, j, k, sum = 0; for (k = 0; k < N; k++) { for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { sum += a[k][i][j]; } } } return sum; } B.6. THE MEMORY HIERARCHY 719 This is an important idea. Make sure you understand why this particular loop permutation results...
View Full Document

## This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online