Question

In: Computer Science

What are the block tags and block indexes for the below 12-bit memory locations with 256-byte...

What are the block tags and block indexes for the below 12-bit memory locations with 256-byte cache?
a. 0001 0110 1010, for 16-byte blocks with direct-mapped cache
b. 0010 0011 1011, for 4-byte blocks with 4-way associative cache

Solutions

Expert Solution

(a) 0001 0110 1010

memory width is 12-bits, cache size = 256 byte, block size = 16 byte and direct-mapped cache.

Block size = 16 bytes, to represent these 16 bytes we need 4 bits (24 = 16 ). Therefore word index = 4 bits.

Total number of blocks in cache = cache size / block size = 256 bytes / 16 bytes = 16 blocks. To represent these 16 blocks we need 4 bits (24 = 8).

Therefore block index = 4 bits.

Tag = total memory width - (block index + word index) = 12 - (4+4) = 12 - 8 = 4 bits.

Tag block index word index
4 bits 4 bits 4 bits

Therefore tag index from question (a) is 0001 (From MSB side)

Block index is 0110.

(b) 0010 0011 1011

Given that memory is 12- bit long, cache size = 256 bytes, block size = 4 bytes and 4 way set associative cache.

Block size = 4 bytes, to represent these 4 bytes we need 2 bits (22 = 4). Therefore word offset = 2 bits.

Total number of blocks = cache size / block size = 256 bytes / 4 bytes = 64 blocks, and the cache is 4 way set associative which means each set consist of 4 blocks.

Therefore total number of sets = total number of blocks / set size = 64 blocks / 4 blocks = 16 sets. To represent these 16 sets we need 4 bits ( 24 = 16 ).

Tag = total memory width - (set offset + word offset) = 12 - (4+2) = 12 - 6 = 6 bits.

Tag Set(block) index Word index
6 4 2

Therefore tag part = 0010 00 (start from MSB part)

set(block) index = 1110


Related Solutions

Assume a 222 byte memory: a. What are the lowest and highest addresses if memory is...
Assume a 222 byte memory: a. What are the lowest and highest addresses if memory is byte-addressable? b. What are the lowest and highest addresses if memory is word-addressable, assuming a 16-bit word? c. What are the lowest and highest addresses if memory is word-addressable, assuming a 32-bit word? Explain with Steps please
Number Systems What is a bit? What is a byte? What is the relationship between these...
Number Systems What is a bit? What is a byte? What is the relationship between these two terms? How would you abbreviate the phrase "Megabits per second?" How about Megabytes per second?" Most humans are very familiar with the decimal number system. Computers do all operations in binary. What is the decimal equivalent of binary 11001101? What process can you use to perform this conversion without using a calculator? Demonstrate to the class. What is the binary equivalent of decimal...
For Networks -> Please tell me about the following: Contrast byte stuffing with bit stuffing. What...
For Networks -> Please tell me about the following: Contrast byte stuffing with bit stuffing. What are the two types of error control? And which is used more? How do you correct transmission errors after detecting an error? Parity, checksum and CRCs are a type of? Why are hamming codes used?
If SI = 1000H, what does MOV [SI], BH do? Reads byte of data from memory...
If SI = 1000H, what does MOV [SI], BH do? Reads byte of data from memory location 1000H into BH Writes byte of data from BH into memory location 1000H Illegal, only DI can be used between [ ] s Illegal, mixed sizes Translate the statement “All your friends are perfect” into a logical expression. Let P(x) be “x is perfect” and F(x) be “x is your friend” and the universe of discourse be all the people. ∀xF(x) → ∃xP(x)...
Given byte-addressed memory with location 0x100 containing 0x62 and location 0x101 containing 0x7C. What is the...
Given byte-addressed memory with location 0x100 containing 0x62 and location 0x101 containing 0x7C. What is the decimal value of the signed short stored at location 0x100: Assuming big-endian addressing. Assuming little-endian addressing. You may assume that a short occupies 2 bytes.
If we had 20,000(subscript 10) memory locations, what would be the least number of address lines...
If we had 20,000(subscript 10) memory locations, what would be the least number of address lines needed to describe each location? (Hint: Change 20,000 to binary or hex and determine the number of bits needed.)
What is the market quantity demanded of DVDs at $12 in figure below? And Total Revenues....
What is the market quantity demanded of DVDs at $12 in figure below? And Total Revenues. Can you tell if this is equilibrium? Quantity Demanded Price per DVD Buyer 1 Buyer 2 Buyer 3 Buyer 4 20 0 0 1 0 18 0 1 3 0 16 1 2 5 1 14 2 4 7 3 12 3 6 9 6 10 4 8 11 10 8 5 11 13 15
What is your understanding of the analysis below. Use practical for each analysis. ]12 marks] a)     ...
What is your understanding of the analysis below. Use practical for each analysis. ]12 marks] a)      Descriptive analysis b)     Diagnostics’ analysis c)      Predictive analysis d)     Prescriptive analysis
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT