Exercise 7: (12 pts) 1. Consider a 64-byte cache with 8 byte blocks, an associat
ID: 3705384 • Letter: E
Question
Exercise 7: (12 pts) 1. Consider a 64-byte cache with 8 byte blocks, an associativity of 2 and LRU block replacement. Virtual addresses are 16 bits. The processor has 16KB of physical memory. (a) What is the total number of tag bits in the cache? 2. Design a 128KB direct-mapped data cache that uses a 32-bit address and 16 bytes per block. Calculate the following (a) How many bits are used for the byte offset? Index field? And the tag? 3. Given a 52-bit virtual address, 16k cache, 64 byte blocksize. byte addressable machine. Assume direct mapped cache. How many bits for byte, tag, and index? How much memory (in bytes) is needed for tags in the cache? 4. Two programs are concurrently executing in a multitasking computer with virtual memory pages having 8 KB. Each page table entry is 32 bits. What is the minimum numbers of bytes of main memory occupied by the directory pages and page tables for the four programs if the numbers of pages per program, in decimal, are as follows: 5670 and 8069?Explanation / Answer
Answers:
1.a). The cache is 64-bytes with 8-byte blocks, so there are 8 blocks. The associativity is 2, so there are 4 sets. Since there are 16KB of physical memory, a physical address is 14 bits long. Of these, 3-bits are taken for the offset (8 byte blocks), and 2 for the index( 4 sets). That leaves 9 tag bits per block. Since there are 8 blocks, that makes 72 tag bits or 9 tag bytes.
2.a). 7 bits are used for byte offset, 15 bits used to set index field, 10 bits are used for the tag.
3. 10 bits are used for byte offset, 4 bits used to set index field, 50 bits are used for the tag. the memory needed for tag in the cache is 24 bytes.
4. Since, we have the virtual address of space of 232 and each page size is 212 , we can store 220 pages. since each entry into this page table has an address of size 4 bytes, then we have 220*4 = 4MB. so the page table makes upto 4MB in memory.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.