To start at the beginning, what is a byte?
Before we begin, I would like to thank Kor, for patiently explaining this to me again and again, backwards and forwards, until it got to the point that I could actually understand it and write about it. So here goes:
A byte is a unit of measurement for digital information. You can think of a byte kind of like a letter in an alphabet. In the English alphabet, there are 26 letters, and you could assign each letter a number between 0 and 25 (A=0, Z=25).
A byte is like a letter in an alphabet - except that the alphabet that it belongs to has 256 letters and they don’t really have names. They are just numbers. In the byte alphabet, for example, we might make a word that has 5 letters. That would take up 5 bytes. Each letter can be one of 256 choices (instead of 26 choices in the English alphabet). There isn’t really a reason for that. However, a single byte is made up of a string of eight 1s and 0s (you may have heard of binary). A single 1 or 0 is called a bit. The choice of eight bits in a byte is arbitrary, however, there are 256 combinations of eight 0s and 1s in a string (or a byte). A byte’s size is convenient because each byte is big enough to hold one of many different types of characters: uppercase letters, lowercase letters, numbers and symbols. To make it more complicated, a byte’s meaning isn’t always the same. For example, in a text file, a “space” character might be represented as a certain byte value but in an image file, that same byte might be a black pixel.
To expand the above example, if we look a tiny 12 byte file and what’s inside of that file, we know that there are 12 numbers. Each of those numbers is a value between 0 and 255, but we don’t know what those values necessarily mean - that depends on the type of file it is, for example a text file (.txt) versus a image file (like a .jpg).
To compare this to literature, if we pretend that this 12 byte file is actually a tiny book with 12 words in it (where a word in this example = a byte) and each of those words has a meaning, but we don’t know the actual meaning of that word unless we know the context that it is written in. Like the word bear: a big fuzzy bear; or a load that we bear. The word looks the same from the way it is written, but means a completely different thing in the context.
Hopefully I haven’t lost you. So now that we understand what a byte is (and for that matter, what a bit is), let’s look at what all those byte prefixes mean.
1000 bytes is a kilobyte (KB). This photo of Kor and me is 147 KB. It was taken with my iPhone, uploaded to Facebook and then downloaded from Facebook (because I deleted the original photo off my phone), so I think that’s why the file size is smaller - less pixels.
1000 kilobytes is a megabyte (MB). A lot of photos taken with my camera are in the megabyte range. This photo taken with my iPhone camera is 2.1 MB. Granted, once this blog post is uploaded to the internet, I think the file size will be compressed. I’m not sure how that happens - so that is something else that I will have to add to my list of things to learn.
1000 megabytes is a gigabyte. A gigabyte is pretty big. To put that in perspective, one episode of the Bachelorette - Desiree’s season is 1.2 GB.
I wonder if I’ll ever meet a yottabyte...
No comments:
Post a Comment