IEC60027-2: Let's use standards, or 1024 B == 1 KiB && 1024 B! = 1 KB && 1000 B == 1 kB

Good day, dear!

Recently, reading various articles in the hub, I began to notice more and more that many authors still do not know anything about ISO / IEC standards for binary prefixes (KiB = kibibyte, MiB = mebibyte, etc.) and constantly confuse them with SI prefixes (kB = kilobytes, MB = megabytes). So I decided to talk about it again in the hope that, after reading the article, a couple more people will start using the standards!


Departing from the topic, I want to say that, frankly, due to lack of time, I was never going to write an article for Habr. I always had enough read-only account'a to calmly read articles interesting to me and sometimes comment on VKontakte (yes, and there are quite a lot of adequate ones there!). But the mote in the eye began to turn into a log, so I still donated one night to write this article.

Back in 1999, the IEC (International Electrotechnical Commission) adopted the international standard IEC60027-2 [IEC60027-2: 2005, ISO / IEC80000-13: 2008].
Through publications in various scientific journals, the world has learned about the new standard.


More than 13 years have passed since that time, but unfortunately, due to the incorrect use of SI prefixes rooted in the consciousness of the older generation for writing data sizes, confusion not only still flourishes even in the technical literature, but is also passed on to the younger generation.

Let's see what’s the matter!

SI (Le Système International d'Unités) is an international system of units that describes not only units of physical quantities, but also defines the so-called standard prefixes :



As we can see, the basic number system in SI is decimal, i.e. on the basis of 10.
In information technology, however, a binary number system is used, i.e. on the basis of 2. Convenience for the sake of, someone decided to use the prefix kilo also for information units.
At the same time, the value of a kilo was snatched out of the SI, and either out of ignorance, or out of malice, it was distorted : from 10 3 = 1000 made 2 10 = 1024
I agree that the difference is small in the era
640K ought to be enough for anybody
it didn’t bother anyone much, but it was here that Pandora’s box was opened.
(by the way, K is the abbreviation for the unit of temperature - kelvin, and in this sense 640 kelvin, which is approximately equal to +367 degrees Celsius, for any body is definitely enough)

With the development of information technologies, more and more values ​​appeared and the confusion became more and more :
• Someone used kilo, mega, gig, etc. meaning 1024 x (for example: 1MB = 1024x1024 B)
• Someone used kilo, mega, gig, etc. meaning 1000 x (for example: 1MB = 1000x1000 B)
• Someone started using both in the same system (for example: 1MB = 1024x1024 B, but at the same time 1Mbit / s = 1000x1000 bit / s)
• Someone began to invent something like KByte, MByte, GByte, etc. meaning 1024 x
• Sometimes they managed to mix everything even in one digit: so with a diskette size it was believed that 1MB = 1000x1024 B
• ... there were more and more options

And what is the problem, you ask?

A simple example:

You are buying a hard drive that says 2TB.
Bring home, connect to a Windows computer, and before you even have time to format it, you see a size of 1.82 TB.
“Pinned,” you think! And as much as 181 GB! And this is a whole cow as much as 10%!
What to do? Who pinned? Who beat the face?


If you look objectively - you pinned Windows, or rather Microsoft ( Apple would have pinned it like that too, so if you beat the face, then both ).

Why are they doing this?

I asked one leading Microsoft employee: “Why are they hiding the file extension in the standard setting?”. To which he received the answer: "It is too complicated for users and they do not need it."

Maybe this is the reason for the confusion?

Quasimonopolists Microsoft and Apple consider their customers idiots to be completely intelligent people and therefore simply deceive them !? I honestly don’t see other reasons.

So let's look at the calculation:

2TB = 2x1000x1000x1000x1000 B ~ = 1.819x1024x1024x1024x1024 B = 1.819TiB


In this calculation, the dependence of the values ​​is visible and it is clear where the figure in Windows came from, albeit with the wrong abbreviation, and attentive (and who knows about it) noticed a small letter i in TiB.

So, we finally came back to the international standard IEC60027-2, which, in order not to destroy the Earth, space and humanity, is a system of quantities in physics, chemistry, etc. defines prefixes for binary multiples specifically for IT: physics.nist.gov/Pubs/SP330/sp330.pdf (§3.1, p. 34)

Composing them according to the scheme: SI-prefix binary (kilo binary, mega binary, giga binary etc) , we come to the following table:


Well, how simple?

And even if the pronunciation is kibibyte, mebibyte, gibibyte, tebibyte, etc. it sounds strange and slow, I think it’s easy for everyone to use KiB, MiB, GiB, TiB, etc. in the texts !?

Does everything seem new and unknown?

But the standard is already 13 years old!
(By the way, IPv6 is even older, and it still cannot be entered normally - it seems that due to the harmful effects of large firms, standards have to lie for ten years and gather dust until some Apple arrives, will patent the letter i in KiB and MiB, and having organized a multi-million dollar advertising company, will sell it as a new feature)

But despite this, the standard has long been used in open products!

For example, on Linux, the standard is supported by the kernel itself.
And here is a screen with ifconfig


Why do I need it, you ask?

  • Firstly, GOST 8.417-2002 makes it work according to standards.
  • Secondly, computer science is an exact science in which everything should be logical and almost everything is deterministic! And if you are truly an IT pro, and do not want to seem like a schoolboy in the eyes of your colleagues, then try to use the standard in your publications and programs, i.e. add i if you specify the data sizes on the basis of 1024.

    Examples of using:


  • Thirdly, the incorrect use of values ​​can lead to very expensive consequences :
    In this case, NASA lost a Mars Orbiter probe worth 125 MUSD (= 119.2 MiUSD) in September 1999 precisely because of problems in using the correct units of measurement!
  • In addition, the use of incorrect spelling of data sizes “according to tradition” or because “it has taken root or is convenient”, it’s the same as saying: “meter is nonsense, I will continue to measure distances with my elbows, feet, fingers, tongue and others body parts "

And in the end I’ll bring a familiar joke to everyone:
A normal person thinks that there are 1000 bytes in a kilobyte, and the programmer is sure that there are 1024 grams in a kilogram.

Therefore, I want you, IT pros, to urge: Let good conquer evil! Let's all get normal, put an end to the confusion and use the standards!



P.S. and for training (whoever wants) it’s a small and easy task
(I didn’t seem to see the tasks on the hub, but for interactivity with the reader, I think it's nice to suggest something that is not so difficult to warm up):

You bought yourself the latest smartphone with support for fast LTE networks, which in the ideal case develops when downloading speeds up to 300 Mbit / s.
With the thought: “Now I will have something to do, sitting in a traffic jam at work,” you have concluded an unlimited tariff for mobile Internet.
On Wednesday night, while standing in traffic, they sent you a link to a new video about how Putin, pretending to be a seal leader, led a whole flock of seals to spawn, saving the whole flock of sharks and fighting off attacks by Somali pirates.

"That's what I need!" - you thought and decided to download the video.

Question: how many seconds will a 60 MiB video be downloaded if:
1. Although your provider sold you an LTE tariff, in traffic the average download speed is only developing at the UMTS level with HSDPA of 600 kB / s
2. when transferring each file, an overhead of 15% of the file size appears
3. possible compression is not taken into account in this task


UPD1
from MAC OS X version 10.6, Snow Leopard shows correctly in SI units , so I ask Apple not to beat its face for this


UPD2
since there are a lot of questions about kbit and kibit, I’ll make a small summary here:

I tried to explain in the article and several times in the comments that kilo-, mega-, kibi-, mebi- (abbreviated k, M, Ki, Mi) and t .d. - these are just standardized prefixes that are assigned to units of measure (grams, bits, bytes, pixels and more)
  • kilo means multiply by 1000, mega - by 1000 * 1000
  • kibi means multiply by 1024, mebi by 1024 * 1024


therefore, for example:
8 kbit = 8 * 1000 bit, but 8 Kibit = 8 * 1024 bit
13 MPixel = 13 * 1000 * 1000 Pixel
256 MB = 256 * 1000 * 1000 B, but 256 MiB = 256 * 1024 * 1024 B

In addition , there is a suggestion to everyone who does not like to “beep” as an alternative to use a short form of the prefix when pronouncing, i.e. read kb, mb, gib, tib , etc.

Of course, this is not in the standard, but if it spreads, it will most likely be adapted.

Also popular now: