Memory Management: Hardware Implementation
Memory Management: Hardware Implementation
Memory Management: Hardware Implementation
Hardware Implementation
Direct Mapping: 0001 0 1 =5
Main Memory
0 0 1 2 3 Block offset
Block #
Cache Memory 1 4 5 6 7
TAG Line No BO
2 .
0
3 . 0011 00
1
4 .
2
5 .
3
6 .
From the block number,
7 . 0111 1 1 the LSB (here last 2 bit)
8 . Indicates cache
9 . line number
Answer: (C)
Que-2: Consider the data given in previous question. The size of the cache tag directory is
(B) 160 Kbits (B) 136 bits (C) 40 Kbits (D) 32 bits
Answer: (A)
Que-3: An 8KB direct-mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The
processor generates 32-bit addresses. The cache controller maintains the tag information for each cache
block comprising of the following.
1 Valid bit 1 Modified bit As many bits as the minimum needed to identify the memory block mapped in the
cache. What is the total size of memory needed at the cache controller to store meta-data (tags) for the
cache?
(C) 4864 bits (B) 6144 bits (C) 6656 bits (D) 5376 bits
A cache memory unit with capacity of N words and block size of B words is to be designed. If it is designed as
direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-
associative cache, the length of the TAG field is ______ bits.
(A) 12
(B) 14
(C) 16
(D) 18
Answer: (B)
Explanation: Type of mapping is direct map; for this direct map, 10 bits are required in its Tag. It is updated to 16
way set Associative map then new tag field size = 10 + log216 = 14 bits, because for k way set associative map
design, log2k bits are additionally required to the number of bits in tag field for Direct map design.
The size of the physical address space of a processor is 2P bytes. The word length is 2W bytes. The
capacity of cache memory is 2N bytes. The size of each cache block is 2M words. For a K-way set-
associative cache memory, the length (in number of bits) of the tag field is
Ans (B)
Q. Consider a 2-way set associative cache with 256 blocks and uses LRU replacement, Initially the cache is
empty. Conflict misses are those misses which occur due to contention of multiple blocks for the same
cache set. Compulsory misses occur due to first time access to the block. The following sequence of accesse
to memory blocks
(0, 128, 256, 128, 0, 128, 256, 128, 1, 129, 257, 129, 1, 129, 257, 129)
is repeated 10 times. The number of conflict misses experienced by the cache is ____________ .
Q. A cache memory unit with capacity of N words and block size of B words is to be designed. If it is designed as a direct
mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache,
the length of the TAG field is ______ bits.
Q. If a 16-way Set Associative cache is made up of 64 bit words , 16 words per line and 8192 sets, How big is the
cache in Megabytes ?
Ans: 16MB
Q. In a two-level cache system, the access times of L1 and L2 caches are 1 and 8 clock cycles, respectively.
The miss penalty from the L2 cache to main memory is 18 clock cycles. The miss rate of L1 cache is twise
that of L2. The average memory access time (AMAT) of this cache system is 2 cycles. The miss rate
of L1 and L2 respectively are:
Q. Did you get any difference in the Programme ? Assuming, the cache has a block size of 4 words each, word size being 4 bytes
Program 1 Program 2