In a hypothetical system with 1024 bytes of main memory, 128 bytes of cache, blocks of 32-byte size, with direct-map (S = 1) placement policy and LRU replacement policy, answer each of the following questions:
main memory=1024 Bytes.
There fore, we need 10 bits to address a word in main memory.
cache=128 Bytes.
Block size=32 Bytes.
Therefore,Block offset =5 bits.
Number of blocks in cache=128/32=4
Hence index=2 bits.
Number of tag bits=10-2-5=3 bits
b-
Number of sets=Number of blocks / associtivity=4/1=4
c-
Number of tag bits=3.
This implies main memory blocks are mapped to one cache block.
d-
We have to compare tag bits of every block with tag bits of address.
If we use 2 input xor gates,we need 1 xor gate for each tag bit.
Hence number of exor gate=Total number of tag bits=number of tag bits per block* number of blocks=3*4=12
but if we have multi input xor gate, we need only 4 xor gates.
Get Answers For Free
Most questions answered within 1 hours.