1
$\begingroup$

If bits are the base unit of information, why are bytes treated like the base unit?

For example, usually values are expressed in Mega/Giga/Tera/Exa bytes instead of bits. I am aware that bits are sometimes used (e.g. sometimes for internet speed), but generally to me it seems like bytes are used as if they are the base unit instead of bits.

$\endgroup$
  • 1
    $\begingroup$ IMHO that's for historical reasons (akin to why currency in US is in terms of dollars). In fact there were hardware with 6-bit bytes as units (sufficient to cover the characters in alphabet and some extras). $\endgroup$ – Mok-Kong Shen Dec 10 '13 at 0:33
1
$\begingroup$

CPUs operate in machine words and in bytes, but never in single bits. Old CPUs (say 8086/8088 and 80286) had machine words of length 16 bits, which were separated into two halves of 8 bits. Machine code could operate on each of these bytes separately. Memory could also be read in byte chunks, though in reality memory was always read in machine words (the 8088, however, apparently read its memory byte by byte), and nowadays in even larger cache lines.

Another reason to consider bytes is that files are stored as sequences of bytes (nowadays, actually in multiples of a larger unit, the disk sector). There are two reasons for that: one is that CPUs are byte-oriented, and the other is that encodings such as ASCII and EBCDIC use bytes as their atomic unit of data (that is, each byte stores one character). This legacy is still with us - if you read binary data from a file, it will come up with chunks whose length is measured by bytes (even if in practice data is read to a much larger buffer), and the length of a file is measured in bytes.

$\endgroup$
  • $\begingroup$ Thank you for the quick and well explained answers everyone! So essentially it is partially historical and partially because although a bit is the smallest unit, a byte is the smallest unit that is actually functional/useful to deal with? $\endgroup$ – AAM Dec 10 '13 at 18:58
  • $\begingroup$ Yes, that's a perfect summary. $\endgroup$ – Yuval Filmus Dec 10 '13 at 20:02
2
$\begingroup$

For historical reasons.

In the early days and even so today a byte represented the most commonly used data.

A byte represents one character in ASCII.

A byte was and still is the size of the instruction for the most commonly used opcodes at the assembly level. Having the most common instructions in one byte saved the most amount of memory.

It is a power of two so 8 is better than 7,6, and 5.

You can get two BCD digits in one byte.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.