UVMArena

Associative Mapped Cache – Problem 4

This example analyzes a Fully Associative Cache system where the RAM size and block size are given. The objective is to determine the tag size used in the cache address structure.


Given Parameters

Parameter Value
RAM Size 8 GB
Block Size 8 KB
Cache Mapping Fully Associative
Addressing Type Byte Addressable

Step 1 — Convert RAM Size

First convert the RAM size into powers of two.


RAM Size = 8 GB

8 GB = 2^3 × 2^30
     = 2^33 bytes

Since the system is byte-addressable, each byte has its own address. Therefore, the number of physical address bits is:


Physical Address Size = 33 bits

Step 2 — Determine Offset Bits

The block size determines how many bits are required to select a specific byte within the block.


Block Size = 8 KB

8 KB = 2^3 × 2^10
     = 2^13 bytes

Offset Bits = log2(2^13)
            = 13 bits

Step 3 — Compute Tag Size

In Associative Mapping, the tag represents the frame number. The physical address is divided into:


Physical Address

+------------+-----------+
|    TAG     |  OFFSET   |
+------------+-----------+

The tag size is calculated by subtracting the offset bits from the total physical address size.


Tag Bits = Physical Address Bits − Offset Bits

Tag Bits = 33 − 13
         = 20 bits

Final Result

Parameter Result
Physical Address Size 33 bits
Offset Bits 13 bits
Tag Size 20 bits

Key Concepts

  • Associative mapping stores the full frame number as the tag.
  • The physical address is divided into tag + offset.
  • The number of offset bits depends on the block size.
  • The tag size is the remaining bits of the physical address.
  • This mapping removes conflict misses but requires hardware comparators.