Question

In: Electrical Engineering

Below are listed parameters for different direct-mapped cache designs. Cache Data Size: 32 KiB Cache Block...

Below are listed parameters for different direct-mapped cache designs.

Cache Data Size: 32 KiB

Cache Block Size: 2 words

Cache Access Time: 1 cycle

Word: 4 bytes.

Calculate the total number of bits required for the cache listed above, assuming a 32-bit address. Given that total size, find the total size of the closest direct-mapped cache with 16-word blocks of equal size or greater. Explain why the second cache, despite its larger data size, might provide slower performance than the first cache.

Solutions

Expert Solution

A. Calculate the total number of bits required for the cache :

First we require the number of cache bl0cks during the initial cache c0nfiguration.

So we lets compute the number of cache bl0cks in the initial cache c0nfiguration,thereby

we divide 32 KiB by 4 (since given that the number of bytes per w0rd = 4 )

and again by 2 (since we als0 know that the number of words per bl0ck = 2 ).

The answer yields 4o96 bl0cks

and

a resulting index field width of 12 bits.

We also have a w0rd 0ffset size of 1 bit and a byte 0f set size 0f 2 bits.

This yields a tag field size 0f 32 - 15 = 17 bits.

These tag bits, provided that its al0ng with 0ne valid bit per bl0ck, will require 18 x 4o96 = 73728 bits or 9216 bytes.

The total cache size is thus 9216 + 32768 = 41984 bytes.

The Size of the t0tal chache is generalized as,

totalsize = datasize + (validbitsize + tagsize) x bl0cks

We have,

totalsize = 41984

datasize = bl0cks x bl0cksize x wordsize

where,

wordsize = 4

therefore,

tagsize = 32 - log2(bl0cks) - log2(bl0cksize) - log2(w0rdsize)

we have already been pr0vided that,

valid bit size = 1

While Increasing bl0ck size from from 2-word bl0cks to 16-word bl0cks will definitely reduce the size of the tag from 17 bits to 14 bits.

In order to determine the number of bl0cks, we s0lve the inequality:

41984<= 64 blocks + 15 x blocks

solving this inequality equation will give 531 bl0cks, and then rounding it to the next power of 2 will give 1o24-bl0ck cache.

Conclusion:

Therefore we can say that,

larger the bl0ck size here will be an equivalent increase in the hit time and also an increase in the miss penalty when compared to the 0riginal cache.

But also fewer the number of the bl0cks may lead to a higher c0nflict miss rate when compared to the 0riginal cache.


Related Solutions

A direct mapped cache has 32 cache lines.Each cache line consists of 4 words, and each...
A direct mapped cache has 32 cache lines.Each cache line consists of 4 words, and each word is four bytes.The address bus consists of 16 bits. How many bits are required for the tag in this direct-mapped cache?
A direct mapped cache has 16 blocks and block size is 64-bits (8 bytes). a. Where...
A direct mapped cache has 16 blocks and block size is 64-bits (8 bytes). a. Where will the memory block 45 reside in cache? (5 b. Where will be the memory address 1667 mapped in cache
For a direct mapped cache design with 32 bit address, the following bits of the address...
For a direct mapped cache design with 32 bit address, the following bits of the address are used to access the cache Tag Index Offset 31 - 8 7 - 4 3 - 0 What is the cache block size (in words)? How many entries does the cache have? What is the ratio between total bits required for such a cache implementation over the data storage bits? Starting from power on, the following byte-addressed cache references are recorded. Address 0...
Given an 8-word, direct mapped cache, and the sequence of address accesses below, enter the number...
Given an 8-word, direct mapped cache, and the sequence of address accesses below, enter the number of misses. CACHE CONFIG 24 13 24 10 8 8 Given an 8-word, 2-way set associative cache, and the sequence of address accesses below, enter the number of misses. CACHE CONFIG 22 1 9 22 22 22 Given an 8-word, 2-way set associative cache, and the sequence of address accesses below, enter the number of misses. CACHE CONFIG 23 23 8 20 9 20...
Suppose a computer using direct mapped cache has 232 bytes of main memory and a cache...
Suppose a computer using direct mapped cache has 232 bytes of main memory and a cache of 1024 blocks, where each block contains 32 bytes. [2] How many blocks of main memory does this computer have? [4] Show the format of a memory address as seen by cache; be sure to include the field names as well as their sizes. [3] Given the memory address 0x00001328, to which cache block will this address map? (Give you answer in decimal.) A...
Suppose we have a direct-mapped cache that can hold a total of 1024 blocks with 4...
Suppose we have a direct-mapped cache that can hold a total of 1024 blocks with 4 words per block. Compute the block index, block offset, and the tag for the following addresses: (a) 0x11001001 (b) 0x00010014 (c) 0x01000004 (d) 0x01001018 (e) 0x7bdcca10
a) consider a direct mapped cache with 10 blocks of 10 words each. Suppose main memory...
a) consider a direct mapped cache with 10 blocks of 10 words each. Suppose main memory is 1000 words. For ewach memory address below say what cache block it maps to, what is the offset, and what is the tag. 934, 666, 348, 522
Assume a computer with a cache that holds 64 bytes and has a block size of...
Assume a computer with a cache that holds 64 bytes and has a block size of 32 bytes. Direct address mapping is used and from the beginning the cache is empty. The following program sequence is executed: for (col = 0; col < 2; col++) { for (row = 0; row < 4; row++) A[row][col] = B[row] * C[col]; } Assume that for the variables row and col registers are used. The matrix A consists of 4 rows and 4...
Suppose a computer using direct mapped cache has 224 bytes of byte-addressable main memory, and a...
Suppose a computer using direct mapped cache has 224 bytes of byte-addressable main memory, and a cache of 128 blocks, where each cache block contains 8 bytes. For fully associative cache, to which block of cache the address 0x189B5A maps? Group of answer choices Block 6 Block 75 Not enough information Block 10
A direct-mapped cache consists of 8 blocks. Byte-addressable main memory contains 4K blocks of 8 bytes...
A direct-mapped cache consists of 8 blocks. Byte-addressable main memory contains 4K blocks of 8 bytes each. Access time for the cache is 22ns, and the time required to fill a cache slot from main memory is 300ns. (This time allows us to determine the block is missing and bring it into cache.) Assume a request is always started in parallel to both cache and to main memory(so if it is not found in cache, we do not have to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT