Metric Prefixes and SI Units

Pages
Contributors: JordanDee

Bits and Bytes

Working with bits and bytes can cause a bit confusion (pun intended). Since computers work with base 2 numbers instead of base 10, it is often unclear which number base one is referring to when using the metric prefixes. For example, 1 Kilobyte is often used to mean 1000 bytes (base 10), or it can be used to represent 1024 bytes (base 2), resulting in misunderstandings.

To eliminate these mix-ups, the International Electrotechnial Commision came up with some new prefixes for the base 2 bits and bytes. These are referred to as binary prefixes.

 Prefix (Symbol) Power Numeric Representation exbi- (Ei-) 260 1,152,921,504,606,846,976 pebi- (Pi-) 250 1,125,899,906,842,624 tebi- (Ti-) 240 1,099,511,627,776 gibi (Gi-) 230 1,073,741,824 mebi- (Mi-) 220 1,048,576 kibi- (Ki-) 210 1,024 no prefix 20 1 bit or byte

Adopting this would mean 1 Megabyte = 1000 Kilobytes while 1 Mebibyte equals 1024 Kibibytes. Essentially for bits and bytes, each jump in prefix would be a multiple of 1024 (210) instead of 1000 (103). Unfortunately, this system is not widely used in practice, so anytime you hear a number of bytes or bits, you have to wonder if they are talking about them in base 2 or base 10.

Hard drive companies and others typically sell products in base 10 as it makes it sound larger. A 1 Terabyte hard drive will turn out to actually be about 931.3 Gibibytes.

This is where we run into the upper case and lower case ‘k’ situation. The proper prefix for kibi if ‘Ki’. However, it will sometimes appear as just and upper case ‘K’, which, again, represents temperature in Kelvins. So, any time you hear the word Kilobyte, you still have to wonder if it signifies 1000 bytes (base 10) or 1024 bytes (base 2). On the other hand, if you see the term kibibyte, you know for sure it’s talking about the base 2 version interpretation of digital storage (1024 bytes).

Converting Bits to Bytes and Bytes to Bits

We’ve covered converting bits and bytes to larger or smaller numbers of each, but there is also the matter of converting bits to bytes and vise versa. Remember that 1 Byte is equal to 8 bits (a majority of the time), and one bit is equal to 0.125 bytes (or 1/8). Granted, there are many orders of magnitude pertaining to bits, but byte is typically used most frequently. The practice of converting between one and the other is not all that common, but it is still useful information when dealing with electronics, especially when it comes to memory. For example, you could be writing code that stores individual bits, but your memory is defined as bytes.

In 2003, CU student Nate Seidle blew a power supply in his dorm room and, in lieu of a way to order easy replacements, decided to start his own company. Since then, SparkFun has been committed to sustainably helping our world achieve electronics literacy from our headquarters in Boulder, Colorado.

No matter your vision, SparkFun's products and resources are designed to make the world of electronics more accessible. In addition to over 2,000 open source components and widgets, SparkFun offers curriculum, training and online tutorials designed to help demystify the wonderful world of embedded electronics. We're here to help you start something.