1 字节 = 8 位是公认的
然而,在很多来源中我看到
1 千字节 = 2^ 10 字节 = 1024 字节
AND
1 KB = 1000 字节
为了确保我们都清楚,您的问题是“1 KB 等于 1024 字节还是 1000 字节?”。
这是否矛盾,因为在这两种情况下都规定 1 字节是 8 位......?
这与问题无关。
那么,让我们开始吧。在SI(公制)中,1000的乘数称为kilo,缩写为k。 kalways意思是 1000,没有别的意思。
When binary computers entered the world, we noticed that 2 to the power of 10 is 1024, which is conveniently close to 1000. Computer engineers decided to abuse this coincidence and say that kilo means 1024. By extension, they say that mega means 10242 (instead of the proper definition of 10002), and so on with giga, tera, etc.
While the difference between 1000 and 1024 is small for many purposes, there are times when exact answers are required, and this is where the abusive terminology hurts everyone. Only after decades after kilo=1024 got established did anyone really try to fix the problem. The IEC proposed new prefixes for the binary multipliers: 1024 = kibi, 10242 = mebi, 10243 = gibi, etc.
总之,kilo=1024 的概念是对 kilo=1000 的一致 SI 定义的滥用。虽然 kilo=1024 在计算机行业很流行,但它仍然是错误的,应该替换为 kibi=1024。或者需要重新计算数字以反映千/兆/等的真实定义。 (例如,“512 MB”的 RAM 实际上约为 536.9 MB。)
顺便说一句,不要使用随机大写;它的拼写是千字节,而不是千字节。
参考资料和链接:
- http://physical.nist.gov/cuu/Units/binary.html
- http://en.wikipedia.org/wiki/Kilo-
- http://en.wikipedia.org/wiki/Kilobyte
- http://en.wikipedia.org/wiki/Kibibyte
- http://xkcd.com/394/