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. Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4 KB, 25 KB, 18 KB, 7 KB, 9 KB, 15 KB, and 12 KB. Assume that no two holes are adjacent. Two processes P1 of size 16 KB and P2 of size 9 KB arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to P1 and P2, the number of holes of size less than 8 KB is ____________. (answer in integer)

    Note: 1K=$2^{10}$
  2. Match List I with List II
    List IList II
    A. Clustered Page TableI. Generally considered inappropriate for 64 bit architectures.
    B. Hierarchical Page TableII. Has only entry for each real page (or frame) of memory.
    C. SegmentationIII. Useful for Sparse address spaces.
    D. Inverted Page TableIV. Supports a user view of the system.

    Choose the correct answer from the options given below:
  3. Choose the correct answer.
    In memory management, page size is always, power of 2.
  4. Which of the following is a type of memory and is similar to RAM?

  5. 200 μs should be the memory size of a digital storage oscilloscope to be able to record a transient of 10 seconds with a time resolution of 200 μs?

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