A bit is the smallest piece of information in a computer, a single value storing either or .
A byte is a unit of digital information that consists of of those bits.
Here's a single byte of information:
Here are three more bytes of information:
From bits to bytes
Conversion between bits and bytes is a simple calculation: divide by to convert from bits to bytes or multiply by to convert from bytes to bits. Try it yourself!
Check your understanding
How many bytes long is this binary sequence?
Check your understanding
How many bits are in bytes of information?
What is so special about bits that it deserves its own name?
Computers do process all data as bits, but they prefer to process bits in byte-sized groupings. Or to put it another way: a byte is how much a computer likes to "bite" at once.
A computer with a thought bubble with three bytes inside
The byte is also the smallest addressable unit of memory in most modern computers. A computer with byte-addressable memory can not store an individual piece of data that is smaller than a byte.
What's in a byte?
A byte represents different types of information depending on the context. It might represent a number, a letter, or a program instruction. It might even represent part of an audio recording or a pixel in an image.
We'll explore how computers can use bits and bytes to represent all types of information in this unit.
Want to join the conversation?
- What if we have a number of bits that are non-divisible by 8? Is that possible?(2 votes)
- "At12:18, what does the concept of byte-addressable imply? A computer should be able to store an individual piece of information, being made of wires?"(5 votes)
- A byte is a grouping of eight bits. Byte-addressable means that the computer stores data in bytes instead of single bits for example.
Wires are used for transporting information, computers generally don't use them as a storage device.(5 votes)
- How do quantum computers work with bits and bytes?(4 votes)
- Quantum computers do not work with traditional bits and bytes; rather, quantum computing uses qubits, which stems from the phrase "quantum bit."
Providing an in-depth explanation of qubit operation would be difficult to do in this comment, and I am certainly no expert on the subject matter. Here are two resources to develop a better understanding of the subject:
- if bits were a thing you can hold what would it look like?(1 vote)
- We sort of already have that. Take a coin for example, it could either have heads facing up, or tails. So it has two possible states, which is what a bit is. However, a coin stores a bit, rather than actually being a bit. I don't exactly know what bits themself would look like, since they're really just an idea, rather than an actual object.(10 votes)
- Why bytes?Like why is it 8 and not like like 10 wouldn't that make it easier.(1 vote)
- In our base 10 system, 10 is a place value represented by 10^1. In binary, however, it's in base 2, so 8 is a place value represented by 2^3.
It's 8, because 8 is close to our friend 10.(8 votes)
- How would a computer store a piece of information that only requires a bit like if a lightbulb is on or off in byte form?(2 votes)
- The type of information you are inquiring about is represented by a data type known as a Boolean. A Boolean data type is stored in memory as either a 0 (an equivalent to the lightbulb being in the off state) or 1 (an equivalent to the lightbulb being in the on state).
Using C++ as a reference, Boolean values are stored as 8-bit (1-byte) values so that they are still addressable. Memory is byte-addressable, so referencing a single bit becomes prohibitive. You can still represent one Boolean per bit, but that would require extra work on the part of the developer as they must now understand and work with bit manipulation.(5 votes)
- So if I'm understanding it correctly, a byte doesn't necessarily represent a number using 8 digits - for example the byte 10110110 can mean that:
First process = 1 = On
Second process = 0 = Off
Third = 1 = On
Fourth = 1 = On
Fifth = 0 = Off
Is this correct? Or if a byte is representing separate processes it has to be 00000001 for the first process, 00000000 for the second, etc(3 votes)
- A byte can represent a number using 8 binary digits; 10110110 would be equivalent to the base-10 number 182 (if we are not considering two's complement representation) or -74 (if we are considering two's complement representation).
However, a byte (or a multitude of bytes) can represent different types of information depending on the context (as mentioned in the article). A multitude of bytes can represent an image, a text file, a video file, etc.
Using the byte to represent whether a process is "On" or "Off" in process counts of 8 is not a conventional use that I have come across. However, if you decided to formulate your own unique problem such that a byte represents processes which are on and off then it could be used in that manner (it makes for an intriguing thought experiment). One of the amazing properties of binary representation is how many different types of information can be represented by simple 0s and 1s.
Do note, though, that on the machine itself processes have process IDs (PIDs) and their metadata is managed by the operating system. Bytes will not be used to represent whether or not processes on a computer are running by flipping bits of the byte to 0 or 1, there are different mechanisms at play.(3 votes)
- how do you tell the difference between a 0 and a 1(3 votes)
- You have protocols to define the timing and so on (when does the message start, end).
And then you use different voltages ("high" and "low") to differentiate between 1 and 0.(2 votes)
- are there any patterns that one can pic up on in binary.(2 votes)
- The evolution of bits goes like this;
Bits -> Bytes -> Kilobyte -> Megabyte -> Gigabyte -> Terabyte -> Petabyte -> Exabyte
Starting from bytes, the value is multiplied by 1000 + 24. For example, a thousand and twenty-four kilobytes (1,024 KB) would be a megabyte, and a thousand and twenty=four terabytes would be a petabyte.
It is sort of a pattern, but if you mean something else, please tell me.(3 votes)
- why count by 8?(2 votes)
- Computers started out with 5 bits, but this didn't leave enough options for all the characters we needed to use. So, it grew to 6 and then 7 bits. 7 bits is enough to represent all the characters we can type on a keyboard, but 8 is a power of 2 which made things easier since we were working with binary numbers. So, bytes are now 8 bits.(2 votes)