Given the code :
void transpose2(array dst,array src)
{
int i,j;
for ( i=0; i<4; i++) {
for ( j=0; j<4; j++) {
dst[i][j] = src[j][i];
}
}
}
Assumptions :
int is 4 bytes
src
array starts at address0
,dst
starts at address64
the size of the cache is
32
bytes , at the beginning the cache is empty
Assuming that I have a cache with size of 32
bytes , under write through ,write allocate & LRU , using 2way set associative method , where each block is 8
bytes :
When I read from the memory , how many bytes do I take each iteration from the memory ?
is it 4
or 8
?
What I'm quite sure about is that the cache has 4 cells , or rows , and each row has 8 bytes .Is this correct ?
What is a little confusing is the 2way part , I think that each way has 4
bytes , right ? please correct me if I'm wrong ...
Then when I "take" a block from the memory , I just don't exactly understand how many bytes !!?
Thanks in advance
Ron