Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a machine with main memory 2^16 bytes and block size of 8 bytes (also 1

ID: 3797133 • Letter: C

Question

Consider a machine with main memory 2^16 bytes and block size of 8 bytes (also 1 byte = 1 word). Assume that a direct mapped cache consisting of 32 total cache lines is used with this machine.
a) How would the 16 bit address be divided into tag, line number, and word number?

b) Suppose that the word at the 16-bit address 0001 1010 0001 1010 in main memory is to be stored in the cache. Which cache line will this word be stored at? What will be the addresses in main memory of the other other words that will be stored along with this word in cache at the same time (remember each cache line is a block of words)?

c) How many maximum total bytes of data can be stored in the cache at a given time?

d) Do you need to store the tag since direct mapping is used? Why or why not?

Explanation / Answer

1.6 bits-tag

6 bits block number

3 bits word number

2)The address in memory is

0001101000011010

Converting this to 5 bit octal number by groupong into 3 bits we have

0 001 101 000 011 010 which gives

0-validflag bit

001-1

101-5

000-0

011-3

010-2

We get 15032 the first number gives the block number and clearly the block is 1

The word is 5032.

all the words along with 5032 corresponding to tag 1 will be stored.

3.In a 512 word cache there 64 blocks of 8 words each

Size is 512x12 ( each word is 12 bits)

4.Tag is necessary.The tag field of the CPU address is compared with the tag field

of the word read from the cache,matching tags give a hit stating that the desired data

is in cache,if miss the required word is read from memory,which is then stored in cache

with a new tag.

Tag block Word 6 6 3
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote