56.2k views
2 votes
Assume that the 100,000 element integer array that you allocated starts at address 0x50000000 in memory, the size of an integer is 4 bytes and the D-cache is initially empty. As you read the integers in the array one-by-one, starting at index 0, how many D-cache misses will you see for reading the first 40 integers when the cache block size is (to be answered without running pin):a) 4 bytes:b) 32 bytes:c) 64 bytes:

User Kaletha
by
6.8k points

1 Answer

2 votes

Answer:

40, 5 and 3

See explaination for the details

Step-by-step explanation:

A)

Consider the data.

Assume D-cache is empty

An integer size =4bytes

The cache block size =4bytes

Therefore, the number of D-cache misses for reading the first 40 integers is,

= (40×4)/4

= 160/4

= 40

b)

Consider the data.

Assume D-cache is empty

An integer size =4bytes

The cache block size =32bytes

Therefore, the number of D-cache misses for reading the first 40 integers is,

= (40×4)/32

= 160/32

= 5

c)

Consider the data.

Assume D-cache is empty

An integer size =4bytes

The cache block size =64bytes

Therefore, the number of D-cache misses for reading the first 40 integers is,

= (40×4)/64

= 160/64

= 3

User Ilija
by
6.8k points