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 the main function of the memory management system?

    1. It keeps track of which parts of the memory are currently in use.

    II. When memory is available, it allocates memory to the programs to be loaded.

  2. How many address lines and input-output data lines are needed in a 2k × 16 memory unit?

  3. 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?

  4. Computational circuitry in a CPU is referred to as the ____________

  5. Given below are two statements, one is labelled as Assertion A and the other is labelled as Reason R

    Assertion A: Major advantage of DRAM is that the capacitor cell never loses its charge and hence there is no need to refresh periodically.

    Reason R: When DRAM is being refreshed, the data cannot be accessed.

    In light of the above statements, choose the correct answer from the options given below

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