 In this unit, we're going to talk all about files and folders. In short, files are the basic unit of information that you as the user deal with, and you organize these files into what are called folders. At the start, however, we need to back up and first talk about how any information at all is stored electronically. In all likelihood, you've encountered the term bit. Bit is short for binary digit, and it's the smallest possible piece of information. A bit is simply anything which has one of two states, and normally we symbolize these two states as zero and one. What the two states mean, what they represent, is up for grabs. It could mean that something is either on or off. It could mean either yes or no, or true or false, etc. Now, the actual physical mechanism, which is in one of these two states, differs from one technology to the next. The simplest example of a technology that represents a bit would be like the flag on a mailbox, because that flag is either up or down, and it's used to represent these two states. Either there's mail to be had, or there's no mail. Obviously, in computers, the physical mechanism is electronic in nature, but the end goal is really just the same. Some kind of mechanism which can switch between these two states. In a computer, that might be some piece of circuitry, or it might say be some electrical charge on a magnetic surface. It varies from one technology to the next. In any case, an individual bit by itself is not terribly interesting, but if you use multiple bits together, we can represent more interesting kinds of information, like, say, numbers. Now, how exactly this is done is a bit beyond the scope of our discussion here, but in brief, the idea is we need to convert from the counting system you're familiar with called decimal, you need to convert it into the alternative counting system called binary, because in the binary system, you only use two symbols, one and zero, and so a number in binary form can actually be represented using a series of bits. So, for example, if you wish to represent the value in decimal we call 22, written 22, that same quantity in binary, for reasons I won't get into, is written 10110, and so we can represent the quantity 22 using five bits. So that, in brief, is how we represent numbers, but what about more interesting kinds of information like, say, text? Well, it turns out that we can represent text using numbers, and as we just explained, numbers can be represented using bits. The way we can represent text as numbers is to simply assign to each character a unique number. So, for example, imagine I wish to represent this text here, a space banana. Now, in this text, there are eight characters in total, but only five of these are unique, because uppercase A is repeated three times, and uppercase N is repeated twice. Also note that an uppercase A is a distinct character from a lowercase A, and actually the space itself is a kind of character. So, for each of the unique characters here, lowercase A, space, capital B, capital A, capital N, I need to arbitrarily assign to each of these a unique number. And so, supposing I assign to lowercase A, the number 97, to space the number 32, to capital B, the number 66, to capital A, the number 65, and then to capital N, the number 78, this is how I would represent this text in numbers. I would represent it as 97, 32, 66, 65, 78, 65, 78, 65. Now, of course, when I record that data, that series of numbers, the important thing is that I, or whoever is reading that data back, needs to use the same mapping of characters to numbers. There's nothing inherent in the number 66 itself that indicates that it represents uppercase B. That was just an arbitrary decision I made. So, whoever is writing this data needs to effectively agree with whoever is going to be reading this data about which characters map to which numbers. And because it would be a huge headache if every program and every computer in the world used its own mapping of characters to numbers, instead, most programs use standard mappings called character sets. Most programs in the world today use a character set called Unicode. And so, text data written by most programs should be readable by most other programs. So, that's the basic idea of how text is represented as bits. But what about an image? Well, if you zoom in on a digital image, you'll find that the image is actually made up of these discrete points in a grid. And each one of those points is set to just a single color. Usually these points are represented as little squares as they are here. And they're called pixels, which is a combination of the words picture elements. Each pixel is an element of the image. So now, if an image is made up of these pixels, to represent an image we need to represent the individual pixels. And to represent an individual pixel, we need to represent a color. And so, how do we represent colors? Well, it turns out we can use the same trick we used with text characters. We just need to map each unique color to a unique number. Once we've done that, we can represent each row of pixels as a series of numbers. And so, because a whole image can be represented as a series of rows of pixels, we can represent the whole image as a series of numbers. Be clear here that like with text, the decision of what number corresponds to what color is really totally arbitrary. The important thing is that in the end, when the data is sent from the computer to your monitor, your display device, the important thing is that your monitor is hardwired to display the right colors given the right numbers. So, once we can represent images, it's then fairly obvious how to represent a moving image. A moving image, like a video, is simply a series of still images displayed one after the other. How to represent audio is less obvious, but again, the general idea is to reduce it to a series of numbers. When audio is recorded by a microphone, it is translated into an analog electrical signal. This analog signal can be represented as a wave. And so, to translate it into a series of numbers, what we do is we take a sample point at regular intervals along the wave, and we record the height of the wave at each of those points. Thus, an analog signal can at least be approximated as a series of numbers. The more samples of the wave you record per second, the more accurate a representation of the wave you get. To get CD quality sound, you need to record at about 40,000 samples per second. Now, to convert an analog signal into these digital samples, you need a special chip called an analog digital converter, and to go the other way, to convert from digital samples into an analog signal, you need a chip called a digital to analog converter. So you'll find such chips in any digital device that's capable of recording or playing back sound. We have a number of important terms to describe multiples of bits. First off, a byte is eight bits. We also have these prefixes, kilo to mean a thousand, mega to mean a million, giga to mean a billion, and tera to mean a trillion. So if I say kilo byte, I mean a thousand bytes. If I say gigabyte, I mean a billion bytes. And you have to be careful not to confuse bits with bytes. If you say megabit, that means a million bits. But if you say megabyte, that means a million bytes. So a megabyte is actually eight times the number of bits as a megabit. You have to be especially careful about this distinction between bits and bytes with abbreviations. In the abbreviation KB, it doesn't matter whether or not the K is uppercase or lowercase, but if the B is lowercase, that's supposed to mean kilo bits. And if it's uppercase, it's supposed to mean kilo bytes. In most contexts, people talk in terms of bytes rather than bits. So they will talk in terms of say a gigabyte rather than a gigabit. However, terms of bits are generally favored when talking about data transfer speeds. So for example, the internet connection I get from my cable company is advertised as ten megabits per second. I wish it were ten megabytes because then it would be eight times as fast. But sadly, it's just ten megabits. When talking about data storage, however, the convention is to talk in terms of bytes. And most storage devices these days have a total capacity of some number of gigabytes.