What are bits and bytes? How do they differ? What role do these notions play in the computer science world? Why do talk about 8 bits = 1 byte = 256 states or different patterns? What's the rationale behind it? Why not 4 bits = byte? What is so special about 8? How much info can a bit and a byte hold?
-
https://en.wikipedia.org/wiki/Bit, https://en.wikipedia.org/wiki/Byte – Yuval Filmus Feb 05 '22 at 13:51
-
A very insightful question, but it has already been answered! You should check this, there is a full explained and accepted answer. – wajaap Feb 05 '22 at 14:13
-
Please ask only one question per post. Note that we require you to do a significant amount of research before asking: https://meta.stackoverflow.com/q/261592/781723. If the answer to some of your questions is found on Wikipedia or in standard textbooks, you probably should be doing more research before asking in the future. – D.W. Feb 06 '22 at 20:40
-
Please use appropriate tags. This question is only loosely related to the C programming language. – D.W. Feb 07 '22 at 19:37
-
@VinaySharma Please refrain from disrespectful comments if someone chooses not to help you. – Discrete lizard Feb 09 '22 at 13:49
1 Answers
What is a bit and byte? How do they differ?
A bit is the smallest useful unit of information. A bit can only have two states, which are commonly called 0
and 1
, False
and True
, or Off
and On
.
A byte is the smallest individually addressable unit of memory in a computer system.
Why role do these notions play in the computer science world?
As I mentioned above, a bit is the smallest useful unit of information. Information is very important in Computer Science: It has been said that Computer Science is really a misnomer, and is akin to calling Astronomy "Telescope Science" – just because computers can be used to investigate information and processes doesn't mean that they are somehow inherent to that science, just like the fact telescopes can be used to investigate planets and stars doesn't mean that telescopes are somehow inherent to astronomy.
There are some languages, for example German, French, and Italian, where the scientific discipline makes no reference to computers at all: in German, it is called Informatik, in French informatique, in Italian informatica – all are a neologism based on information and the Greek suffix -ik. In Spanish, it is called ciencias de la informática (similar to German, French, and Italian) or ciencias de la computación: note the subtle difference to English, it is the science of computation, not the science of computers. Danish uses the terms datalogi (a neologism formed by combining data with the -logi suffix as in geology, meteorology, metrology, etc.) for the stricter sense of the science of information, data, computation, and processes, and informatik for a broader inter-disciplinary view of the effects of "datalogi" on society, politics, humanity, and the broader world in general; what might be called Social Informatics in English.
As you can see, in many languages, there is a clear distinction made between "Informatics" and computers. It is a rather unfortunate accident of history that the language which confuses the two also happens to be the lingua franca for it.
Bytes, on the other hand, are not really playing a role in computer science. They do play a role in the organization of real-world computer systems, though. Accessing memory is an important operation in real-world computer systems, and the way the memory is addressed plays an important role in high-performance low-level code.
Why do talk about 8 bits = 1 byte = 256 states or different patterns?
We don't. A byte is not 8 bits. A byte is the smallest individually unit of memory in a computer system. In other words: the size of a byte depends on which computer system you are talking about. E.g. the DEC PDP-1, PDP-4, PDP-7, PDP-9, and PDP-15 has 18-bit words consisting of 3 6-bit bytes. The DEC PDP-5, PDP-8, PDP-12, and PDP-14 has 12-bit words consisting of 2 6-bit bytes. In fact, 6-bit bytes used to be rather common. Other byte sizes that have been used are 1, 4, 7, 9, 10, 12, 18, 20, 36, and generally many different sizes between 1 and 48 bits.
What's the rationale behind it?
There are many different trade-offs to consider when choosing the byte-size of a computer system. Traditionally, a byte had the same size as a character, and many early computers had 6-bit characters so they had 6-bit bytes. But for a DSP designed to process digital audio with a sampling bit depth of 24 bits, having both the word size and the byte size be 24 bits is completely natural.
Why not 4 bits = byte?
There have been computer systems with a byte size of 4 bits. There probably still are such computer systems.
What so special about 8?
From a theoretical perspective: nothing. From a market perspective: traditionally, bytes were the same size as characters, and first ASCII became a popular character set and encoding, which has a size of 7 bits. Even byte sizes and even more so, byte sizes which are a power of 2, are somewhat nicer to handle, so when 7-bit characters became common, 8-bit bytes became common. And once 8-bit bytes were common, 8-bit character sets (such as ISO8859-15 or Windows1252) became common, further cementing 8-bit bytes as the most common byte size.
Many networking protocols are based on 8-bit "chunks" as well, but they usually call them "octets" to make it clear that they are always 8 bit, even if the computer system has a different byte size.
How much info can a bit and a byte hold?
One bit can represent 2 different unique states. A byte can represent $2^{size}$ different unique states.

- 6,140
- 23
- 25