Scientific Converters Precise unit conversions for science & engineering.

    Loading…

    Cache Memory Calculator

    The address splits into tag, set index and block offset: a 32 KB 4-way cache with 64 B blocks on a 32-bit address uses 19 tag bits, 7 index bits and 6 offset bits.

    Cache size unit:
    Mapping:
    Tag bits =

    19

    Set index bits
    7
    Block offset bits
    6
    Cache lines (blocks)
    512
    Sets
    128
    Lines per set
    4
    Address split
    19 | 7 | 6 (tag | index | offset)
    Tag directory size
    10240 bits
    Tag directory size
    1280 bytes
    Step-by-step solution
    1. Offset = log₂(block) = log₂(64) = 6
    2. Lines = cache ÷ block = 512; sets = lines ÷ k = 128; index = log₂(sets) = 7
    3. Tag = address − index − offset = 32 − 7 − 6 = 19

    Cache Memory Formula

    tag = address bits − log₂(sets) − log₂(block)

    lines = cache ÷ block, sets = lines ÷ k

    Worked Example

    A 32-bit address, 32 KB 4-way set-associative cache with 64-byte blocks:

    1. Offset = log₂(block) = log₂(64) = 6
    2. Lines = cache ÷ block = 512; sets = lines ÷ k = 128; index = log₂(sets) = 7
    3. Tag = address − index − offset = 32 − 7 − 6 = 19

    Block offset bits: 6 · Cache lines (blocks): 512 · Sets: 128 · Lines per set: 4 · Address split: 19 | 7 | 6 (tag | index | offset) · Tag directory size: 10240 bits · Tag directory size: 1280 bytes

    GATE tip

    Write the split as tag | index | offset and check the bits add up to the address size. Most GATE cache questions are this one calculation plus the tag-directory size.

    More Computer Organization and Architecture Calculators

    Frequently asked questions

    How does associativity change the tag?

    Doubling the ways halves the number of sets, removing one index bit and adding one tag bit. Fully associative caches have no index bits.

    What goes into the tag directory size?

    Each line stores its tag plus control bits (valid, often dirty and replacement bits): size = lines × (tag + extra bits).

    Sources

    Last reviewed: . Factors are stored exactly and computed with 50-digit decimal arithmetic. See how we verify conversion factors.

    Cite this page

    APA

    Scientific Converters. (2026, October 15). Cache Memory Calculator. Retrieved October 25, 2026, from https://scientificconverters.com/calculators/cache-memory-calculator/

    IEEE

    Scientific Converters, "Cache Memory Calculator," scientificconverters.com. Accessed: Oct. 25, 2026. [Online]. Available: https://scientificconverters.com/calculators/cache-memory-calculator/

    Send feedback

    Found a wrong value, a missing unit or an idea? Tell us. We read every message.

    What is it about?

    We store your message, the page you were on and your email if given. See the privacy policy.