in CO and Architecture retagged by
1,255 views
0 votes
0 votes

Hardware cache memories exploit spatial locality of reference

  1. by remembering which pieces of data have been accessed recently
  2. when data items are re-accessed frequently
  3. by remembering which cache blocks (lines) have been written to
  4. only if cache block (line) size is greater than 1 byte
in CO and Architecture retagged by
1.3k views

1 comment

I think a) and d) both support

but we have to choose 1 option then i think a)
0
0

3 Answers

5 votes
5 votes
Best answer
Answer is D.

Spatial locality refers to a data near by a recently accessed one being accesses in near future. So, to make use of it, when a data is accessed, a block of data which incudes the accessed part is taken (called cache line) and placed in cache. So, if this cache line size is 1 byte, that virtually rules out any chance of exploiting spatial locality in cache.

A is not correct. There is no "remembering" mechanism in cache though this might be used for cache line replacement like in LRU.

B is for temporal locality.

C is used for write-back cache.
selected by
by
2 votes
2 votes

Spatial Locality says that whenever we are looking for any element the chance's  are that , that particular element will be present in the close proximity around the one which we has previously referred .  

3 Comments

@shekhar sir,

Why not D?
0
0
Reason : As you said choose one option .I thought option A is more appropriate to choose here. I can choose (D) that option too but i am not quite sure about that and can't explain much about that...So if i don't know about it then why would i choose it....This option is my opinion .because i read about it
2
2
@kapil. In option D, we can exploit spatial locality even if the block size is 1 byte. where is the issue?
0
0
0 votes
0 votes

Ans A) by remembering which pieces of data have been accessed recently

If a memory is referenced , Spatial locality access the nearby memory location in near future

B) LOR is about the accessing the memory location , not about same data

C)According to this option, Same memory location is accessed in near future. So, it is temporal locality of reference

D)No such constraint given for LOR

4 Comments

Is there any restriction on spatial locality?
0
0

@Srestha of course it assumes that minimum amount of data that can be accessed is 1 byte- we have byte addressing and word addressing but no nibble or bit addressing. So, if data being put to cache is not larger than a byte, spatial locality is not being used. See a relevant GATE question. 

https://gateoverflow.in/700/gate2001-1-7

1
1
i think (a) is right option for temporal locality. In case of spatial complete block of words are loaded in memory by asssuming that next time word from the same block will be accessed.
0
0
Answer:

Related questions