Question

In: Computer Science

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?

Solutions

Expert Solution

Solution:

Given,

=>Direct mapped cache

=>Number of lines in the cache = 32

=>Number of words in cache = 4 words

=>Word size = 4 bytes

=>Address = 16 bits

The answer will be "7"

Explanation:

Direct mapped cache:

Tag Cache index Block offset

    7 bits                          5 bits                                    4 bits

Calculating size of line:

=>Size of line = 4 words

=>Size of line = 4*4 bytes as 1 word = 4 bytes

=>Size of line = 16 bytes

Calculating number of bits for block offset:

=>Number of bits for block offset = log2(size of line in bytes)

=>Number of bits for block offset = log2(16)

=>Number of bits for block offset = 4 bits

Caculating number of bits for cache index:

=>Number of bits for cache index = log2(number of lines)

=>Number of bits for cache index = log2(32)

=>Number of bits for cache index = 5 bits

Calculating number of bits for tag:

=>Number of bits for tag = total address bits - offset bits - cache index bits

=>Number of bits for tag = 16 bits - 4 bits - 5 bits

=>Number of bits for tag = 7 bits

I have explained each and every part with the help of statements attached to the answer above.


Related Solutions

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...
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...
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.
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 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 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
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...
Computer archieture 1. Assume that the cache size is 512kB, and each cache line is 128...
Computer archieture 1. Assume that the cache size is 512kB, and each cache line is 128 Bytes. If it’s a 4-way associative cache, how many sets are there? If it’s a 2-way associative cache, how many sets are there? Let’s assume the cache is initially empty, and LRU policy is used for cache line replacement. If the following memory blocks are accessed: Mem-block # 7, 1031, 2055, 4103, 1031, 7, 2055, 3079, 1031, 3079 What is the cache hit/miss rate...
Consider a 4-way set-associative cache, 4 rows, a line size of 128 bytes and a write-back...
Consider a 4-way set-associative cache, 4 rows, a line size of 128 bytes and a write-back policy. The following requests are made to memory: Load: 0b0011111001000101 Load: 0b1000111110110100 Load: 0b0110101111110100 Store: 0b0010110000000110 Store: 0b1111001001110101 Store: 0b1110000111000001 Load: 0b0000000010100110 Load: 0b0101001001001101 Assuming the machine is in cold-start, profile the contents to the cache after all of the requests have been made. State any assumption you make (if needed).
11. (12 pts) Consider a system with 32-bit addresses and a 16KB 8-way set-associative cache. Each...
11. (12 pts) Consider a system with 32-bit addresses and a 16KB 8-way set-associative cache. Each cache line contains 64 bytes. (a) How many bits of an address are used for the offset in this cache? (b) How many bits of an address are used for the index in this cache? (c) How many bits of an address are used in the tag for this cache? (d) What is the value of the tag for 0x000d6ae2? (e) What is the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT