(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)
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.
(4 marks) Suppose that a program does read operations on the following memory addresses (e.g., with...
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...
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...
Suppose a computer using fully-associative cache has 222 words of main memory and a cache of 32 blocks, where each cache block contains 16 bytes. How many blocks of main memory are there? Assuming memory addressing starts from zero, what is the highest memory address? How many bits are needed to represent all of the memory addresses? What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag and...
Write a program that compares two blocks of memory, each of size 200 bytes. One block resides in DS at 13501 and another in ES t 750 If any of the wo in DS matches with a corresponding word in ES then that word is stored in memory at DS:T050], and corresponding addresses of DS and ES are stored at DS:[052] and at Ds:(054) respectively. a. C35. JE L) JA L 2
For these problems, words are assumed to be 4 bytes, and the references are word-addresses. Thus, the words in memory are located in word-addresses 0, 1, 2, ... As a comparison, note that byte-addresses for words are multiples of 4. Thus, the byte-addresses for words are 0, 4, 8, 12,.... Note that the caches have a cache-line of two-words. We can write a 2-word block as follows (0,1), (2,3), etc are blocks 0, 1, ... Problem B (1 pts). Assume...
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?
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...
2. A computer uses a memory with addresses of 8 bits. (What's the size of the MM?) This computer has a 16-byte cache with 4 bytes per block. (How many blocks in the cache?) The computer accesses a number of memory locations throughout the course of running a program. Suppose this computer uses direct-mapped cache. a. What's the format of a memory address as seen by the cache ? Tag ? bits Block ? bits Offset ? bits b. The...
Question 10 (10 points) Consider a cache of 8 lines of 16 bytes each. Main memory is divided into blocks of 16 bytes each. That is, block 0 has bytes with addresses 0 through 15, and so on. Now consider a program that accesses memory in the following sequence of addresses: Loop three times: 10 through 20; 32 through 52. Once: 20 through 35. Suppose the cache is organized as direct mapped. Memory blocks 0, 8, 16 and so on...
Assume you have: 32-bit addresses, 4KB Page size, 4MB Physical Memory Space, 4KB Cache with 4-way set associative and LRU replacement, 32 Byte Cache block size, 4-entry fully associative TLB. A program to be run on this machine begins as follows: double A[1024]; int i, j; double sum = 0; for( i = 0; i < 1024; i++ ) // first loop A[i] = i; for( j = 0; j < 1024; j += 16 ) // second loop ...