73 73 votes A computer system implements a $40\;\text{-bit}$ virtual address, page size of $8\;\text{kilobytes}$, and a $128\text{-entry}$ translation look-aside buffer $\text{(TLB)}$ organized into $32$ sets each having $4$ ways. Assume that the $\text{TLB}$ tag does not store any process id. The minimum length of the $\text{TLB}$ tag in bits is ______. Operating System gatecse-2015-set2 operating-system virtual-memory easy numerical-answers + – go_editor 34.2k views answer comment Share Follow Print See all 7 Comments 7 7 Comments reply Show 4 previous comments Ujjwal_Singh commented Oct 25, 2025 reply Follow flag Number of virtual pages: Page number bits = 27 → total pages = 2²⁷Finding the set index bits:There are 32 sets → needs 5 bits (since 2⁵ = 32).Each page maps to a unique set, based on these 5 bits.How to calculate the tag bits:So, the tag bits come from the remaining page number bits after removing the set index bits.Hence: Tag bits=Page number bits−Set index bits=27−5=22In set-associative mapping, each page of virtual memory maps to one specific set.Inside that set, there are multiple blocks (or lines) where it could be placed.To identify which page currently occupies a line inside the set, we use the tag. 0 0 replyShare Madhav107 commented Feb 3 reply Follow flag TLB stores some of the enteries of page table which is it acts like cache for the page table.what does page table store? for every virtual page number it stores corresponding frame number .how many total pages do we have here? 2^40 / 2^13 = 2^27 which means 2^27 enteries are there in page table now they need to be cached in TLB.Here TLB se set associative with a total of 32 sets .But what does tag bits tell ? if 2 different entries map to the same set then there set index are same but they are diffrenetiated with the help of tag bits. So if I have x number of tag bits then it means 2^x different entries map to the same set of TLB . Since there are 32 sets for 2^27 enteries therefore 2^27/2^5 = 2^22 which means 2^22 enteries map to the same set of TLB so we need 22 bits to differentiate those page table enteries hence ANS= 22 bits 2 2 replyShare Gopika_G commented Feb 14 reply Follow flag Virtual address is divided into VPN and offset. TLB is 128 entries, organized into 32 sets each having 4 ways (32*4=128). So it's a set-associative TLB. The TLB tag is used to identify which virtual page maps to a TLB entry. Virtual address = 40 bits page size 8KB => offset 13 bits VPN = 27 bits. The TLB is indexed by some bits from the VPN. Since it has 32 sets, TLB has 32 sets, so index = 5 bits. So the VPN is divided into: tag (remaining bits) and set index (5 bits). tag = 27-5 = 22 bits. VPN (27 bits) = [ Tag: 22 bits | Set Index: 5 bits ] So answer 22. 0 0 replyShare Please log in or register to add a comment.
0 0 votes page size is 8kb d=13 bit p=27 bit tlb set not 128/4=2^5 set no =5 bit tag bit =40-5-13=22 bit ankit2024 answered Dec 5, 2025 ankit2024 comment Share Follow See 1 comment 1 1 comment reply saismrutiranjan18 commented Aug 23 reply Follow flag easiest explanation 0 0 replyShare Please log in or register to add a comment.
0 0 votes 8-9 this type of question asked in gate exam ankit2024 answered Dec 5, 2025 ankit2024 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes P0535_Yedidyah_Sagar answered Jul 7 P0535_Yedidyah_Sagar comment Share Follow See 1 comment 1 1 comment reply saismrutiranjan18 commented Aug 23 reply Follow flag easy explaination 1 1 replyShare Please log in or register to add a comment.