Question

QUESTION 2 Suppose a computer using direct mapped cache has 216 bytes of byte-addressable main memory and a cache of 64 block

0 0
Add a comment Improve this question Transcribed image text
Answer #1

It is given that memory size = 216 bytes

So memory address should be of size 16-bit because of byte-addressable main memory, each byte should be uniquely addressed.

a) Number of blocks of main memory

Since each block of main memory is mapped into a block in the cache.

The size of the main memory block is also the same as size of cache block.

Main memory size = 216 bytes

Block size = 32 byte = 25 bytes

Number of blocks of main memory = 216 / 25  = 211 = 2048 blocks.

b) Format of memory address seen by the cache.

The 16-bit memory address is seen by the cache is divided into 3 fields tag, block number, and offset(within a block).

Size there are 64 cache blocks, so the block number field is of size 6 bit. (6 bits are required to identify one block)

Size there one cache block is 32 bytes, so the offset field is of size 5 bit. (5 bits are required to identify one bye within a block)

Therefore the size of the tag field = 16 - 6 - 5 = 5 bits

Memory address =

tag(5 bit) block(6 bit) offset(5 bit)

c) Memory address (F8C9)16

(F8C9)16 = 1 1 1 1 1 0 0 0 1 1 0 0 1 0 0 1

tag(first 6 bits) = 1 1 1 1 1

block number(next 6 bits) = 0 0 0 1 1 0 = 6th block of the cache

offset(last 5 bits) = 0 1 0 0 1 = 9th byte within the block

So (F8C9)16 maps to 6th block of the cache and it refers to 9th byte within that block.

---------------------------------------------------

I hope this helped you,

Please rate this answer if it helped you,

Thank you for the opportunity

Add a comment
Know the answer?
Add Answer to:
QUESTION 2 Suppose a computer using direct mapped cache has 216 bytes of byte-addressable main memory...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT