So, I am confused regarding the whole KB /KiB concept. I read in a datasheet that a specific L2 cache has 256KB capacity. From other sources I have read the size to be 256 kB.
Sometimes when people write KB, or kB, they mean KiB, and sometimes not. My limited knowledge about memory leads me to believe that cache sizes should be a power of two bytes.
In the context of cache size, is it more likely that the size of the memory is 256 000 bytes or 2^10*256= 262 144 bytes?
Edit: Not the actual datasheet, but as an example have a look at the L1 cache on this AMD processor.
http://en.wikipedia.org/wiki/File:AMD_A64_Opteron_arch.svg
A kilobyte is 1024 bytes. 256 kilobytes is 262,144 bytes. The 262144 number is more likely, although (very unlikely) some non functional memory could be unused to increase yield.
Each cache line/slot matches a memory block. That means each cache line contains 16 bytes. If the cache is 64Kbytes then 64Kbytes/16 = 4096 cache lines. To address these 4096 cache lines, we need 12 bits (212 = 4096).
The higher the demand from these factors, the larger the cache needs to be to maintain good performance. Disk caches smaller than 10 MB do not generally perform well. Machines serving multiple users usually perform better with a cache of at least 60 to 70 MB.
Its size is often restricted to between 8 KB and 64 KB. L2 and L3 caches are bigger than L1. They are extra caches built between the CPU and the RAM.
You've got:
All 3 of these things imply binary sizes, so yes, it's safe to assume they meant 256 kilobinary bytes = 256 KiB = 256×1024 B = 262,144 bytes.
Yes, writing it as "KB" is non-standard and confusing and wrong, but it's unfortunately common, so you need to use context to figure out what is actually meant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With