• edited by
22,281 views
36 36 votes

Consider a direct mapped cache of size $32$ $KB$ with block size $32$ $bytes$. The $CPU$ generates $32$ $bit$ addresses. The number of bits needed for cache indexing and the number of tag bits are respectively,

  1. $10, 17$
  2. $10, 22$
  3. $15, 17$
  4. $5, 17$

7 Answers

Best answer
48 48 votes

Number of blocks $= \dfrac{\text{cache size}}{\text{block size}}= \dfrac{32\text{ KB}}{32 \text{ B} }=\text{1024}$

So, indexing requires $\text{10-bits}.$ Number of OFFSET bits required to access $\text{32-bit block} = 5.$
So, number of TAG bits $= 32 - 10 - 5 = 17.$

So, answer is (A).

• edited by
7 7 votes

In Direct mapped cache:

    Address format= Tag + cache index + Offset

     Offset  = log(block size)  = log(32B) = log(2^5) =5 bits

     index = log(cache size / block size) = log(32KB)/log(32B) = 10 bits

     Finally Tag = Total bits - index - offset = 32 - 10 - 5 = 17 bits

NOTE: Base of log is 2 

2 2 votes

.......……….............………..........…….……………..

0 0 votes

Block size is of 32 bytes which means we require 5 bits to store byte offset value. 32-5=27 bits require for cache indexing + number of tag bits.
We can see only option A (10+17) staify the above condition.

0 0 votes
In any type of Cache the physical address or Memory address is divided into 2 parts
1. Block Number

2. Block Offset

Given that Memory address is 32 bits and block size is 32Bytes

So No.of bits for Block Offset = logbase2(32) = 5bits

Now we got Block Offset bits , then subtract the bits from 32 bits

Remaining bits  = 32 - 5 = 27

From the options verify which sum is giving the value 27, that will be the answer

So Option A : 10 + 17 = 27 => Correct

      Option B: 10 + 22 = 32 incorrect

      option C: 15 + 17 = 32 incorrect

      option D : 5 + 17 = 22 incorrect

Therefore Option A is Correct

Correct me if i'm wrong

 
Answer:
Position:
Show:

Related questions

32 32 votes
3 answers 3 answers
15.5k
15.5k views
gatecse asked Sep 21, 2014
15,543 views
Let $f(x)$ be the continuous probability density function of a random variable $x$, the probability that $a < x \leq b$, is :$f(b-a)$$f(b) - f(a)$$\int\limits_a^b f(x) dx...
200 200 votes
9 answers 9 answers
79.4k
79.4k views
Kathleen asked Sep 22, 2014
79,412 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
39 39 votes
2 answers 2 answers
11.3k
11.3k views
Kathleen asked Sep 22, 2014
11,347 views
Match each of the high level language statements given on the left hand side with the most natural addressing mode from those listed on the right hand side.$$\begin{array...
46 46 votes
7 answers 7 answers
20.5k
20.5k views
Kathleen asked Sep 22, 2014
20,474 views
Consider a relation scheme $R = (A, B, C, D, E, H)$ on which the following functional dependencies hold: {$A \rightarrow B$, $BC \rightarrow D$, $E \rightarrow C$, $D \ri...