Ik heb een vraag over een opdracht die in mijn reader staat. hierbij staat ook het antwoord maar met het antwoor snap ik er eigenlijk nog niks van. Zou iemand wat extra uitleg kunnen geven.
dit is de vraag:
Given a MIPS processor with an 8 kbyte level-1 direct-mapped date cache. On this processor the following code is running:
sum = 0;
for (i=0; i<4; i++)
sum = sum + A[i] + A[i+2];
'A' is an array of (32-bit) integers, word aligned in memory. All other variables used in this program are located in registers.
What is the data cache hit-rate for this program, assuming that the cache has a) 1-word (32-bit) blocks, or b) 2-word, or c) 4-word blocks?
antwoord:
There are no capacity problems or conflict problems.
The access pattern for A is: 0, 2, 1, 3, 2, 4, 3, 5
The hit (H) and miss (M) patterns are indicated below.
a. 1-word block: M M M M H M H M -> 2/8 * 100 = 25 % hit-rate
b. 2-word block: M M H H H M H H -> 5/8 * 100 = 62.5 %
c. 4-word block: M H H H H M H H -> 6/8 * 100 = 75 %
maar hoe komen ze aan die acces pattern en wanneer is het een hit en een mis?
alvast bedankt
Groetjes Gijsbert
dit is de vraag:
Given a MIPS processor with an 8 kbyte level-1 direct-mapped date cache. On this processor the following code is running:
sum = 0;
for (i=0; i<4; i++)
sum = sum + A[i] + A[i+2];
'A' is an array of (32-bit) integers, word aligned in memory. All other variables used in this program are located in registers.
What is the data cache hit-rate for this program, assuming that the cache has a) 1-word (32-bit) blocks, or b) 2-word, or c) 4-word blocks?
antwoord:
There are no capacity problems or conflict problems.
The access pattern for A is: 0, 2, 1, 3, 2, 4, 3, 5
The hit (H) and miss (M) patterns are indicated below.
a. 1-word block: M M M M H M H M -> 2/8 * 100 = 25 % hit-rate
b. 2-word block: M M H H H M H H -> 5/8 * 100 = 62.5 %
c. 4-word block: M H H H H M H H -> 6/8 * 100 = 75 %
maar hoe komen ze aan die acces pattern en wanneer is het een hit en een mis?
alvast bedankt
Groetjes Gijsbert