Explanation of Solution
Cache Addressing:
The primary storage hierarchy contains cache lines that are grouped into sets. If each set contains k lines then we say that the cache is k-way associative.
A data request has an address specifying the location of the requested data. Each cache-line sized chunk of data from the lower level can only be placed into one set. The set that it can be placed into depends on its address.
The number of cache sets is equal to the number of cache blocks divided by the number of ways of associativity.
The least significant bits are used to determine the block offset.
For example:
One needs to consider the following set associative (S, E, B, m) = (8, 4, 4, 13). The derived value will be as follows:
The Index (CI):
The block off set (CO):
The tag bit (CT):
Hence, the “2” lower bits are block offsets (CO); followed by 3 sets of bit index (CI) and the remaining bits are tag bits (CT).
The following table gives the parameters for a number of different caches and the number of cache sets(S), tag bits(t), set index bits (s) and block offset bits (b) are defined.
Cache | m | C | B | E | S | t | s | b |
1 | 32 | 1024 | 4 | 1 | 256 | 22 | 8 | 2 |
2 | 32 | 1024 | 8 | 4 | 32 | 24 | 5 | 3 |
3 | 32 | 1024 | 32 | 32 | 1 | 27 | 0 | 5 |
The values for the above table are described below:
For cache-1:
It is given that
Hence:
For cache-2:
It is given that
Trending nowThis is a popular solution!
Chapter 6 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
- Computer science Computer organization subjectarrow_forward9. (10pt) For MESI snooping protocol, specify cache states in processors P1, P2, and P3 for each step. Assumes initial cache state is invalid.arrow_forwardProblem 0. The following table gives some of the parameters for a number of different hardware caches. Fill in the table with the values of the missing parameters. Recall that m is the number of physical address bits, C is the cache size in bytes, B is the block size in bytes, E is the associativity, i.e., lines per set, S is the number of sets, t is the number of tag bits, s is the number of set index bits, and b is the number of block offset bits. Cache m 48 32030 (b) 48 32 24 24 C B E 16384 32 16 32768 64 65536 128 512 32 1024 8 8 4 14 1 4 S b S tarrow_forward
- a) A block-set associative cache memory consists of 128 blocks divided into four block sets. The main memory consists of 32,768 blocks and each block contains 512 eight-bit words (1) How many bits are required for addressing the main memory? (ii) How many bits are needed to represent the TAG SET and WORD fields? b) Write a program to code the equation X=(A+B)L| ((C+D) using one-address instructions. Please solve only the b partarrow_forward(b) In a two-level cache system, it is known that a program has 1000 instructions with memory references, of which 40 misses occur in the first level cache and 10 misses in the second level cache. Calculate the local miss rate for each level of the cache, and give the global cache miss rate of the cache system.arrow_forward(c) Assume that a Direct Mapping Function is apply on a memory system with 24-bit address. The cache has 16384 blocks, each storing 4 words. Calculate its tag, block, and word size.arrow_forward
- (d) Given memory holes (i.e., unused memory blocks) of 100K, 500K, 200K, 300K and 600K (in address order) as shown below, how would each of the first-fit, next-fit, best- fit algorithms allocate memory requests of 120K, 320K, 280K, 90K and 210K (in this order). The shaded areas are used/allocated regions that are not available. 100k 500k 200k 300k 600k Figure 2: Current status of main memoryarrow_forwardQuestion 3 (Cache Memory Mapping): I (a) For the main memory address 0:0:0, briefly explain how a search is performed in two-way set associative mapping. Assume that the main memory size is 4 GB, the cache memory is 8 KB and the size of cache block is 32 bytes. (b) A 4-way set associative mapped cache consists of 64 blocks, divided into 4 sets. Main memory consists of 4K blocks, each containing 128 locations. Complete the following format for the main memory address by showing all your workings and find the tag size. [Hint: Calculate the no. of locations in the main memory, which gives the memory size in terms of the total number of bits] , Set No. Block No. Location Within Block No. of bitsarrow_forwardAnswer the given question with a proper explanation and step-by-step solution.arrow_forward
- i need the answer of B only pleasearrow_forwardsubject : computer architectures and organization (computer science)arrow_forward[1] ( Show your work. Show hoe you compute memory address by using the effective memory address computation. Assume the following values are stored at the indicated memory addresses and registers: Address Value 0x100 OxFF 0x104 OxAB 0x108 0x13 0x10c 0x11 Register %rax %rcx %rdx $0x108 (%rax) 4(%rax) 9(%rax, %rdx) 260(%rcx,%rdx) OxFC (,%rcx, 4) (%rax, %rdx, 4) Value 0x100 0x1 0x3 Fill in the following table showing the values for the indicated operands: Operand Value %rax 0x104arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education