Representation of a Kilo/Mega/Tera Byte
Asked Answered
A

3

5

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?

Autoerotic answered 29/6, 2011 at 15:31 Comment(2)
en.wikipedia.org/wiki/KibibyteDarrendarrey
note that a long, long time ago there were systems where a byte had 6 bits, or 7.Drench
C
8

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

To make sure we're all clear, your question is "Is a kilobyte equal to 1024 bytes or 1000 bytes?".

Doesn't this contradict as in both cases it is stated that 1 byte is 8 bits...?

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:

Cy answered 10/8, 2011 at 16:9 Comment(2)
Can't delete my own answer as it's "accepted", but yours is better than mine.Mckale
Ah, I didn't know that behavior in the Stack Exchange software. Thank you for your feedback.Cy
V
0

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:

"In computing, a binary prefix is a specifier or mnemonic that is prepended to the units of digital information, the bit and the byte, to indicate multiplication by a power of 2. In practice the powers used are multiples of 10, so the prefixes denote powers of 1024 = 2^10."

Sometimes people use to round it as you have mentioned, but it is a bad use of it.

Violoncellist answered 29/6, 2011 at 15:41 Comment(0)
F
-1

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.

Fluorinate answered 29/6, 2011 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.