2. Suppose that a program does read operations on the following memory addresses (e.g., with “lb” or “lw” instructions): 248, 1312. Give the number of the memory block that each of these addresses belongs to, for each of the following memory block sizes.
(a) block size of one word (4 bytes)
(b) block size of eight words (32 bytes)
3. Give the position (or set) in the cache that would be checked on each of the read operations of question 2, for each of the following caches.
(a) direct-mapped cache with total capacity of 32 one-word blocks
(b) direct-mapped cache with total capacity of 4 eight-word blocks
(c) 4-way set-associative cache with total capacity of 32 one-word blocks
(d) 2-way set-associative cache with total capacity of 4 eight-word blocks
ANSWER:
GIVEN THAT:
In the byte addresable memory, 'lb' or 'lw' instructions fetches one byte from memory
a) block size of one word(4 Bytes)
i.e 4 Bytes are present in one memory block, So, for given addresses
i) 248 belongs to 248/4 = 62 block
ii) 1312 belongs to 1312/4=328 block
b) block size of eight word (32 Bytes)
So,
i) 248 belongs to 248/32=ceil(7.75) = 8 block
ii) 1312 belongs to 1312/32=41 block
Note that these blocks are indexed from 0.
2. Suppose that a program does read operations on the following memory addresses (e.g., with “lb”...
(4 marks) Suppose that a program does read operations on the following memory addresses (e.g., with “lb” or “lw” instructions): 248, 1312. Give the number of the memory block that each of these addresses belongs to, for each of the following memory block sizes. (a) block size of one word (4 bytes) (b) block size of eight words (32 bytes)
Using the sequences of 32-bit memory read references, given as word addresses in the following table: 6 214 175 214 6 84 65 174 64 105 85 215 For each of these read accesses, identify the binary address, the tag, the index, and whether it experiences a hit or a miss, for each of the following cache configurations. Assume the cache is initially empty. A direct-mapped cache with 16 one-word blocks. A direct-mapped cache with two-word blocks and a total...
Problem 6. Suppose we have a computer with 32 megabytes of main memory, 256 bytes of cache, and a block size of 16 bytes. For each configuration below, determine the memory address format, indicating the number of bits needed for each appropriate field (i.e. tag, block, set, offset). Show any relevant calculations. Direct cache mapping and memory is byte-addressable a) Direct cache mapping and memory is word-addressable with a word size of 16 bits b) c) 2-way set associative cache...
Cache of 4096 blocks, a 4-word block size, and a 32-bit address, find the total number of sets and the total number of tag bits for caches that are direct mapped, four-way set associative, and fully associative.
Memory Hierarchy and Cache Consider a computer with byte-addressable memory. Addresses are 24-bits. The cache is capable of storing a total of 64KB of data, and frames of 32 bytes, Show the format of a 24-bit memory address for: a- Direct mapped cache b- 2-way associative cache c- 4-way associative cache d- For each type of cache above, indicate where would the reference memory address 0DEFB6 map
7.3 What is the memory layout of the 16-bit value, 0x7654 in a big-endian 16-bit machine, and a little-endian 16-bit machine? b. What would the layouts be in 32-bit machines? 7.19 A certain two-way set-associative cache has an access time of 4 ns, compared to a miss time of 60 ns. Without the cache, main memory access time was 50 ns. Running a set of bench-marks with and without the cache indicated a speedup of 90%. What is the approximate...
question 2 and 3
2. Determine how many sets of cache blocks will be there for the following Cache memory size (in bytes) Direct Mapped Blocks Size (in bits) 32 64 218 2-way Set Associative Block Size (in bits) 32 64 A 2A6 [0.5 * 16 = 8] 4-way Set Associative Block Size (in bits) 32 64 SK 64K 256K 3. The physical memory address generated by a CPU is converted into cache memory addressing scheme using the following mapping...
Assume there are three small caches, each consisting of four one-word blocks. One cache is fully associative, a second is two-way set-associative, and the third is direct mapped. Find the number of misses for each cache organization given the following sequence of block addresses: 2, 4, 2, 7, 0, and 8. Assume a LRU (least recently used) scheme is used to choose which block to replace.
Computer Architecture - Cache Problems
4, Suppose memory addresses are n bits long and the cache can hold M bytes of data. If the cache block-size is 2 bytes and the cache is k-way set associative, what is the total size of the cache with a write-through policy? How would your answer change, if at all when the cache had a write-back policy?
Suppose a computer has 216 words of main memory, and a cache of 64 blocks, where each cache block contains 32 words. Please explain step by step. a) If this cache is a direct-mapped cache, what is the format of a memory address as seen by the cache, i.e., what are the sizes of the tag and word fields? b) To which cache block will the memory reference F8C9 map? c) If this cache is fully associative, what is the...