Skip to main content

associative mapping to behave as direct mapping


QUESTION: consider  a cache memory system with 4095 primary memory blocks and 128 cache memory blocks and block set associative mapping implemented the architecture 16 words are available per block, what should be the size of the set so that block set associative mapping technique behave like

1. associative mapping

2 .direct mapping

ANS: In associative mapping technique primary memory block associated with any block of cache memory means 0 of primary memory block associated with 7th block of cache memory. so for block set associated mapping technique to behave like associative mapping technique only 1 block set is required because any no of primary memory block can associated with any number of cache memory block so no extra set is needed in cache memory only 1 set is sufficient for block set mapping technique to behave like associative mapping.

2. In direct mapping  technique all blocks of cache memory are mapped by k-mod 128 technique. In k-mod 128 technique all blocks of primary memory is associated with particular blocks of cache memory. means 0 block of primary memory block can associated  with  0 block of cache memory block, it cannot mapped with first memory of cache memory . so for block set associative mapping technique to behave as direct mapping 128 block set is required.


Comments

Post a Comment

Popular posts from this blog

snake, water,gun game python

  import random def check ( comp , user ):     if comp == user :         return 0     if ( comp == 0 and user == 1 ):         return - 1     if ( comp == 1 and user == 2 ):         return - 1     if ( comp == 2 and user == 0 ):         return - 1     return 1 comp =( random . randint ( 0 , 2 )) user = int ( input ( "0 for snake, 1 for water and 2 for gun" )) score = check ( comp , user ) print ( "your choice:" , user ) print ( "computer choice:" , comp ) if ( score == 0 ):       print ( "its a draw" ) elif ( score ==- 1 ):     print ( "you Lose" ) else :     print ( "you won" )