Full Re-Write/Update for clarity (and your sanity, its abit too long) ... (Old Post)
For an assignment, I need to find the levels (L1,L2,...) and si
I know this! (In reality it is very complicated because of pre-fetching)
for (times = 0; times < Max; time++) /* many times*/
for (i=0; i < ArraySize; i = i + Stride)
dummy = A[i]; /* touch an item in the array */
Changing stride allows you to test the properties of caches. By looking at a graph you will get your answers.
Look at slides 35-42 http://www.it.uu.se/edu/course/homepage/avdark/ht11/slides/11_Memory_and_optimization-1.pdf
Erik Hagersten is a really good teacher (and also really competent, was lead architect at sun at one point) so take a look at the rest of his slides for more great explanations!