Ask Question

Determine the number of cache sets (S), tag bits (t), set index bits (s), and block offset bits (b) for a 1024-byte 4-way set associative cache using 32-bit memory addresses and 8-byte cache blocks.

+4
Answers (1)
  1. 8 April, 06:37
    0
    The answer is The Cache Sets (S) = 32, Tag bits (t) = 24, Set index bits (s) = 5 and Block offset bits (b) = 3

    Explanation:

    Solution

    Given dа ta:

    Physical address = 32 bit (memory address)

    Cache size = 1024 bytes

    Block size = 8 bytes

    Now

    It is a 4 way set associative mapping, so the set size becomes 4 blocks.

    Thus

    Number of blocks = cache size/block size

    =1024/8

    =128

    The number of blocks = 128

    =2^7

    The number of sets = No of blocks/set size

    =128/4

    = 32

    Hence the number of sets = 32

    ←Block ←number→

    Tag → Set number→Block offset

    ←32 bit→

    Now, =

    The block offset = Log₂ (block size)

    =Log₂⁸ = Log₂^2^3 = 3

    Then

    Set number pc nothing but set index number

    Set number = Log₂ (sets) = log₂³² = 5

    The remaining bits are tag bits.

    Thus

    Tag bits = Memory - Address Bits - (Block offset bits + set number bits)

    = 32 - (3+5)

    =32-8

    =24

    So,

    Tag bits = 24

    Therefore

    The Cache Sets = 32

    Tag bits = 24

    Set index bits = 5

    Block offset bits = 3

    Note: ←32 bits→

    Tag 24 → Set index 5→Block offset 3
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Determine the number of cache sets (S), tag bits (t), set index bits (s), and block offset bits (b) for a 1024-byte 4-way set associative ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers