GATE / CS ARCHIVE

GATE CSE 1999 / QUESTION 19(b)

Split the direct-mapped TLB address

Operating Systems · Virtual Memory & Paging · Full GATE CSE 1999 paper

GATE 1999, Q19(b) 1 mark · Descriptive
Report issue

Virtual Memory & Paging

Question 19(b), GATE 1999: A byte-addressed segmented-paging system has 2^16 bytes in each of its virtual and physical address spaces, divided into 8 equal virtual segments. The hardware segment table points to each segment’s page table in main memory. Each page-table entry is 2 bytes. GateForum visibly prints 2^16; GFG loses exponent formatting and appears as 216. With 512-byte pages, a direct-mapped TLB holds 16 virtual-page translations. How many tag bits per entry are needed?
Question 19(b), GATE 1999: A byte-addressed segmented-paging system has 2^16 bytes in each of its virtual and physical address spaces, divided into 8 equal virtual segments. The hardware segment table points to each segment’s page table in main memory. Each page-table entry is 2 bytes. GateForum visibly prints 2^16; GFG loses exponent formatting and appears as 216. With 512-byte pages, a direct-mapped TLB holds 16 virtual-page translations. How many tag bits per entry are needed?
Tap to enlarge
Answer & solution

Answer: 3 tag bits (no official key was published)

A 512-byte page has 9 offset bits. Therefore the full 16-bit virtual address has 7 virtual-page-number bits. A 16-entry direct-mapped TLB uses 4 of those bits as its index, leaving 7−4=3 tag bits. In this segmented layout the address can be drawn as [segment:3 | page within segment:4 | byte offset:9]. Indexing by the low 4 virtual-page bits chooses the page number within a segment; the stored 3-bit segment tag distinguishes the eight segments that map to that same TLB slot. Page offset bits neither select a translation nor belong in its tag. This is the tag for the single address space described; unmentioned address-space identifiers or additional implementation status are not included.

Original paper, page 8