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 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
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...
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...
A computer uses direct-mapped cache with four16-bit words, and each word has an associ-ated13-bit tag. Consider...
A computer uses direct-mapped cache with four16-bit words, and each word has an associ-ated13-bit tag. Consider the following loop (three instructions) in a program. Before the loop,the values in registersR0,R1,R2are 0, 054E, and 2 respectively. Consider that instructions arealready in separate cache memory. (See Table1.)The loop starts at location LOOP=02EC.LOOPAdd(R1)+,R0;DCRR2; BR>0LOOPShow the content of cache at the end of each pass of this loop if direct mapping cache is used.Compute hit rate.
It is always a good idea to understand the "size" of units. The objects listed below...
It is always a good idea to understand the "size" of units. The objects listed below are resting on a hard surface. Categorize each object according to the pressure it exerts on the surface when placed on their side with the largest area, which is the bottom. Assume that the bottom of each object is flat and that the pressure refers to that above atmospheric pressure (that is, gauge pressure). Use common sense estimates, make your own measurements and/or do...
Listed below are data that pertain to the corporate bond market.
Listed below are data that pertain to the corporate bond market. (Note: Each "period" below covers a span of 6? months.)(Click on the icon located on the top-right corner of the data table below in order to copy its contents into a spreadsheet.)   Period 1 Period 2 Period 3 Period 4   Average yield on 10 high-grade corporate bonds 5.26 %5.26% 5.65 %5.65% 5.07 %5.07% ??   Yield on the Dow Jones average of 40 corporate bonds 6.51 %6.51%...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT