Question

In: Computer Science

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 add this cache search time to the memory access). If a block is missing from cache, the entire block is brought into the cache and the access is restarted. Initially, the cache is empty.
-Compute the hit rate for a program that loops 4 times from locations 0x0 to 0x43 (address 0 hex to address 43 hex).
-Compute the effective access time for this program.

Solutions

Expert Solution

Compute the hit rate for a program that loops 4 times from locations 0x0 to 0x43 (address 0 hex to address 43 hex) .Answer:-----------
( 0x0 to 0x43 )16 = ( 0 to 67 )10
Block 0 of main memory (addresses 0 - 7) and Block 8 of main memory (addresses 64 - 67) must share a cache block. The remaining blocks are brought in and are not replaced. So for each access to Block 0, there is one miss and 7 hits. For each access to Block 8, there is one miss and 3 hits. The remaining blocks have one miss each, with all other accesses being hits.
If we loop 4 times, we have:
Block 0:
4 misses, 28 hits
Block 1: 1 miss, 31 hits
Block 2: 1 miss, 31 hits
Block 3: 1 miss, 31 hits
Block 4: 1 miss, 31 hits
Block 5: 1 miss, 31 hits
Block 6: 1 miss, 31 hits
Block 7: 1 miss, 31 hits
Block 8: 4 misses, 12 hits

A total of 15 misses, 257 hits,
or a hit ratio of 257 / (15 + 257 ) = 94.49%.

Compute the effective access time for this program?
Answer:------
The effective access time is ==
==>.9449 (22ns) + .0551(300ns + 22ns)
==> 20.7878 + .0551 x 322
==> 20.7878 + 17.7422
==> 38.53 ns


Related Solutions

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...
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
Assume a byte-addressable memory has 64K bytes. Blocks are 8 bytes in length and the cache...
Assume a byte-addressable memory has 64K bytes. Blocks are 8 bytes in length and the cache consists of 4K bytes. Show the format for a main memory address assuming a 4-way set associative cache mapping scheme. Include the field names as well as their sizes.
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...
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
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
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?
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
Draw the memory address blocks (Tag, Index and Offset) for a direct mapped and N-way set...
Draw the memory address blocks (Tag, Index and Offset) for a direct mapped and N-way set associative cache organization for the below cache configurations. Round the cache size to nearest power of 2 (e.g., 1KB = 2^10) and assume 32-bit memory address. a. 64KB cache, 32-byte block, N = 4 b. 1MB cache, 64-byte block, N=16 c. 32KB cache, 512-byte block, N=64
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT