I understand how to set associate mapping, but I got a bit stuck if the cache was given to me in lines instead of Kb
The question is to calculate the tag, record and word bits when using the 2-way set associative mapping.
The byte-addressable main memory is 2 MB and a block size of 16 bytes. A cache of 128 lines is used.
I calculated the word bits with 4 bits.
The length I calculated with 21 bits.
When calculating the set bits, I know that set = cache / blocks. And then the answer is divided by 2 (as a 2-set associative) and then another calculation is done to compute the bits (eg if I had 2K, the bits would be 2 ^ 1 * 2 ^ 10 = 2 ^ 11, hence its 11 bits).
Can someone help please?