千字节/兆字节/太字节的表示
我对不同字节单位的表示有点困惑。
1 字节 = 8 位是自始至终都被接受的。
然而,在很多来源中我看到
1 千字节 = 2^10 字节 = 1024 字节
并且
1 千字节 = 1000 字节
这是否矛盾,因为在这两种情况下都规定 1 字节是 8 位...?
不同的来源对这些不同的表示有不同的原因,因此我不确定这种相当令人困惑的表示差异的最重要/真正的原因是什么。
有人可以解释和澄清吗?
I was getting a little confused with the representation of different units of bytes.
It is accepted throughout that 1 byte = 8 bits.
However, in a lot of sources I have seen that
1 kiloByte = 2^10 bytes = 1024 bytes
AND
1 kiloByte = 1000 bytes
Doesn't this contradict as in both cases it is stated that 1 byte is 8 bits...?
Different sources claim different reasons for these different representations, thus I am not sure what the most important/real reason is for this rather confusing difference in representation.
Can someone please explain and clarify?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当你谈论计算机科学中的数据信息时,你总是要通过2的幂来计算结果。看看维基百科是怎么说的:
有时人们会像您提到的那样对它进行舍入,但这是一种不好的使用。
When you talk about data information in computer science, you always have to calculate the result by a power of two. See what wikipedia says:
Sometimes people use to round it as you have mentioned, but it is a bad use of it.
如果你问 1 KB 等于 1024 还是 1000 字节,我不明白字节到位有什么关系。这些测量并不是一成不变的,而且根本不受真正控制。计算机制造商可以(并且已经)使用 1000 转换来使其看起来拥有更多内存。
当考虑二进制(基数 2)或基数 10 时,就会出现问题。基数 10 您会使用 1000、基数 2、1024。
I don't see what the byte to bits has to do with anything if you are asking whether 1 kiloByte is equal to 1024 or 1000 bytes. These measurements are not set in stone and are not really controlled at all. Computer makers can (and have) used the 1000 conversion to make it look like they have more memory.
The problem comes up when thinking about binary (base 2) or base 10. Base 10 you would use 1000, base 2, 1024.
为了确保我们都清楚,你的问题是“ 1 KB 等于 1024 字节还是 1000 字节?”。
这与问题无关。
那么,让我们开始吧。在SI(公制)中,1000的乘数称为kilo,缩写为k。 k 始终 表示 1000,绝无其他值。
当二进制计算机出现时,我们注意到 2 的 10 次方是 1024,这很方便地接近 1000。计算机工程师决定滥用这个巧合,并说 kilo 表示 1024。推而广之,他们说 mega 表示 1024< support>2(而不是 10002 的正确定义),依此类推,有千兆、兆兆等。
虽然对于许多用途来说 1000 和 1024 之间的差异很小,但有时需要准确的答案,而这就是滥用术语伤害每个人的地方。直到 kilo=1024 成立几十年后,才有人真正尝试解决这个问题。 IEC 提出了二进制乘法器的新前缀:1024 = kibi、10242 = mebi、10243 = gibi 等。
总而言之,kilo=1024 的概念是与 SI 一致定义 kilo=1000 的滥用。虽然 kilo=1024 在计算机行业很流行,但它仍然是错误的,应该替换为 kibi=1024。或者需要重新计算数字以反映千/兆/等的真实定义。 (例如,“512 MB”的 RAM 实际上约为 536.9 MB。)
顺便说一句,不要使用随机大小写;它的拼写是千字节,而不是千字节。
参考文献和链接:
To make sure we're all clear, your question is "Is a kilobyte equal to 1024 bytes or 1000 bytes?".
This is irrelevant to the question.
So, let's begin. In SI (metric), the multiplier of 1000 is called kilo, abbreviated k. k always means 1000, never anything else.
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.
In summary, the notion that kilo=1024 is an abusive deviation from the consistent SI definition of kilo=1000. While kilo=1024 is popular in the computer industry, it is nevertheless wrong and should be replaced by kibi=1024. Or numbers need to be recomputed to reflect the true definition of kilo/mega/etc. (For example, "512 MB" of RAM is actually about 536.9 MB.)
Btw, don't use random capitalization; it's spelled kilobyte, not kiloByte.
References and links: