• retagged by
12,014 views
24 24 votes
Consider a computer system with a byte-addressable primary memory of size $2^{32}$ bytes. Assume the computer system has a direct-mapped cache of size $\text{32 KB}$ ($\text{1 KB}$ = $2^{10}$ bytes), and each cache block is of size $64$ bytes.

The size of the tag field is __________ bits.

5 Answers

Best answer
24 24 votes
$\text{Tag bits} = \text{PAS}_{bits} – \log_2 (\text{Cache Size})  +  \log_2 (K)$  (where $K$ is associativity)

$\qquad = 32 - 15 + 0 = 17\; \text{bits}$
• selected by
10 10 votes

ANS IS 17

GIVEN DATA MAIN MEMORY = 4GB, CACHE MEMORY = 32 KB SO TAG FIELD WILL BE 17 BITS

 

6 6 votes

Given that: for direct mapping technique;

  1. Main memory size= $2^{32}$ byte $\implies PAS=log_22^{32}=32$ bit
  2. Cache memory size(CM’s) = $32KB \implies 2^{15}$ B
  3. Block size/word offset = $64$ byte

we know that $N=\frac{CM’S}{B’S}$

$\therefore$ $N=\frac{2^{15}}{2^6}=2^9B$

so CLO= $\log_2N\implies \log_22^9=9$ bit

Block size= $\log_2B’S\implies \log_22^6=6$ bit

$\therefore$ tag bit= PAS-(CLO+B’S)

$\implies$Tag=32-(9+6) bit

$\implies$Tag= 17 bits.

so tag bit size in given problem is $17$ bits.

Note: same concept asked in GATE CSE 2017 Set 2 | Question: 53

• edited by
1 1 vote
Given, Direct mapped cache

Main memory size =2^32 byte

cache block size =64 byte

                              =2^6 byte

Cache size          =32KB

                              =2^5 *2^10 Byte

                              =2^15 Byte

Number of lines in cache = Cache size / Block size

                                            = 2^15 / 2^6

                                            = 2^9

Main memory in bits = Tag space + line offset + Block offset in bits

                     32  bits = tag space + 9 bits +6 bits  

                    tag size = 32-9-6

                    tag size = 17
0 0 votes
To directly find the number of tag bits in  Direct Mapped cache

#tagbits  =   $\frac{Memorysize}{Cache size} $  =   $\frac{2^{32}}{2^{15}} $ = $2^{17} $= $17$ bits for  tag field

this is true bcz as we can  bits in Block size + bits in  no of lines = bits in Cache size  

and Main memory = bits in tag field + bits in cache size

So it means Tag field tells that How many times Main memory is bigger as Compared to Cache size

If tag bits are lets say $6$ then main memory is $2^6$ times bigger than cache
• edited by
Answer:
Position:
Show:

Related questions

28 28 votes
2 answers 2 answers
14.6k
14.6k views
Arjun asked Feb 18, 2021
14,579 views
A five-stage pipeline has stage delays of $150, 120, 150, 160$ and $140$ nanoseconds. The registers that are used between the pipeline stages have a delay of $5$ nanoseco...
32 32 votes
5 answers 5 answers
19.1k
19.1k views
Arjun asked Feb 18, 2021
19,113 views
Consider the following instruction sequence where registers $\text{R1}, \text{R2}$ and $\text{R3}$ are general purpose and $\text{MEMORY[X]}$ denotes the content at the m...
76 76 votes
9 answers 9 answers
41.2k
41.2k views
Kathleen asked Sep 13, 2014
41,166 views
The access times of the main memory and the Cache memory, in a computer system, are $500$ n sec and $50$ nsec, respectively. It is estimated that $80\%$ of the main memor...
31 31 votes
8 answers 8 answers
15.1k
15.1k views
Arjun asked Feb 18, 2021
15,065 views
In an undirected connected planar graph $G$, there are eight vertices and five faces. The number of edges in $G$ is _________.