Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8.5 [M] The memory of a computer is byte-addressable, and the word length is 32

ID: 2081513 • Letter: 8

Question

8.5 [M] The memory of a computer is byte-addressable, and the word length is 32 bits. A program consists of two nested loops a small inner loop and a much larger outer loop The general structure ofthe program isgiven in Figure P8.1. The decimal memory addresses shown delineate the location of the twoloops and the beginning and end of the total program. All memory locations in the various sections of the program, 8-52, 56-136, 140-240, and so on, contain instructions to be executed in straight-line sequencing. The program is to be run on a computer that has an instruction cache organized in the direct-mapped manner (see Figure 8 with the following parameters: Cache size 1K bytes Block size 128 bytes The miss penalty in the instruction cache is 80T, where T is the access time of the cache. Compute the total time needed for instruction fetching during execution of the program in Figure P8.1 PROBLEMS 329 START 8 56 140 Outer loo Inner l00 executed 10 times 20 times 240 1200 END 1504 Figure P8.1 A program structure for Problem 8.5.

Explanation / Answer

peramiters to hex

1K – 0×0400

128 bytes – 0×0080

a new block will start every 80 HEX

Direct mapped cache

Miss penalty – 80

8 – 0×0008
56 – 0×0038
140 – 0x008C
240 – 0x00F0
1200 – 0x04B0
1504 – 0x05E0

first 3 caches get kicked 240-1200 has 7 misses, so up to 1200 we have 10 misses

2 addition misses happen after the inner loop so the outer loop = 20*2 +2

Total misses = 2*20+2 = 42 misses to run the program through completion.

Total time needed for execution of program = t=80
(2*20+)80t + t[10*([100*20] + ( 140-56 + 1200 – 240)) + 56 – 8 + 1504 – 1200]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote