Jump to content

1kb=1024bytes?


Masroor Hussain

Recommended Posts

In computer science, everything is usually going at rate n*2, starting with 8 bits (1 byte). 1024 is as close to 1000 as this formula can get you to.1 * 2 = 2 * 2 = 4 * 2 = 8 * 2 = 16 * 2 = 32 * 2 = 64 * 2 = 128 * 2 = 256 * 2 = 512 * 2 = 1024And once you reach that, a new unit is used to keep the numbers low - Kilo, Mega, Giga, Terra, Peta, etc.Therefore1024bits = 1Kbit1024bytes = 1KbyteI'm not sure why 8 bits were chosen to be 1 byte though. I believe it was to preserve the math between bits and bytes as close to as possible. I mean you're still just multiplying by two and exponenting by 2.Why do you do that you ask? It's because when you add one more bit, you get double the possible values (0 included).1bit = 2 values2bits = 4 values3bits = 8 values4bits = 16 values5bits = 32 values6bits = 64 values7bits = 128 values8bits = 256 valuesand if you want to exponent the values by 2, you need to double the number of bits.8 values(=3bits) ^ 2 = 64 values(=6bits)Twisted, huh?

Link to comment
Share on other sites

Don't think that it's 1000 because it looks like the format for SI units, because KB, MB, GB etc are not SI units, they just confusingly use the same prefixes with a slightly different meaning, which has already been explained (2^10 rather than 10^3).Some manufacturers will use this in an attempt to not actually sell as much as they seem to. For example, a 320GB hard drive using 1000 bytes to a KB might actually only have 298GB of space using the more correct measure. Truth be told it's actually a bit more complicated than that - and it can be used to mean 1000 - the recommended meaning varies depending on the context, which is awful. KB in things based on the power of two should be 1024 and 1000 is recommended for things that don't, like bitrates.There have been attempts to make this more simple, for example making KB comply with 1000 increments and creating a new KiB (kibibyte) unit for 1024, but these efforts have been largely ignored, so I think it's best to just assume that KB will mean 1024, and if you want to be very clear that it IS 1024 and not 1000, then KiB is not ambiguous, but a bit less recognisable.

Link to comment
Share on other sites

I'm not sure why 8 bits were chosen to be 1 byte though.
It's all about the telegraph. Wiki:AsciiThe original telegraphic codes settled on 7-bits to encompass the entire alphabet (both cases), numbers, basic punctuation, and control characters. These latter were necessary for the mechanical telegraph devices of the time--as in BEL (ascii 7) literally meant "ring the bell." This amounts to 128 characters. But 7 is a dumb number for computers, while adding one more bit doubles the number of possible characters. And since the original character tables were laid out in 16 rows, 8 bits still fit within the hexadecimal scheme.But of course, the whole system was devised by Americans in the bad-old days, who never imagined that a world-wide system might need to account for more glyphs. C'est la vie.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...