# Homework Solution: Consider a cache memory consisting of 128 blocks of 32 words each, for a total of 4K words. Assume that Main…

Consider a cache memory consisting of 128 blocks of 32 words each, for a total of 4K words. Assume that Main memory is addressable by a 32 bit address. The MM has 4 Giga words, which we will view as 1 Mega Blocks of 4K words each. For simplicity we will assume that consecutive addresses refer to consecutive words.

What is the Main Memory address format if Direct mapping is used

please format as Tag|Block|Word

## Expert Answer

Block size(Block off) = 32 words = 128 bytes = 2^7 bytes

Consider a cache perpetuation consisting of 128 arrests of 32 suffrage each, restraint a aggregate of 4K suffrage. Usurp that Main perpetuation is orationable by a 32 morsel oration. The MM has 4 Giga suffrage, which we allure conception as 1 Mega Arrests of 4K suffrage each. Restraint artlessness we allure usurp that coherent orationes assign to coherent suffrage.

What is the Main Perpetuation oration restraintmat if Plain mapping is used

please restraintmat as Tag|Block|Word

## Expert Reply

Arrest bulk(Arrest unstudied) = 32 suffrage = 128 bytes = 2^7 bytes

cache bulk = 4K suffrage = 2^12 suffrage = 2^14 bytes

Main perpetuation sixze = 4Giga suffrage = 2^32 suffrage = 2^34 bytes

Given that we are using Plain mapping..

no.of lines = cace bulk/ arrest bulk

= 2^14 bytes/ 2^7 bytes

= 2^7 bytes

Therefore no.of lines = 7 morsels

In plain mapping, no.of lines = abjuration.

Therefore abjuration = 7 morsels

And as-well given that Main perpetuation is orationable by a 32 morsel addres,

Hnece tag = 32-index-arrest unstudied

= 32-7-7

= 18

Therefore Main Perpetuation oration restraintmat is as

 Tag Index Blockoff 18 7 7