Awesome q2a theme
0 votes
37 views
The virtual address generated by a CPU is 32 bits. The Translation Look-aside Buffer (TLB) can hold total 64 page table entries and a 4-way set associative (i.e. with 4- cache lines in the set). The page size is 4 KB. The minimum size of TLB tag is

(A) 12 bits

(B) 15 bits

(C) 16 bits

(D) 20 bits
in Operating System by (699 points) | 37 views
0

@shashin

as you have mentioned earlier that the number of bits required to represent TLB depends on the number of entries.

So here shouldn't the TLB tag be of size $6bits$ as we have $64$ $entries?$

0
You're forgetting the fact that TLB is pretty much a cache, and set associativity applies here too.

Number of sets $= \frac{number of lines}{associativity} = \frac{64}{4} = 16 \implies 4$ bits to represent a set.
Now think of the TLB tag if there was no set associativity concept.

TLB tag bits = page indexing bits

i.e. no of TLB tag bits $= VAS - page\:offset =  32-12 = 20$ bits

Now 20 bits to address a TLB entry. Of these, 4 bits are taken to identify a set. What remains is the tag bits.

i.e. $20 - 4 = 16$ bits for the tag.

There is absolutely no need to get confused. Whatever rules and logic apply for a cache, apply for the TLB too. Including the concept of associativity and tags.
0

number of bits required to represent TLB depends on the number of entries

This is true in case of a direct-mapped TLB, exactly the same as a direct-mapped cache. If associativity is mentioned, you need to consider that, exactly like you would for a set-associative cache.

0

@shashin

Can you help me understand segmented paging and how to solve sums on it?

Do you have any resources for that?

1 Answer

+1 vote
Best answer

The answer is option C.

since TLB is also like a cache memory, so the same concept can be applied here.


Virtual address is 32 bits and page size is 4KB i.e 12 bits.

so, 32 - 12 = 20 bits remaining for tag and number of sets.

Question says TLB has 64 entries , Number of sets  = Number of entries/associativity

                                                                                   = 64/4 = 16.

so 4 bits for cache sets.

Therefore number of bits in tag field = 32-(12+4) = 16bits.

by (60 points)
selected by
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users 2020 Aug 10 - 16
  1. Arkaprava

    404 Points

  2. jayeshasawa001

    198 Points

  3. SarathBaswa

    126 Points

  4. Ashutosh777

    67 Points

  5. toxicdesire

    20 Points

  6. Nilabja Sarkar

    12 Points

  7. premu

    10 Points

  8. iarnav

    7 Points

  9. Jhumpa_Sarma

    6 Points

  10. Patel0967

    6 Points

Weekly Top User (excluding moderators) will get free access to GATE Overflow Test Series for GATE 2021
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Aug 2020
  1. Arkaprava

    404 Points

  2. jayeshasawa001

    203 Points

  3. Mellophi

    156 Points

  4. Ashutosh777

    143 Points

  5. SarathBaswa

    126 Points

  6. anurag sharma

    49 Points

  7. toxicdesire

    20 Points

  8. shashankrustagi2021

    16 Points

  9. premu

    16 Points

  10. Kushagra गुप्ता

    15 Points

7,769 questions
1,977 answers
11,275 comments
95,111 users