All Exams Test series for 1 year @ ₹349 only
Question

A system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size 4 KB. The virtual address space is 64 GB and physical address space is 1 GB. If each TLB entry stores a 4-bit process id, page number, frame number, and a 2-bit control field, then the size of the TLB (in bytes) is ___________. (answer in integer)

Note: 1K=$2^{10}$, 1M=$2^{20}$, 1G=$2^{30}$

Calculating TLB Size in Bytes

This solution calculates the total size of the Translation Lookaside Buffer (TLB) in bytes based on the provided parameters like TLB reach, page size, address space sizes, and the structure of a TLB entry.

Determine Number of TLB Entries

The number of entries in the TLB is determined by dividing the TLB's reach by the page size.

  • TLB Reach: 1 MB = $2^{20}$ bytes
  • Page Size: 4 KB = $4 \times 2^{10}$ bytes = $2^2 \times 2^{10}$ bytes = $2^{12}$ bytes
  • Number of Entries = TLB Reach / Page Size
  • Calculation: $\frac{2^{20} \text{ bytes}}{2^{12} \text{ bytes}} = 2^{20-12} = 2^8 = 256$ entries

Calculate Size of a Single TLB Entry

Each TLB entry contains several fields. We need to calculate the total bits required for one entry.

  • Process ID: 4 bits
  • Page Number Bits:
    • Virtual Address Space = 64 GB = $64 \times 2^{30}$ bytes = $2^6 \times 2^{30}$ bytes = $2^{36}$ bytes.
    • Total virtual address bits = 36 bits.
    • Offset bits = $\log_2(\text{Page Size}) = \log_2(2^{12} \text{ bytes}) = 12$ bits.
    • Page Number bits = Total virtual address bits - Offset bits = $36 - 12 = 24$ bits.
  • Frame Number Bits:
    • Physical Address Space = 1 GB = $1 \times 2^{30}$ bytes = $2^{30}$ bytes.
    • Total physical address bits = 30 bits.
    • Offset bits = 12 bits (same as page offset).
    • Frame Number bits = Total physical address bits - Offset bits = $30 - 12 = 18$ bits.
  • Control field: 2 bits
  • Total bits per entry = Process ID + Page Number + Frame Number + Control field
  • Calculation: $4 + 24 + 18 + 2 = 48$ bits

Compute Total TLB Size

The total size of the TLB is the number of entries multiplied by the size of each entry.

  • Total Size (in bits) = Number of Entries $\times$ Bits per Entry
  • Calculation: $256 \times 48 \text{ bits} = 12288$ bits
  • Convert to Bytes: Total Size (in bytes) = Total bits / 8 bits/byte
  • Calculation: $\frac{12288 \text{ bits}}{8 \text{ bits/byte}} = 1536$ bytes

Therefore, the size of the TLB is 1536 bytes.

Was this answer helpful?

Important Questions from Memory Management

  1. Which of the following is/are the basic units of IAS computer?

  2. Which of the following have the fastest access time?

  3. _________ is a memory management scheme that permits the physical address space of a process to be noncontiguous.

  4. Which of the following is a type of memory and is similar to RAM?

  5. Suppose you have eight 'black and white' images taken with a 1‐megapixel camera and one '8‐color' image taken by an 8‐megapixel camera. How much hard disk space in total do you need to store these images on your computer?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App