7,344 views

Consider a direct mapped cache with $64$ blocks and a block size of $16$ bytes. To what block number does the byte address $1206$ map to

1. does not map
2. $6$
3. $11$
4. $54$

continue the question
this question has been asked before and answered as well.( Ans - 11 )
Which year?

Block size =$16B$

Total No of Block=$64$

Memory block Number=$\frac{\text{Byte}\ \text{address}}{\text{Block}\ \text{Size}}$

=$\frac{1206}{16}$

=75

Now we have to find a cache block number related to memory block number.

So In Direct Mapped cache,

$\text{Cache block Number}=\text{Memory block Number$\color{magenta}{\text{mod}\;}$(Total Number of a block in cache)}$

=$75\;\text{mod}\;64$

=$11$

So option C is correct.
by

Cache block Number=Memory block Number mod(Total Numbe

Total number of blocks is 64.

So, Cache block no. = Memory block no. % 64

= 75 % 64

= 11

Doubt – 1206 is the byte address in the main memory?

block size 16 byte==>

block 0==0 to 15 byte

block 1=16 to 31 byte..

so  floor (byte address / block size) = memory block #

floor(1206/16)=75

Then you need to find which cache block memory block 75 maps to. In a direct-mapped cache, cache block # = memory block # mod (total block number of cache) Therefore, 75 mod 64 = 11.

hence C is the ans

by
•As block size = 16 bytes:

•As cache size = 64 blocks:

block address 75 Þ cache block (75 mod 64) = 11

by
Given data,
Direct memory cache have = 64 block
Block size = 16 Bytes
Block number does the byte address of 1206 map=?
Step-1: To find block number = Byte Address / Block size
= 1206/16
= 75.3
Step-2: Byte address 1206 map to 75th block.
Step-3: We have to find the cache block number.
Cache block number = (Block number) mod (Block size in cache)
= 75 mod 64
= 11
by

Cache block number = (Block number) mod (Block size in cache)

Solving in this way we get wrong answer

Find block number for byte address 1600

1600/ 16= memory block number=100

Cache block number in memory= 100mod64

=36

But according to you 4 which is wrong

bro it's done thanks for correcting me

Replace block size with total number of blocks in cache memory

1
3,952 views