You might have seen the terms GiB, MiB and KiB
around HEXUS in recent months and elsewhere on the Internet, when
talking about memory or data sizes. If you've hung around computing
for any length of time, GB, MB and KB are what you'll have learned
to use when talking about things like system memory, hard disks
and processor caches, so why do we use anything different?
The answer lies in the correct representation of binary numbers.
When talking about a binary number like computer memory or processor
cache, where the memory is made up of a series of memory cells that
hold single bits of information, the number of memory cells is always
power of 2. For instance, 1024 bits of memory, what you'd likely
usually call a kilobit, is 2^10 bits. However, kilo is a prefix
for base-10 or decimal numbers, so it doesn't actually apply to
that figure when it's a representation of a binary number. The correct
prefix is instead kibi, so 1024 bits is really a kibibit.
That rule applies everywhere. So what you'd usually think of as
1GB, or 1 gigabyte, isn't 1,000,000,000 bytes. Giga is the decimal
prefix, so when you say gigabyte it means 1,000,000 bytes, not the
1,073,741,824 bytes it actually is (1024 * 1024 * 1024, all binary
representations). Gibibyte is the correct term, abbreviated as 1GiB.
So you have 1GiB of system memory, not 1GB.
The most common exception, where it's very correct, is the hard
disk, where 1GB of disk space does actually mean 1,000,000,000 bytes.
That's why for every 1GB of hard disk space, you actually see around
950MiB of space in your operating system (regardless of whether
the OS tells you that's MB, which it isn't!).
Apply the bit/byte difference with lowercase b for bit and uppercase
B for byte, and you should be set for writing the correct numeric
suffix depending on what you're talking about.
Just remember it's MiBs of memory, KiBs of cache but GBs of disk
space and you'll be fine. For the full list of prefixes for binary
multiples, check out this handy page. Just think hard about the
number you're talking about, decide whether it's a binary or decimal
representation of a number, then choose the right suffix when writing
it down, or prefix when describing the units you're using. 10GiB
is 10 gibibytes, as an example.
When talking about hardware, we strive to be as technically correct
as we have the ability to be, so don't be confused when you see
KiBs and MiBs. Just refer back to this article when you get in a
muddle or aren't quite sure what's the correct suffix to use for
the number you want to write.