Examlex

Solved

Caches: Misses and Hits

question 11

Essay

Caches: Misses and Hits
int i;
int a[1024*1024]; int x=0;
for(i=0;i<1024;i++)
{
x+=a[i]+a[1024*i];
}
Consider the code snippet in code above. Suppose that it is executed on a system with a 2-way set associative 16KB data cache with 32-byte blocks, 32-bit words, and an LRU replacement policy. Assume that int is word-sized. Also assume that the address of a is 0x0, that i and x are in registers, and that the cache is initially empty. How many data cache misses are there? How many hits are there?


Definitions:

Sense of Pain

The perception of discomfort or distress caused by injury, illness, or other stimuli.

Doctrine of Specific Nerve Energies

A theory suggesting that the nature of a sensation depends on which sensory fibers are stimulated, not on how the fibers are stimulated.

Visual Part

The component of cognition concerned with processing visual information.

Signal Detection Tasks

Psychological tasks used to measure the ability to differentiate between information-bearing patterns (signals) and random patterns that distract from the information (noise).

Related Questions