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:

Cognitive Dissonance

A psychological phenomenon where an individual experiences discomfort from holding two or more conflicting beliefs, ideas, or values.

Fundamental Attribution Error

The tendency to overemphasize personal characteristics and ignore situational factors when judging others' behavior.

Insufficient Justification Effect

A phenomenon in psychology where individuals change their attitudes or beliefs due to the realization that their actions cannot be justified by the external rewards or punishments alone.

Cognitive Dissonance Theory

A theory which suggests that we experience discomfort or dissonance when our beliefs, values, or behaviors are in conflict, leading us to change one to reduce the dissonance.

Related Questions