 All right. Welcome to Computer Science E1, Understanding Computers in the Internet. My name is David Maylan, and I will be one of your instructors this semester. So this course, as its title suggests, is really about understanding. So odds are, these days, most everyone in this room, maybe everyone in this room uses a computer every day, whether it's for work, for word processing, or whether it's to send email, or just chat, for use Facebook, whatever the case may be. But presumably, at least some of you are here, because you don't necessarily understand how it all works underneath the hood, or if something goes wrong, whether at home or at work, the hands are more likely to go up than they are to actually get dirty and solve that problem. And so this course really is about filling in some of those blanks, technologically, as to how things work, whether it's inside of your computer, whether it's outside of your computer on the internet at large, so that by the end of the semester, you not only feel more comfortable in front of this device, whether at home or at work, but you also have a sense of how you can troubleshoot your own problems. You can also hold your own, perhaps, at the water cooler, talking to those people today. You view as much more technically savvy than you, or at least the proverbial computer people. We will, by semester's end, turn you into one of them. And I think one of the best takeaways from a course like this and that we do survey so many different parts of computing and of technology is that you'll realize, perhaps, by semester's end, that even if you are not a master or even familiar with the very latest and greatest, it's much less of a big deal once you have your mind around some of the fundamentals. And so we'll take you through a tour of the semester tonight, but we'll also dive right in and look at some of these pieces of jargon that you might have felt surrounded by for years, that you might think you kind of know, but perhaps we can give a little more technical spin to that understanding, and then along the way, you are encouraged to ask any and all questions. So let me say from the outset, and though many teachers might say this, it really is true in a course like this, there really is no dumb question. And odds are, if your hands inclined to go up, odds are there's someone else in the room who has that same question, so there's no shame. But to lower that bar nonetheless, what we will do starting next week is if you know there's really a question that you'd like to get off your chest, you're just not the type of person who's going to put that hand up during lecture. We're going to put by the side of the room here just an anonymous sort of box. So if you want to discreetly pick up your handouts and drop a little crumpled piece of paper with that tech question, we'll be sure to answer those as anonymously as we can. Of course, now all of you will be watching the door to see who's depositing those questions in the box, but you can also slip us a note via email in advance or more privately. So let's dive right into something that you've perhaps seen or heard of or taken for granted, and that's this notion of binary. So even if you're not the proverbial computer person just yet, odds are you at least have heard of this notion of binary, the binary system, or at least have probably heard that computers somehow or other revolve around bits, zeros and ones. And if not, well, there's our introduction for today. So at the end of the day, all of this stuff we take for granted, whether it's Android phones or iPhones in your pocket or TiVo at home or Macs or PCs that you might use on your desk every day, literally. All of that fanciness reduces to some really simple building blocks. And these machines have just gotten so fancy and sophisticated because mankind has layered on top of some of these fundamentals year after year after year. And so that's why we start with this lecture today and next week on hardware so that you realize from some of these most basic building blocks do you get these phenomena like Facebook and instant messaging. It really will ultimately reduce to zeros and ones. So with that said, here's perhaps something that's a little inviting here in that there's this notion of light bulbs on the board. And in fact, we can count just as a computer can in binary using light bulbs. And so this is perhaps the fanciest light bulb I could perhaps find these days. But suppose I want to represent a piece of information. And the smallest possible piece of information we could probably represent these days is, let's say, a zero or a one. It's hard to imagine expressing a smaller unit of information than just a single digit, a single boring digit, like zero or one. But zero and one is still a little mathy, and yet it doesn't have to be. And so we can represent this same notion of very small pieces of information just with electricity or light bulbs, or really my hand up or my hand down. It's very easy to come up with some fairly real world if contrived examples of something being on or up or off or down. And we can do that, for instance, with a flashlight or a light bulb. So if this thing here is not an iPhone, but it's actually just a cheap light bulb, well, at the moment it's representing the on state, because this little light in the corner is on. And if I toggle it and flip its state around, well, now it's off. And so this is perhaps one of the simplest ways we can encode information. At the moment I am representing on, or let's call it one, or let's slap a different label on it, let's call it true. Because in fact, in computing and in mathematics, you'll often consider one to be the same as true or yes. Any situation where you can come up with two sort of opposite notions, like chocolate or vanilla, black and white, one, zero. It doesn't really matter. It really reduces to this notion of a bit. And we can store just that single bit of information. Now, of course, if we used lights or flashlights or hands up or hands down to represent information, we couldn't scale it very well. We would need thousands of light bulbs to represent thousands of zeros and ones. And thankfully, the world has miniaturized this kind of hardware these days. So inside of our computer are things called CPU and RAM and hard disks. Stuff we'll talk about this week and next. But in the very simplest form, all of those pieces of hardware we hear about today reduce to just zeros and ones. Now, how might we represent these in hardware? You might have heard this piece of jargon over time. A transistor heard this at least, maybe, sort of. So a transistor is just a very tiny piece of hardware that is a switch, really. It's something that's on or it's something that's off. And we'll talk more about things called CPUs today and next week. But a CPU, for now, is the brains of a computer. And as the years pass, CPUs get more and more transistors in them, more and more switches that can be on or off in them, the implication of which is that increasingly with each passing year can a CPU number crunch more and more zeros and ones. So this is one of the reasons our computers are getting faster and our files are getting bigger is because there's more of these things called transistors at the very low level inside the machine that just represent more and more of these zeros and ones. All right, so representing zero and one, completely uninteresting. You can't represent all that much. We need multiple zeros and ones. We need to put these things called transistors to use. So how can we start taking this very simple building block of a bit, a zero or a one, and build up? Well, I give you the so-called binary system up here on the board. So you might recall from grade school that when you first learned to count and do addition and subtraction way back when, you probably wrote down a number like this on the chalkboard or a piece of paper. And the teacher told you that the thing on the right is the so-called ones column. The thing over to the left was the tens column. And this is the hundreds column and thousands column and so forth. So it might have been years, frankly, since you had to whip out this little heuristic. But that is how most of us probably learned arithmetic back in the day. And so it turns out we can use that same basic building block from grade school and computers, but not use zeros and ones and twos and threes and nines. We can just use zeros and ones. Computers, because ultimately they're going to leverage things like electricity that can be on or off, or little lights that can be on or off, or transistors, you can't express zero through nine as we might with a piece of chalk. So we're just going to represent zero and one. So we have to change the column values if we want to represent bigger numbers than zero or one. So at the top of this slide here in the very top row, you see eight light bulbs that are all white. So they're off at the moment. But notice the placeholders I've labeled at the very top. It's a little small, but on the right-hand side is still the ones column. And then for those of you who it's not too small, the next column over is the twos column. And then the fours, and then the eights, and then the 16s. And even if you can't read it, what's going to come next? 32, 64. So it's similar in spirit, the pattern. But rather than by increasing by a factor of 10, I'm just increasing by a factor of two. So here I keep multiplying by 10 by 10 by 10 as I go from right to left. In the binary system, it's the same principle. But you just multiply not by 10 each column, but by two. And the two derives from the fact that you only have two digits, zero and one. And so in fact, when you hear this word bit, which again I used a moment ago to describe the notion of a zero or one, bit is binary digit by meaning two, zero or one. Hence, all of this jargon starts to consolidate into the same idea. So a bit is just a zero or one. So now in that top row of eight light bulbs that are off, if you apply the same grade school approach as we did here to the number 123, what number is presumably that top row of light bulbs representing in the so-called binary system? Yeah, it's all zeros. They're all off. So we're just going to assume that off means zero. It's completely arbitrary. Off could mean one, but we got to make some assumptions. So off means zero. So that's like saying 0, 0, 0, 0, 0, 0, 0. In all of the columns, that's just like sort of as a doofus, I might just write all zeros on my piece of paper. But this too is just the number we know as zeros. So all eight light bulbs off represents zero. All right, so how do we then represent the number 10 in sort of grade school form? Well, if we want to represent the number 10 in this column, well, what number do I put where? One in the tens column. I don't need any ones. So zeros, I can put a zero here, but leading zeros. Zeros on the left have no meaning. So I don't mean to sort of regress us all simultaneously, but because you probably, again, for years have not thought about this one and this zero reducing to the ones column and the tens column. But sure enough, if I have a one in the tens column and a zero in the ones column, the total, when you add those together, is just 10. So if I want to represent the number one, and I have not ones and tens and hundreds and thousands, but ones and twos and fours and eights, what light bulb do I need to turn on out of my eight in order to represent the number one? Yeah, the one all the way on the right, the one in the ones column. So now you can probably bootstrap yourself from here, even though the pattern might get a little non-obvious when we look at light bulbs here. If you want to represent the number two in binary, well, if I have one, two, three, four, five, six, seven, eight placeholders, and I want to represent the number two, I cannot do this. Why? Quick sanity check. Two is not an option. So in the binary system, by, meaning ironically, two, it means two digits only, which are zero and one. So I can't write two, but I can write a zero or one. So what do I want to write here and here? One zero. Yeah, so one zero. Now, even though this looks like the number 10 to normal humans, when we're in the context of the binary system, we now have a zero in the ones column and a one in the twos column, and so the total is one times two plus zero times one. So it's just two. Now, if we want to represent the number three, what do I do in binary? One one. Yeah, just one one. Now, why is that? Well, again, I can't whip out the number three because I'm not in the decimal system. I'm in the binary system, but I can use another digit one. And now if I've got one in the ones column and a one in the twos column, one times two plus, so that's three. And now it gets a little aesthetically interesting. If I want to represent the number four, how do I do that? Well, remember the notion of carrying? When you add like nine plus two, you have to carry the one when you're actually doing it in grade school. It's the same idea. If I just add one here, OK, one plus. Well, I'll just skip that because you can kind of see where we're going. But to represent the number four, I just want one four because this is the four's column. I need zero twos. And I need zero ones because I already have the four, and that's four. Now, we can very quickly make this a very boring exercise. And we can count to five and six and seven. But if you'll notice sort of conceptually, the bits just keep changing from zero or one. And as soon as you filled up or used up all the available ones, the number sort of overflows or carries over to the next column, just like it did years ago. So rather than bore ourselves with five and six and seven and eight, little trivia question, what's the biggest number I can represent with eight placeholders? Well, what's the biggest digit I can put in each of these placeholders in the binary system? So one. So if I put one, one, one, one, one, one, one, one, one, one, if you can kind of make that leap ahead, what is the biggest number I can represent with eight bits as on the board here? We can go back to five or six if you prefer. What? It's 255. Yeah, so it's, in fact, it's 255. Now, you could kind of reason through this, right? Because we know this is the 128th column, and this is the 64th column. So you could do this arithmetically. But you can also take a shortcut. And I promise, this is the most mathy this course we'll get. Really, we start with 0s and 1s, and then we start to abstract away, just like you do in the consumer market these days. You probably don't care that your iPod uses the binary system. So we'll get there. But for now, just you can think of it this way. Each of these places can take on how many different values? Two. So there's two options here. There's another two options here. Two options here. So that's really like two times two times two times two. And you can kind of do all the math. And if you, in the end, you have two times itself eight times, because there's eight placeholders, two to the eighth is 256. Wait a minute, did we make a mistake? I conjecture that two times two times two dot dot dot eight times gives me not 255, but 256. And yet your answer is right. Why is the answer 255 and not 256? Yeah? OK, so it's really seven times because the last column is one. And so that's true. And that's actually kind of a side effect of the fact that let's flip the question around. What's the smallest number we can represent with eight bits? Oh, careful. All zeros, right? The smallest number we can represent with eight placeholders is just set them all to zero. So we have to include this value zero. So if there's 256 possibilities, but one of them is zero, well, the biggest then is 255. Now why dwell on this unit of eight placeholders, or even this number 255, 256? Well, it turns out we're going to see these same kinds of numbers recur even throughout these higher level notions of computers today, like Windows and Mac OS. If you ever go to your display control panel on a Mac or PC, you might have noticed at some point that you can control how many colors your monitor is configured to show. When we get to website development later in the semester, you're going to have the ability to choose what color to make the text on your page and the background of your page. And these numbers from zero to 255 are going to recur, but in a much more compelling way because we're going to see that 111111111 represents the color white. All zeros is going to represent black. And then we have 254 possible permutations in between that are going to let us express a couple hundred different colors. Those of you who might have a design interest or design for to use tools like Photoshop, you'll actually see the same units of eight even laced throughout Photoshop when you choose colors or experiment with various tools like that. So even though we're starting low level here, we can start to do very quickly some very interesting things. So any questions on this initial notion of binary in a bit? It's OK. Again, if that was completely over your head, we'll redefine. Good. So if we have eight placeholders here, and each of them can be one of two values, a zero or one, we can figure out the total by either counting them all up or just doing two times two times two times two. And this gives me 256. But that is the case if I set them all equal to one. That's presumably the largest possible value. But if I need to also account for zero and I start counting at zero, well, how many times can I count on my fingers 256 times if I start from zero, not from one? So a normal human would start counting one, two, three, four, dot, dot, dot, 256. But in the computer world, when you start counting from zeros and you move your fingers up 256 times, the last number you're going to hit is going to be 255 because you started at zero. And that's really the only difference. But this too, sort of a very low level detail, but it's going to occur when we talk about programming later in the semester. It turns out when you write computer software, whether it's an instant messaging software or a website like Facebook or Microsoft Word, whatever it is that you or someone you know might be programming, turns out that in the programming world, too, you almost always start counting from zero, not from one, which is a bit of a mental adjustment for folks in the beginning. But it really reduces to just this reality that if you're going to set everything to zero, it'll just kind of make sense to start counting from zero. Yeah. Good question. So why is it that eight bits, eight placeholders, is used as a storage container? Part of it is convenient. So the very specific answer is it's a power of two, and that's a good thing. But in general, it's a useful size of measure. You could imagine using two bits or four bits, but the world early on generally found that with eight bits can you express some useful notions related to colors, related to letters of the alphabet, which we'll actually see in a moment. But these days, you might have seen that if you buy a Mac or PC, you might have seen on the label somewhere the advertisement mention of 32-bit or 64-bit maybe. 64-bit is invoked these days. So these days, computers are actually using many more placeholders, as many as 64 or even larger, because their computing powers have gotten faster. So for most part, it's kind of a historical thing now. But we'll build up beyond eight in just a moment, in fact. Yeah. Did it have to do with it being two times two times two? I don't think so. Not in this case. It's a good thought, but I don't believe so. But I could be wrong. Other questions? All right, so how about a little quiz of sorts? So I've removed the placeholders. I've changed the light bulbs around. But again, each row here in this grid of light bulbs represents a number. So there's a total of five numbers here. There's five rows. Each row represents a number. Let me challenge you for the next, say, 60 seconds to see if you can determine exactly what number is being represented here. I'll see if I can put on some soothing music in the background. Don't call it out just yet, because I have just the music for this. If you're the type who doesn't participate in class, there's no excuse for not at least getting the last one. So the last one should be easy. It's zero. The second one is easy. It's also zero. So you only had three numbers to come up with. So let's start with the top one and read them from the top down. So the first one is off, off, off, on, off, off, on. So which of the light bulbs, before we spit it out, which of the light bulbs is on, which placeholders? So eight and one. And from there, we can immediately get the answer. We have a one or a light bulb that's on in the eighth column, one that's in the ones column. So eight plus one gives me nine. So the first number is a nine. We don't want to lose anyone here, so any questions on that? So again, we have on the right ones column, then from the right to the left, ones, twos, fours, eights, and then who cares? Because there's nothing more to the left. So we have one eight and one one, which gives us nine. The second row is off, so that's all zeros. So that's the number we know is zero. So we have nine zero. How about the third column, a third row? Little easier now. So it's two, because we have one light bulb on, then the twos column, the fourth column, one. One's kind of super easy now, because that's where we started, right? There's one light bulb on, and it's in the right most. One's column, and the last one is zero. So those who get the joke, the answer is nine, oh, two, one, no. All right, so here's, thankfully, this joke is getting relevant again, because I put back on in some new form. So this is, in fact, how you could represent a zip code, for instance. To represent a five digit American zip code, it seems that you need, what, 40 bits in total. We need eight for the first digit, and then eight for the second, eight and eight. And in fact, that's a bit of an overstatement, because we'll talk later in the semester about useful techniques like compression, whereby you can take what seems to be a lot of bits and use fewer bits to represent the same information without losing any information, because frankly, it looks like we're wasting a lot of bits here. In what sense are we just wasting bits? Yeah, I mean, there's four columns for the zip code that we're not even using. So really, what's the point? And to your question earlier, why use eight bits? Well, maybe that's not the best answer in a lot of contexts. It turns out that computers do tend to speak at least minimally in units of eight, but increasingly these days in units of 32 or 64. So we'll see there's, in fact, this trade-off, whereby sometimes you could express bigger numbers, but if you're not going to, maybe you should not use those bits. Maybe you should compress them. In fact, there's security implications here. So here, too, is this fascinating reality that even from these basic building blocks, do you get some very real-world implications? We'll talk more about this as we go. But long story short, when you save a file on your computer, whether it's macOS or Windows, these days your file is going to be more than a few bits. It's probably going to be a few hundred bytes, a few thousand bytes, and you can essentially think of one byte as being one letter. So if you're writing a thousand-word essay or letter or 10,000-word essay, you can think of that as a thousand bytes or 10,000 bytes. So it's bigger than, certainly, this little example here. But it turns out that computers tend to use a minimally, a certain number of bits, no matter how big the data is that you want to save. So suppose that you really just write one of those silly little post-it notes on your computer, a little sticky in macOS or Windows or whatever. You just write, like, get milk, something short. That takes a few bytes, takes a bunch of bits, but not hundreds, not thousands. Well, your computer, for efficiency reasons, might very well use a thousand bytes even to store your one-word note or your two-word note. Why? Well, Microsoft and Apple kind of figure that, yeah, occasionally you might write a note like get milk, and it's super short. But most of the time you're writing Excel documents. You're saving music files. You're watching movies. This is really the exception to the rule. These terribly small files. So computer scientists and programmers have made judgment calls. And they've optimized the operating system, the computer, for the more common case, big files. But the implication is that, for small files, you are wasting space. Now, who cares? Well, fast forward several weeks to when we start talking about security in this class. We'll talk about the notion of computer forensics and exactly what can and can't happen if someone gets access to your computer and starts poking around your browser history or gets physical access to your hard drive or, for more benignly, you accidentally delete some files on your computer. Can you? And how can you recover those files? Well, if a computer is very often using more space than it actually needs to represent some piece of information, that gap between what it needs and what it's using is called Slack Space. And just to scare a few weeks ahead, it's in this so-called Slack Space. The difference between how many bits you need and how many bits you're actually given by the computer that personal information can end up being stored. It can be fragments of photographs. It can be fragments of personal information like your social security number if part of that file once contained your social security number. So long story short, if you don't quite understand how or why your computer is storing information in certain ways, you certainly can't make an educated decision as to whether or not you should just throw out that hard drive when it's time to get a new computer if you should take it to a store and have them wipe it, so to speak. Just change it to all zeros and ones if you should spend $50 on a piece of software that's supposed to do that for you. Well, one of the lessons of our security lectures are going to be there are many products. And frankly, there are many stores and services out there that might promise to do a one thing. But if you don't really ask the right questions or you don't read the fine print, they're not, in fact, doing what they claim. And there have been, frankly, little horror stories of people taking their computers to Best Buy or those kinds of brick and mortar stores to have their hard drives erased only to then find their hard drives and all of their data on eBay or the like, random examples. But we'll understand exactly what the implications of those cases are. But more importantly, we'll equip you in this course with some of the knowledge and the tools with which to avoid those situations. So the next time you throw out your computer, you're not just throwing it out or giving it away, you're first taking measures to protect yourself. And again, understanding what data is there can help you decide what tool to use to get rid of it. So any questions on 90210 or why this represents that zip code? Good question. So there's this notion of defragmentation, which we'll actually likely talk about a bit more next week. But long story short, defragmentation doesn't refer to compression so much. What it means is that over time, when you're saving files, deleting files, downloading files, emptying the trash, just adding and removing constantly from your computer, eventually files are going to become fragmented. A little bit's going to go over here on the hard drive. A little bit's going to go over here. A little bit's going to go over here. Why is that? Well, as you add and delete files, just holes end up in all of your available bits. And we'll see this a bit more visually today and next week. So your files can get spread out. One file can be in many different places on your hard drive. And that can lead to slower performance, because just intuitively, if some of the files 0's and 1's are over here and some are over here and some are over here on the thing called the hard drive inside of your computer, well, something has to go coalesce all of those bits together, has to find them. That's, of course, your computer, and that just takes more time. So in theory, defragmentation speeds things up. In practice these days in 2011, it's not as compelling a story anymore. And there's probably no need for a typical person to defragment their hard drive. I mean, if I'm at all representative of an even more technical person, I haven't done it in years. And it's decreasingly necessary, which is a good thing, because it's just not an interesting problem for a human to have to deal with. All right, so this is only so useful when we're actually storing 0's and 1's. I mean, who cares about just numbers? All of us are sending emails and typing text, sending innocent messages and typing text, and reading web pages and reading text. So we really need quickly a way not just to represent 1's and 2's and 255, but it'd be really nice if we had A's and B's and C's in our set of tools already tonight. So first let's make a leap from light bulbs to 0's and 1's to be clear. One, on the one hand, we have the light bulbs. If we translate off to 0 and on to 1, we get a picture like this. And so now we're momentarily in the real computer world where the top row 0, 0, 0, 1, 0, 0, 1 represents something called a byte. So henceforth, 8 bits is 1 byte, B-Y-T-E. And you might not speak very often these days in terms of bytes, but you've probably uttered the word something familiar sounding? Kilobyte, megabyte, gigabyte these days, terabyte maybe. And we'll talk about what those prefixes mean. Really, they just mean bigger, bigger, bigger. But for now, a byte is our biggest unit of measure, and it's 8 bits. So what can we now do with this? Well, now we might finally understand cartoons like this. So let's take a pause to appreciate some geek humor. Couple chuckles, maybe? Yes, no? That's not too many chuckles. Is it just a zooming problem? So we do sit here. Or maybe it's a teaching problem. All right? Let's move over here. Now it wasn't the size that I want. So either it's not funny, which is very possible, or I didn't quite do that justice. But the joke, of course, is that if the kid is mentioning he doing 1, 0, 0 sit-ups, well, 1, 0, 0, now using our alphabet of 0s and 1s only is, of course, the number 4, because there's 1 in the 4s column, 0 and 0. So to be honest, that's probably a good thing if you're not laughing at this point in the semester, because we don't want to do too much damage this semester. We'd like you to walk out of here still normal people. But at least we now see a transition to what actually did appear in the Sunday comics at one point. But let's start expressing actual words. So here we have a very overwhelming chart. And it's among the more popular references online, just because it packs a lot of information there. But there's way more than we need. So I'm just going to draw our attention to the highlights. So turns out there are more systems in the world than just binary. There's decimal, of course, with which we all grew up. There's something called hexadecimal, which we'll actually talk about a bit in the context of multimedia later in the semester, in the context of website development. There's octal notation. There's base 64. There's all sorts of base systems, where base just means how many digits you have at your disposal. Normal people use 10. Computers use 2. Websites and Photoshop tend to use more. But for now, we'll focus on just one detail here. It turns out that the world early on had to decide how to represent letters of the alphabet. A, B, C, D, all the way through Z. Not just uppercase, but lowercase. Then there's some random punctuation. So we have this whole alphabet that we wanted to be able to translate from the real world to the blinking cursor on the screen. And yet all we have at our disposal are 0s and 1s, bits. So we needed to decide what patterns of bits should represent different letters. What pattern of bits should represent an A? What patterns of bits should represent B? And the whole world has to agree upon this. Otherwise, we'd just be looking at nonsense, random series of 0s and 1s. And so the world came up with a system whose acronym is ASCII. And this is just a piece of jargon that describes a mapping between numbers in binary or decimal. They're just numbers at the end of the day. Doesn't matter how you represent them, but a mapping between numbers and letters. And it turns out that the world decided that the capital letter A is going to be represented with the decimal number 65. And the letter B is going to be represented with 66. The letter C, anyone know? 67. So there was at least a pattern here once they chose a starting point. Meanwhile, lowercase A was chosen to start with 97. Lowercase B is 98. And frankly, if you know those two, capital A and lowercase A, you can get 52 possible letters. Less interesting to us today are what's a period? What's a comma? But all of those answers aren't a chart like this. If for the curious, this is not something you need to commit to memory or read and wrap your mind all that much around. It's just a reference that folks tend to cite because it's at ASCIItable.com. So if I go to the column, where's my A? All right, of course it's beyond reach. So in this column at the very top, you might see the letter A in red. And I can draw this out there. So there's this letter A roughly in the middle of the screen right now in red. Now to the left, you essentially see a geek's three different ways that a geek might represent this letter A. On the left-hand side is the number 65. And that's under the dec decimal column. That's the normal people column for the number 65. 41, I'm going to wave my hand at, but it happens to be the hexadecimal way of representing that same number. 101 is the octal. And then ampersand, sharp 65 semicolon is the way people who write web pages represent the letter A if they really want to represent it in a unnecessarily cryptic way. Turns out you wouldn't normally represent the letter A with that crazy sequence of characters, but there are some punctuation symbols, copyright symbol. Like, where is the copyright symbol on my keyboard? Well, that's when even in the world of web page development we'll see that there's special sequences, not of numbers, but if letters or weird punctuation that the world has decided represents this graphical symbol. So we'll get there. But for now, the only useful takeaway is let's say a little something like this. So now we have the ability with a computer to represent bytes of information with zeros and ones. How do you do that in hardware? Well, something called a transistor, a very small, very low level piece of hardware that's somewhere on a device like this, a motherboard or a CPU. And we'll exhibit those before long. We represent eight bits at once, and you call it a byte. Once you have a byte, you can represent up to 256 total possible values. So you know how many bits the ASCII system uses to represent each character on your screen? Turns out eight. So one of the reasons for eight being popular early on too, at least for ASCII, is that using eight bits, you can definitely represent the English alphabet, A through Z, in capital and lower case letters. And you can represent a whole bunch of punctuation symbols and the like, but you can't represent all characters. So just to fast forward a bit, when the computers were really coming into their own years ago, a lot of the designers didn't really think about Asian languages, for instance, for which there are many more symbols that you need to express. And so now the world doesn't so much use ASCII, but as an aside, something called Unicode, which uses 16 or more bits to represent letters, just because you needed more bits, so the world has gotten past this limitation. But to break the ice here, this is always hard. Might I be able to scare up a bite of volunteers to come forward for a moment? We need eight volunteers who are comfy appearing on camera. It's a, I think I can promise it's a non-speaking role, if that helps. Yeah, okay, one, I'll take stretching. Is this, yes? Okay, two, come on down. All right, so you are gonna be the number one, and if you could line up over there, excellent. We have four, five volunteers. All right, if you could line yourselves up as you are right now, just like you would a bite of numbers as we did on the chalkboard. All right, it feels like I need two more volunteers. Thank you, excellent. One more, one more, best number yet. 128, oh, okay, all right, 128. All right, so here we have some very brave volunteers. They're all in the proper order, because on the left hand, let's do it the correct way. On your right hand side, we have the ones column, and all the way here on the left hand side, we have the 128's column. So to really hammer this home, let's see if we can't use eight bits, or eight people, to represent a three-letter word. But we can only encode this word using ASCII, which means to represent each letter, these people collectively are gonna have to represent an ASCII character, or the binary equivalent of that character. And because we don't really have eight flashlights, let's keep it simple. If you are to represent a one, let's just have each of you raise your hand, and if you're gonna represent a zero, just stand there awkwardly, with your hands down. So one is up, zero is down, and on the back of these pieces of paper, each of them have been given some instructions. There's three rounds here, three rounds of hands going up and down, each time we're gonna spell a letter. So let me get out of the way, and could our volunteers please spell out the first letter by following the instructions on the back of your piece of paper? Proceed now. All right, so you the audience gets a part take, albeit anonymously, what number are these folks representing? All right, so it seems to be capital B, and why is that? Well, we have, let's see, this is the 64's column, and one is in that column. This is the two's column, so 64 plus 266, and we know from our cheat sheet here that capital B was the number 66. So this is how a computer, frankly, would encode the letter B, if you, the human, are looking at your computer screen and you see the letter B there in Microsoft Word or some similar program, this is what's really going on underneath the hood, but with a little bit of electricity actually representing the zero or one. All right, so now, hands down, good, and round two. So we had a B, wow, all right, a lot of work now. What is this? And now you might wanna refer to the cheat sheet on the board if you need it. What number is being represented first? Okay, okay, I heard, oh, but let's take it one step prior. Number? So it seems to be 79 because if we add up the 64's column was up, and the, what column is this? Eight's column, four, two, and one, you should get 79, and if you look at our little cheat sheet, looking for 79, you should see the capital letter, in fact, O. So we're almost there, B, O, and hands can go down, round three, bring it home. What's next? Let's get the number first, then the letter. What's that? What? Why? Not quite, W, but what's the number? All right, so if you've got 87, actually, can you hand stay up for just a moment? Okay, thank you. So 87, and if we consult our little cheat sheet, that in fact is capital letter W, which of course spells in total? Bow, so if our contestants could take a bow with a round of applause for these brave folks. You can keep those as souvenirs if you'd like. And the one guy, oh, okay, thank you. So looking forward, in case you ever do partake at the front of class, notice that we do have this authorization or release form. This is because this course is videotaped and made available not only to you for a review, or if you happen to miss class, but also for the students we have taking the course via the internet, whom you might never meet, but are in fact watching online. So you just have to be comfortable signing that and leaving that with one of us on the way out if you don't mind if you do appear in front of camera. If you're not the type who ever wants to appear, even be near the line of sight of the camera, generally it should suffice to just sit off to the sides or obviously behind the camera. But this is sort of the hot zone in case you want to be called upon too often. All right, so any questions on bow and the ASCII system? All right, so in just over the course of a few minutes, consider where we've gotten from. So we started really with just a light bulb going on and off and a zero or one being encoded. That's pretty uninteresting because there's only so much information you can encode with just a single light bulb or a single digit. Well, then we added to that seven more and that gave us eight and a byte. And as soon as you have a byte, now you can start expressing more interesting information and perhaps the most necessary from the get go is to be able to represent something like an alphabetical character. And in fact, ASCII, this code for representing letters does in fact use eight bits. But if you look at this chart, overwhelming though it might be, you will see an absence of perhaps special characters. Again, copyright symbol and the Asian symbols. And so this is very much in English centric alphabet right now, but the world has moved toward larger standards that uses more bits to encode that information. So with that, we can leave behind some of the mathematics and look at E1 itself before we dive back into some higher level hardware. So this is a picture that appears in the syllabus on page two, if you have a print out in your hands. If you don't, it's by the window and all of these handouts will always be on the course's website as PDFs. But this whole world of technology and of computers is perhaps fairly like a little hack that the students at MIT did years ago, which was to wire together a fire hydrant, a right, with a water fountain at left and actually make it work so that you can drink out of the water fountain, which is actually in fact a fire hydrant. Not the best experience to have, but the caption below this hack or actually the caption to the side of this hack is a plaque that said paraphrasing, getting an education from MIT is like drinking water from a fire hose. And this was to say that you get hit with a whole lot of information. And that is in fact what it might feel like just in this world these days, especially if you consider yourself among the less technical folk, but still someone who's savvy with computers uses them every day and the like. But again, might just have some holes in your knowledge and understanding. But even in a course like this, you'll find that tonight and in the weeks to come, we'll often use a lot of jargon, but we'll hopefully define any piece of jargon so that it's not taken for granted. Realize if I or Dan or any of us ever use some term or acronym that we just assume everyone knows. Well, it's just because we've forgotten that not everyone necessarily knows that. And that's, of course, when your own hand should go up. And don't expect that you are the only one who doesn't know. It's probably we have aired in that regard. But if you do feel, in a course like this, that there's just so much information, we'll realize the goal is not to swallow all of it, certainly the first time around. But to begin to understand, what are the important aspects of this world of computing and technology? And what are some of the fundamentals so that even if a few weeks hence, you really don't remember what the biggest number is that you can represent with eight bits? Well, who cares? Because hopefully if you can think back to some of these visuals or to some of the building blocks that each of these placeholders can be just two bits, well, you can kind of reverse engineer the solution and figure it out anew. And this really is the case. Once you graduate a course like this, frankly, the day after this course ends, something new is going to be released. It's going to be the next iPad or the next something or other. And so it's going to be some piece of technology that you haven't gotten any training in, any education in, any discussion of. And yet it really shouldn't matter because you'll find that certainly though the world feels like it's moving quite quickly, it's building upon itself at each step. And so with the course's fundamentals, should you be able to kind of shrug your shoulders and be like, oh, I have no idea how that works, but I know what websites to visit to go find out. I know what terms to Google. I know what kind of explanations to discard from the sales people at various stores because they really don't know what they're talking about. And you'll begin to realize out there that you know way more than you might have once. You'll also begin to realize, frankly, in stores that you know much more than the folks you once thought were talking over your head. Sometimes they really are just talking. So what are the resources to be available this semester? So anything we do in the classroom will be on this video camera. But on any handouts we use, any links we tend to go to, we'll post on the course's website either before or after class. The course's website is computerscience1.net. You will find, if you visit it today, that it looks a bit different than it did yesterday because we made some changes just so that you see which version you should see. It looks a little something like this with the big logo in the, come on, slow internet. Give me one moment. Almost there. There we go. Slow wireless in here. So this is what the course's website looks like. Right now there's relatively little because we just began. But on the left you'll see a PDF of the syllabus. On the left you'll see a link to the staff. I'm going to introduce in a moment. To the left you'll see the page on lecture. So anything that happens tonight will ultimately appear presumably on the lectures page. So that's computerscience1.net. More resources to bear in mind are these. To email any of us, you can email help at computerscience1.net. All of this for references in the syllabus. So if you need to feel like you must write absolutely everything down. But this address will go to all of us so that any one of us during the evening can actually field a question. You should take note two of the trajectory of the course. So tonight we're here in the first of two hardware lectures. Well, we'll focus really on the ground up so that we can now start taking for granted in week three what a computer is and what's inside of it and what we can start doing with it. Because in week three what we will do is actually take a short respite. We're going to order in some snacks. We're going to dim the lights and play in a wonderful movie called Pirates of Silicon Valley, which actually traces in an interpreted way sort of a dramatization of the rise of both Apple Computer and Microsoft, specifically Bill Gates and Steve Jobs. And it's actually a really fascinating look at the beginnings of the consumer computer market, both on the Mac and the PC side. From there, well, we return to a look at the internet in two parts and looking at what the internet actually is physically and how it's different from this thing we call the World Wide Web. We've all probably used email as recently as a couple of hours ago, maybe even on our phones more recently. But how does it actually get from point A to point B? Why do you so often, why so often are good emails ending up in your spam folder? Why when you BCC people or their name's not appearing, will tease apart a lot of the more interesting questions, not how to use email, but perhaps as a side effect, how to use it more intelligently or more correctly. But really how data gets from point A to point B, why you get so much spam, how you can actually understand some of the underlying technologies behind email, but also more interestingly the various services that have since grown up on top of this thing called the internet, whether it's instant messaging or the web or increasingly streaming video and the like. And we'll revisit that in our multimedia lectures as well. So from there, we'll take a look at multimedia specifically, looking at graphics design and what it means to actually compress images, how you can actually take a movie that fits, it takes up gigabytes of space when they actually film it, and actually compress it down to something that you can download within a few minutes on your Tivo, your Apple TV, or through Netflix, or any other tool that you might use these days to watch movies. Why are sometimes the movies you're watching kind of splotchy? Why are some of the TV shows you're watching squares? Instead of rectangles these days, all of this actually reduces now not so much to the world of broadcast, but really to the world of computers and the various file formats you might have used already on your computer. We'll look later at security. And in turn privacy, and a lot of the issues surrounding it. It was actually pretty timely this past fall to discuss in an academic setting when a tool called Firesheep was released. Is anyone familiar with at least this program's name? Fume? OK, so well, in a few weeks you'll know how to protect yourself against this freely available tool. So just as a teaser and admittedly a bit of a scare tactic, so it has always been possible to do the following. But this tool made it super easy for almost anyone on the internet to do it because the tool automates the process. Any time anyone of us logs into a website like Facebook or any number of other popular websites, they are not the only one vulnerable to something like this, you tend to log in with a username and password. And most of us probably know now that hopefully you want to look for something in the URL, HTTPS, because the S means secure. It's encrypted. It's scrambled somehow. Or you look for the padlock icon. Or if you're not yet at that point, we'll get there too. But for now, generally when you log into a website, it's encrypted somehow. There's a HTTPS in the URL. There's a padlock icon at the bottom of the screen. There's some indication that this is quote unquote secure. Unfortunately, if leading up to these lectures, you start to keep an eye on your browser. As you visit your favorite websites, you'll generally see that even after you log into a lot of websites, it may be HTTPS for secure briefly. But then it gets you back to HTTP colon slash slash, which is not encrypted. The implication is that a lot of websites are really good at encrypting your username and password when you log in. But for performance reasons, for cost reasons, for reasons of stupidity or lack of knowledge, they then have you using the unencrypted version of the website for everything thereafter. And unfortunately, the world's web these days really uses something called cookies a lot. And these cookies are not as scary as they might have been made out to be in the late 90s when everyone thought, oh, cookies were bad. But cookies can be used against you. For today's purposes, a cookie is just a little file that a website can plant on your hard drive in a pretty benign way just to remember who you are. The advantage to normal people like us is this way, every time I click a link, I don't have to re-log in, re-log in, re-log in, because the cookie allows that website, like Facebook, to remember I already logged in a few minutes ago. So cookies, in general, are a good thing. They improve the user experience. But if these various websites are sending these cookies without this thing called encryption, without hiding or scrambling the information in a way that keeps it from prying eyes, well, these cookies can be stolen. And they can be stolen increasingly easy because so many of us use wireless, aka Wi-Fi, whether you're at Starbucks or at work or even at home. And so we'll find that if you're not using also an encrypted wireless connection, whereby it's using a password or something to encrypt all of your zeros and ones, you're just logged into Starbucks or the airport. There's so many places these days, maybe even your own homes, where your internet traffic is not, in fact, encrypted. Anyone who's heard about Firesheep or tools like it can download that free software, click, click, click, and in a few minutes, log into all of our Facebook accounts and start posting on our walls or sending people messages that can take control of our account. And Facebook is not the only site vulnerable to this. They are just one of the most popular ones, but this all reduces to people one. The fact that this happens to people still in the month since is one, as the number of hands that didn't go up suggests, most people don't know this is possible. Most people don't know how to defend themselves. And so here too, one of the goals of the course is going to be on the one hand, educate and maybe even scare a little bit, but then also ideally provide some concrete solutions so that you can defend yourself against these threats. If you'd rather not go two months vulnerable with your Facebook accounts and the like since you use Starbucks every day, you can email us at help at computer science one dot net. It'll be a great way of breaking the ice. We'll send you some links to tools that you can use to protect yourself in the meantime before we really dive into the technical explanation as to what's going on there. But toward the tail end of the semester, you'll see that we leverage our understanding of the internet and computers and security and actually have you get your hands dirty with a language called HTML, which is the language that web pages are written in. So if you've never designed a website before for the course's final project, will you make your own home on the internet using the various skills that we'll introduce in the time leading up to that? And we'll also conclude the course with a look at proper programming. So making a website isn't necessarily quote unquote programming, it depends on what the website actually does. So we'll actually introduce the notion of writing software. We'll use a fairly user friendly language that's fairly graphical and makes things very conceptually easy because we'll only spend a week on it. And you can spend an entire semester or a year learning how to program. But by the end of the semester, you'll have a pretty well-rounded sense of what people you know at work actually do for a living and how their world functions. And you'll much better understand your own world as a user of all of these technologies. So the course will have sections as well. And let me, the sections are optional opportunities to meet in a more intimate environment with the course's teaching fellow and review concepts that perhaps Dan or I didn't quite deliver as eloquently as we might, or to go off in different directions and ask questions that you didn't feel comfortable asking in lecture or would like more information on. And those will be generally after class, not tonight, since we'd be springing this on you otherwise, but moving forward. And they'll also be videotaped so that if you need to take off, you may. This is probably a good time to introduce my colleague, Dan Armandaras and Rose Kowth. You guys would like to say hello. Hi everyone. So I am the other co-lecturer of this course. My name is Dan Armandaras. I'll be joining you in a few weeks when we start talking about the internet. So for now, this is just sort of a wave, say hello, and then disappear for a couple of weeks. But I'm really looking forward to that. And who will be leading our sections is Rose. So that's Rose over there. Okay. That was it. Hi. Okay. Sections will be more lively. I needed another second there. Okay. No, no, that's fine, that's fine. Okay, so what to expect then in terms of the course's expectations. So homework will be an opportunity to reinforce some of the topics we discuss in class, but also to go off in directions of additional detail. So you'll see over time that we'll post, we'll link via the course's website, something called a blog. So blogs are sort of a dime a dozen these days, but it will allow us in the class for each of you to post some topic on a somewhat weekly basis of some article you read that's of interest in the world of computing and technology, an article that perhaps you just didn't understand and you'd like to post it and share and understand exactly what it is that you're reading about. But what you'll find as the semester progresses, odds are, that just more and more of these magazines you see on various shelves and more and more of the links you see on cnn.com under the technology section in Google News start to make a lot more sense and you'll realize that you'll understand one or more pieces of additional jargon and even if you don't quite understand everything they're talking about, it at least doesn't seem like it's some topic completely over your head. And so this will be an opportunity for us to direct you to various resources. We'll provide very specific instructions as to how to find such articles and how to make comments on them and such. And then to compliment that, will we also introduce the notion of a Wiki. So it turns out that the course's website is actually driven by free software called MediaWiki. MediaWiki is the free software that runs some popular website called, yeah, so called Wikipedia. So Wikipedia, most of you have probably used in some form and it is mostly the result of a huge volunteer effort, but the software they use that runs their website is called MediaWiki and anyone can download it. And we downloaded it because specifically, even though Dan and Rose and I will occasionally update certain parts of the website ourselves, we also want to empower the class to update and create pages. And so what we'll begin to do over the course of the semester is build out a corpus of articles, a glossary of sorts, on the various pieces of technology and computing that we discussed in the course so that you might be assigned one week the notion of compact flash memory. And you'll have this opportunity then to explore yourself on the internet, on the real Wikipedia, on various websites that will direct you to so that you can read up for a bit, wrap your mind around what exactly compact flash memory is and why I should care and then write one or two paragraphs about it for the class's purposes in words that you and your family and your classmates would understand. A lot of the downsides of various resources out there, including Wikipedia, is that they just dive in way too deep, way too fast, and they're written by people who don't necessarily write for a broad non-technical audience. And so the target of this glossary of the E1 Wiki will really be to talk amongst ourselves at that comfortable level where you just say what you mean and you don't blow the technology up to be much more than it actually is. There will be two exams and the exams are really the course's opportunity to assess one's comfort with the concepts that we introduced in the course. For instance, we won't ask you something silly like what does ASCII stand for, but we would ask you something like what is ASCII used for or the who cares question and we'll make available some sample questions from past year's exams, but you'll find that exams specifically focus on the sorts of questions and the topics that we explore in lectures and in sections. The final project, as I mentioned, will be your opportunity to really get your hands dirty making your own websites. So that will be the culmination of the course and then a mention of books. So the course does not have any required textbooks. In fact, this is for two reasons. One, there's so much freely available information out there and as the semester progresses, we will point you towards some of the resources we tend to think are best and freely available on the web. Wikipedia being just one of them, but there's many others we will point you toward over time. Two, textbooks are ridiculously expensive. Some of these books new are like $100 which is way more than one should have to spend for this kind of information. So realize that if you look up these books on amazon.com via the ISBNs that are in the syllabus, realize that a used version is frankly a viable way to go. There's Grossman Library in Harvard Yard that mention of it is in the syllabus as well. And you're welcome to go to the coop or buy these things new online, but just realize it's not an expectation and you are not going to suffer if you don't have the required books. But if you are the type of learner who appreciates sort of the comfort of having a book and being able to walk yourself through related material, realize that if the course were to have sort of a official unofficial textbook, it'd probably be this first one. It's horrible title, Computers Are Your Future. It couldn't sound less appealing or more sort of cheesy, but it actually is a decent text that covers a little bit of everything and it's the closest thing to sort of a proper textbook that you might find. These two frankly are actually wonderful texts and they're much more reasonably priced and can certainly be found used. These really are two page, four page spreads about how this works, how that works. And it says it with pictures and with brief texts and frankly they're two of my favorite books just to introduce especially to non-technical friends and family because they really just get to the point and offer just enough detail to wet your appetite without completely sort of numbing the mind. And lastly as we approach the web aspect of the course if you're the type who again would like the additional support from an actual text, this last one here is a good one for actual webpage design but realize none of these are prerequisite by any means. Any questions? All right, why don't we go ahead and take a five minute break. There are restrooms upstairs and folks to chat with to your sides and we'll resume with an in-depth look at some more consumer-oriented hardware aspects. All right, so we are back. So first now that it's sunk in perhaps any questions? Any questions at all? Yes? Okay, so good question. So if you don't need all eight bits for instance because you only need the first four or the first six as we saw in one of our examples, why not just use those four or those six from the get-go when you save the file? So short answer is that actually is possible. The right software, the right programs will in fact compress the files you're saving when you go to file save as but that's more often a manual process for a couple of reasons. One, when you compress information there's rarely anything in the computer world that you get for free. And so if you're gonna compress something to save space you gotta spend something to get that savings and generally you're gonna spend time. Not necessarily the human's time but the computer's time the CPU's time as we'll discuss in just a bit. So transforming more bytes into fewer bits takes the thinking of the computer and this is not always a performance trade-off people wanna make. To put this in more real terms if you've ever zipped up a file or compressed a file you might see a progress bar, progress bar, progress bar because it takes some thinking to do that. The other answer is that it's not quite as simple as only using four bits or only using six bits because if you for each file you save come up with kind of an arbitrary encoding for your data four bits here, six bits here you need to know what encoding you used so that you can then uncompress that information and figure out what numbers or letters are really being represented there. So the sort of hidden character in this story is that when you compress information you generally have to remember how you compress that information which bytes are four bits, which bytes are six bits and storing that memory of what map to what itself takes space. So especially for small files generally the amount of information required to remember how you compress the information can overwhelm the savings that you actually get. And part of it too frankly is that disk is cheap these days and we'll start talking about this tonight and next week but these days many of you probably have 500 gigabyte hard drives, one terabyte hard drives, two terabyte hard drives and so increasingly does the world just kind of who cares, it's not worth it disks are getting bigger and bigger. The downside of course is that computers are getting more and more bloated. If you download, if you install something like Microsoft Office these days it doesn't come on floppy disks anymore certainly. It doesn't even come on CDs anymore, it comes on DVDs and so unfortunately a lot of these factors in industry that are good for the consumer, more disk, more RAM and cheaper generally means that a little less regard is given to some of the very reasonable ideas you just put forth. It's just cause the hardware is not making us think so hard. So a few different answers there but it's absolutely possible and it is done by some tools automatically. Other questions. All right so let's put, I took for granted a moment ago what a gigabyte is, what a megabyte is so let's just toss out a couple of building blocks that we can then take for granted. We started tonight with this notion of a bit which is a single piece of information. In the real world it might be hands up, hands down might be flashlight on, flashlight off. In a computer it's probably some kind of electricity there or not there. Any means of encoding yes or no, true or false one or zero can encode this notion of a bit. But again one bit pretty useless unto itself so we need at least a few of them. How about eight as an arbitrary denomination? So there's this notion of a byte which is, quick sanity check? Eight bits, eight bits. Now a byte not all that useful cause we've seen you can pretty much just represent one alphabetical letter even to write a normal email or quick IM you need multiple bytes and so we generally don't talk in units of bytes we generally start maybe at kilobyte where kilo tends to denote a thousand so a kilobyte is roughly 1,000 bytes and I say roughly because the world being a bit geeky generally interprets kilobyte to be in 1,024 bytes not 1,000 bytes. The reason being kilo rather the reason being 10, 1,024 is a power of two it's a multiple of two actually it's a power of two which tends to be a good thing eight is a power of two two to the three is eight two to the 10 is 1,024 so for lower level technical reasons talking in terms of powers of two tends to be useful so that's what the world does. Now as an aside this actually kinda starts to explain your experience perhaps in the store when you feel you've been shortchanged when you buy like a gigabyte USB stick and it only has like 900 megabytes available to you when you plug it into your computer if you've ever bought something that's branded as being a big number and you plug it in and it's slightly smaller than was advertised it's because the manufacturers for instance are advertising it with the notion of a thousand because kilo does kinda mean in the metric system 1,000 but your computer usually interprets sizes in terms of 1,024 so if you start dividing things by 1,024 and not by a thousand it's not a huge difference but you do it again and again and again and when you start talking about big storage spaces big USB sticks well you start to feel shortchanged because the math works out to be 900 megabytes and not one gigabyte so long story short that's the explanation there Apple did recently change their direction where they compute numbers in a manner more consistent with advertisers for better or for worse so it's even different across Macs and PCs for no compelling reason but they are trying to trick you frankly in marketing terms with that so where do we go from kilo because even there, kilobyte let's put this in context when you save a Microsoft Word document with an essay if it's got a few thousand characters each character is a byte so that's a few thousand bytes so it's a few kilobytes a typical Word document maybe 10 kilobytes, 50 kilobytes, 100 kilobytes if it's a really long document with lots of pictures and charts maybe it's a megabyte and so megabyte mega meaning roughly million so one megabyte is one million bytes now who cares about megabytes well if you have a really big Microsoft Word document it could get up there although it's starting to feel a little bloated your essay but perhaps more familiar literally like an MP3 if you've ever downloaded a song file from iTunes or legally or from wherever it's probably about three megabytes 10 megabytes just to give you sort of a useful rule of thumb there so that's a few million bytes to actually encode a three minute song or so so roughly one megabyte per minute is not an unreasonable comparison for music so something along those lines what comes after megabyte? Gigabyte, all right so giga, it's not quite as obvious now but giga means billion so if you have one gigabyte of memory on your USB stick on your key chain or whatnot you have one billion bytes available to you or eight, sorry, one billion bytes available to you or eight billion bits available to you so eight billion bits can fit frankly on these little doohickeys on people's key chains these days and that's a small one I think the one I carry around is 32 gigabytes which is even more zeros and ones possibly stored on that little device so giga tends to be the unit of measure for not just like USB sticks to clarify if you don't know what a USB stick is you probably know generally that a hard drive is the device inside your computer where data is stored where your files get stored well USB sticks contain not a hard drive per se but something called flash memory it doesn't have moving parts there's nothing spinning as we'll see perhaps this week or next inside of it it's just sort of electrical signals that store your information well you can store these things now on devices as small as your key chains on these little USB things that you plug into your computer and it's called a stick because it looks like a stick and you stick it into the computer but it can store zeros and ones in this way but your hard drives these days so your laptop, your desktop computer again anyone know offhand how big your hard drive is in your laptop or desktop let's just get some actual normal people answers 250 gigs 256 gigs other answers 380 gigs, okay anyone above 500 what's that? 512 gigabytes, yeah so that's pretty much the norm these days for computers like several hundred gigabytes and once you really start needing space which is increasingly common you start talking about terabytes terra being trillion bytes so now this is getting to be a lot of bytes who in the world would need a one terabyte drive that's twice as big as a 500 gigabyte drive so each of these is a factor of 1000 bigger than the previous why in the world would you want to spend $100 for a one terabyte drive? so servers, potentially servers we'll talk later in the term in the context of websites so Facebook and all these websites need servers computers that live in secure rooms that need hard drives because they have lots of web pages on them lots of HTML so servers might use them so pictures so yeah you might take digital photos these days and even though a few years ago your digital photo might have been a few hundred kilobytes even a pretty photo well these days if you have more and more megapixels so to speak you're using more and more megabytes or at least bytes to store that image so you could have a photograph that's many megabytes in size because you're storing as much possible information there what's even scarier than photos when it comes to disk space? so video, right? this is not that uncommon, right? a few years ago really the only people downloading lots of videos were probably legally downloaded videos and the like but increasingly when you have consumer-grade devices and tools like iTunes and the like that just let you with a click-click download some piece of software to your TV or download some movie to your TV or to your computer it needs to be stored somewhere and a typical movie can run how many bytes? would you say a two-hour movie? what's that? yeah it can be as big as eight gigabytes which is bigger than a lot of our hard drives were just a few years ago to be honest even one of these lectures if we film a two-hour lecture we don't shoot it with fancy surround sound and huge 3D graphics or anything fancy like that but even a two-hour lecture in this course can cost us 300, 500 megabytes can fill a CD or that's half a gigabyte you can only fit so many of those on for instance a one gigabyte USB stick maybe one lecture, maybe two lectures on a USB stick so the interesting thing is technology has gotten more consumer-friendly and more interesting technologically we're starting to spend more and more bytes on this and so many of us will in just a year or so probably have in your next computer frankly if it's not a laptop but probably a desktop will probably not unlikely have a one terabyte 1.5 terabyte, two terabytes hard drive in it and bigger than that is on the horizon I'm sure because if you think of it too it's one thing to rent a movie that's like eight gigabytes or multiple gigabytes but what if you actually want to buy that movie for $19.99 on iTunes or whatever well you need to store that and so let's round up just for simplicity so it's 10 gigabytes well as soon as you get 10 movies that's 100 gigabytes that's half the size of some of your hard drives already if you download 20 if you want to start keeping around the things you're paying for you need more disk space but here's another sort of challenge to wrap your mind around that we'll revisit next week too well it's one thing to get that terabyte drive and store all of your data but what about your backups you've all been kind of preached at by someone in life probably probably after a disaster when you lose something important back up, be back up your data well backing up your data kind of means buying two of whatever it is you have and if experience I've been going through with my family lately as we've been trying to convert our old VHS and high eight tapes to a computer format and it's one thing to fit those on like my mom's hard drive but if we want to back them up now we have to shell out more money for a second hard drive that's even bigger to store the backups of that data so increasingly will there be pressures I think financially on consumers to kind of figure out is it really worth buying this movie and that one at least when you rent something for better or for worse they take it away after a day or so but again all these basic building blocks we started here and here we have avatar on our hard drives it's using the same fundamental unit of measure so we can keep going beyond that petabyte, there's even bigger bytes but this will keep us going for at least another year or two these units of measures, any questions? All right so let's tell them the full story when you boot up your computer if it's a PC you might see a little something like this this image here is a little dated a lot of computers these days have kind of sexed up their boot up processes where you see a pretty picture or the globe or something that's a little less arcane and useless looking than this but this is representative of a lot of PCs that you might have seen for years on your desktop and even today frankly to some extent if you buy a Dell computer you'll at some point still see something that looks a little something like this so what is this screen doing for us what is this all about? Anyone know? Yeah so this is the BIOS this is the so-called POST P-O-S-T power on self-test and most computers do do this and if you watch it carefully that acronym kind of makes sense power on self-test you might recall from PCs that a number gets incremented from zero on to some big value where the computer is essentially counting your RAM well it's not just counting the RAM what it's probably doing is writing some zeros and ones to a type of memory called RAM then reading it back and making sure what it put there is actually still there because if they don't match just means something's broken if you what you put somewhere is not there when you go back and check it there's actually a problem so for quick definitions for now let me define the following a hard drive which you're probably conceptually familiar with is kind of long term permanent storage if you turn off your computer or pull the plug anything stored on your hard drive should be there the next day your videos, your essays, your emails if they're stored locally hard drive is a so-called persistent or non-volatile storage which is just a fancy way of saying it's permanent, permanent so long as nothing breaks RAM by contrast is volatile storage and this is just a fancy way of saying it needs electricity to keep the contents in it so RAM is useful though as a quick teaser when you double click a program on your desktop like Microsoft Word or Internet Explorer or whatever when it boots up and starts running it doesn't stay on your hard drive those zeros and ones that you installed for that program are loaded into a different type of memory called RAM because RAM is faster it's purely electrical whereas a hard drive generally though decreasingly so is mechanical and there's actually something spinning inside and anytime there's movement in a computer it's probably one of the slower parts these days because electricity, you know sort of speed of light kind of speeds even though that's an overstatement but it's much faster than anything human made that's mechanical so with that said we have two types of memory for discussion now hard drives where you store stuff long term tends to be in the like gigabytes maybe even terabyte range and then you have RAM which just as a real world data point how much RAM do folks here have in their computer if you know two gigabytes is not uncommon maybe even just 512 or so megabytes so on the on the lower end of things four gigabytes sometimes in newer computers but generally single digits in the gigabytes whereas hard disks are like triple digits 200, 300, 900 or even the terabyte so single digit gigabytes is reasonable these days for RAM and then triple digits for gigabytes for hard disk space so it's so to speak an order of magnitude bigger hard disks so with those basic building blocks let's return to the power on self-test when you boot up a typical computer it's doing you a service it's checking all the innards making sure that everything is working it also does some slightly stupid things but compelling like check if there's a keyboard connected and check that there's a mouse connected because if there aren't you know odds are you're not gonna be able to do much of use with the computer although servers frankly don't need these devices which makes it not always necessary these tests the long story short you see this arcane interface and the computer is executing what's generally known as its BIOS basic input output system and I'll pause on that one just cause it's kind of been with us for 20 plus years but BIOS, B-I-O-S basic input output system and this thing exists to kind of solve the chicken and the egg problem because when you buy a computer or buy a new hard drive and comes with nothing on it you need to be able to turn it on and then boot into your familiar Mac OS or Windows or Linux or whatever it is you happen to run but if you put a new hard drive in or buy a brand new computer that doesn't come with an operating system there's gotta be some very low level functionality built into that device so that it can find an operating system if you've installed one and then essentially hand control of the computer off to that operating system so the BIOS comes burned into this thing called a motherboard which we'll look at in a moment it's literally in a piece of hardware inside of the computer and it does very basic things it counts, it checks your RAM checks for keyboard and mouse and it knows how to hand control again to an operating system who can then do more interesting functionality like that it's basic in that it's basic visually in that this really is fancy right you consider Windows 7, Vista, Mac OS this is really an underwhelming graphical user interface at the moment but that's because it just does the basic building blocks it gets some basic text onto the screen now as an aside if you do own a PC you'll probably see some mention like hit delete DEL for setup hit F2 for setup it's always a different key on different keyboards but if you ever hit that key you'll probably see a fairly arcane interface that lets you change very simple things like the date and time tell the computer how many hard drives are connected things that generally a consumer doesn't need to and might not even want to touch but if you decide to add a hard drive to your computer you might need to dive in there if um I mean to be honest there aren't that many reasons these days if you want to configure your computer to boot up after you lose power in an electrical storm that setting is often somewhere there in the so-called BIOS or CMOS settings but long story short if you have a PC a good at home exercise this week would be hit that key that you've been ignoring for years delete or F2 or whatever and see what happens now I might not hit the arrow keys and hit enter all that many times I'd hit escape it when you're ready to quit and say no to saving changes um but you'll probably see some stuff um much like I just described and it's not something you need to touch all that often but then controls handed off to the operating system so an operating system as we'll see in movie night in two weeks time is the piece of software that essentially is the interface between human and machine so it's the operating system that knows to show you a nice graphical user interface aka GUI GUI it shows you menus and icons it sits there with a blinking prompt waiting for input from you it's the operating system too that knows how to talk to hardware that's connected to your computer when you buy that brand new printer and you have to unwrap the CD and install the software on that CD are generally things called drivers which is just software that you install but that software teaches essentially the operating system how to talk to this new device a device that might not have existed on earth when Microsoft or Apple shipped that operating system with that computer and so drivers allow computers to talk to new devices and PCs generally do have to install drivers manually like this Macs tend to, because Apple controls more of the market tend to work without this manual process but that's drivers helping the operating system learn or talk to new pieces of hardware so we have this abstract idea of an operating system that's the thing I interact with well what's really going on underneath the hood at that point well we mentioned a moment ago that there's this notion of a CPU so in sort of layman's terms a CPU really is the brains of the computer all of those zeros and ones we discussed earlier at the end of the day get funneled through the CPU for anything interesting to happen for math to happen for characters to get shown for programs to get run when you double click them it's really the CPU that makes all of that happen and as an aside it really reduces to fascinatingly simple operations we won't dive into detail on this but a CPU pretty much only understands commands like add, subtract, multiply, divide, load from memory save to memory and very low level building blocks like that and it's from those building blocks again we get today's modern programs and websites and more but we'll take for granted that this thing called the CPU the brains of the computer can make all of that happen well let's make this more concrete what does this thing look like here's an example of a CPU that's very much in vogue these days this is Intel's Core 2 Duo there's different branding names frankly Intel has been among the better companies and actually making people care what their CPUs are called if you ever heard the expression Intel inside that was their marketing campaign that was just trying to emphasize to the world that inside your PC and nowadays Max is an Intel product to a typical person this doesn't matter so much partly because Intel is inside almost every consumer computer today especially since Apple a few years ago switched to Intel's hardware but there are competitors and the geeks out there who might build their own PCs not by going to Dell.com but by buying apart from this place and apart from this place you might care a bit more about the type of CPU going into your computer if you're running servers for a company you might care a bit more about the CPU in your computer but for consumers generally it suffices to read some reviews as to performance and generally what the world will do is when a new CPU comes out you don't generally have to care about like how many transistors it has or low level details like that you just need to be cognizant of at least a few details and one of them is the speed of a CPU so what unit of measure is used to measure a CPU speed? Yeah so gigahertz so gigahertz abbreviated capital GH and then lower KZ is actually a pretty simple unit of measure hertz just means one per second one something per second gigahertz means a billion somethings per second now what does this really mean? Well all of these very low level operations that a CPU understands add, subtract, load, save all these very boring details you can think of each of them as taking some unit of time like a stroke of the clock like the second hand ticking on a clock something like that now in reality they happen super fast way faster than a clock on the wall but if you think of a CPU is having a little crystal inside of it a crystal that just oscillates terribly fast billions of times potentially per second every time that crystal oscillates the computer, the CPU can get something done it can do an addition it can do a subtraction and that's a bit of an oversimplification but that's where this unit of measure comes from a gigahertz one billion things per second means it can do one billion arithmetic operations per second it can add a billion numbers together like that in just one second so it's really fast now what are the orders of magnitude we care about? well these days you actually tend to get computers that are like 1.0 gigahertz, maybe 2.0 gigahertz you can get up as high as 3.0 gigahertz so low single digits right now is where CPU speeds are at in general faster is better but the catch is in where the marketers try to trip folks up is that it's not the only unit of measure you can have a brand new computer on the shelf that you're deciding between that's let's say 1.5 gigahertz and another that's 1.3 gigahertz and you know what? Which one can be faster? 1.3 gigahertz one can be markedly faster because it really depends on what else is in the computer and what you choose to do with it so this is why I say reading some reviews and we'll talk more about this next week too with a very consumer centric focus if you're the type of user who just like checks your email and writes word documents, frankly you don't really need a super fast computer you're the limiting factor the human who can only click double click so fast to be honest right you are much, you cannot do one billion things per second most likely so having additional point something or other gigahertz isn't really gonna speed up your experience with the computer but if you're a graphic design person or a movie maker and you're using fancy tools like Photoshop or Final Cut Pro, movie anything that's graphically intensive or interesting you actually might notice the difference between 1.3 and 1.5 gigahertz and it might actually affect you if you're a gamer and you're playing the latest and greatest $50 game well having a slightly faster CPU or actually graphics card piece of hardware dedicated to fancy graphics that actually might make the difference but if nothing else today realize that for typical uses which most of us are checking email, word doing some normal people things generally you don't need to be upsold that additional amount but what are some of the other details that matter well the CPU is only one aspect of what's going on inside of a computer and we can kind of draw a picture like this and I'm gonna leave some space so that I can fill it in as we go but if this is the CPU and it's through that guy that ultimately all the bits must flow for anything interesting to happen for any programs to run or files to be saved well the CPU actually has very limited memory it might have a megabyte of storage space inside of it, terribly little memory because it only works on frankly like 64 bits at a time I mentioned to this notion of a 64 bit computer earlier that just means that when a CPU adds two numbers together this number uses 64 bits this number uses 64 bits and that's it now even though your files might be several kilobytes or megabytes they're still only fed in as needed in little portions essentially so we need to store more interesting data elsewhere so we're gonna call this RAM and I gave a quick definition of that earlier this stands for a random access memory but this is one of the two terms that people often mean when they say how much memory does your computer have to be honest and after tonight that's really not a sufficiently detailed question for anyone to answer when someone asks you how much memory do you have it could mean RAM it could mean hard disk because those are both types of memory it's just one is permanent or non-volatile one is ephemeral, one is volatile it goes away when you turn off the power now generally most people think that when you say how much memory does your computer have they almost always mean RAM to be honest but realize that it's not necessarily the case because in just a moment we're gonna see four different types of memory that a computer has actually five if you count what's inside the CPU so here too there's distinctions that are not often made so who cares about RAM though well again RAM is where files and where programs end up after you've double clicked them when you're working on them when you're writing that essay when you're running some program those bits are no longer stored only on the hard drive they are copied to gonna do HDD for hard disk drive they are stored temporarily in RAM for a couple of reasons one, it's faster and two, well two is faster, same reason so RAM is faster so you might have again let's say 500 gigabytes for hard disk space but again for RAM you might have single digits two gigabytes so this is the curiosity RAM is faster disk is slower and yet you have more of the slow stuff what might explain this sort of paradox why do you want more of the slow stuff so that's quite true you don't need to be looking at everything on your computer at once you might want to look at one essay or run a couple programs but odds are you're not going through your applications folder or your program files folder and double clicking every possible icon running them all at once so just in real terms you don't need all of those things there all fast forward to there's kind of a bottleneck in the CPU anyway so it doesn't matter how big your hard disk is it's still gonna get funneled into a smaller sort of pipeline here that's another reason and there's at least a third why do you have less RAM intense over here, yeah perfect, yeah so it's expensive it's pricier per gigabyte you will pay more for RAM than you will for hard disk space and two, you can't really buy 500 gigabytes of RAM and put it in your computer the max these days is it's actually high maybe 128, 256 but for a server but for all of us two gigabytes, four gigabytes maybe eight gigabytes in a desktop computer maybe 16 or 32 but 500 it's crazy talk still at least for the consumer market so you just can't have that much but that's okay because you can't possibly be doing that much at once at least if you are the limiting factor you the human, yeah of active parts in what sense so that's quite true too if you imagine what you're really doing after you've double clicked a word document and you opened it and you're editing it odds are you're doing things like control F and searching for text and if searching essentially requires looking at the document from top to bottom you'd kinda like that to be as fast as possible and so you'd like that to be in RAM not necessarily in your hard disk space but when you go to sleep for the night I mean who cares how fast it is it can get saved there permanently so there's a number of reasons here but even for years even though all of these numbers we're discussing today frankly will be out of date in six months, 12 months, certainly a couple of years they generally just keep getting bigger with respect to one another but once we get down here and don't quite draw this part of the picture yet because we're gonna fill in the middle in a moment all of this is going essentially from big and slow to smaller and faster and that's sort of the pipeline that's involved here so double click a program on your hard drive it gets loaded into RAM but for stuff to actually happen for the computer to actually respond to your keystrokes and respond to your mouse clicks there's stuff going on and bits flowing through the CPU here but it's not the only type of RAM it turns out two and you can actually see this in some of the marketing literature if you're in the market for a new PC there's also something called L2 cache and also something called L1 cache which are other types of memory L1 is level one, L2 is level two there are smaller types of memory that are even more expensive but in smaller quantities but faster so really the trend continues the closer you get to the CPU the faster the amount of memory the faster the memory is getting but the smaller quantities it's getting and this is actually for technical reasons is an efficiency thing if you want to make sure that the CPU always has something to do you essentially want to make sure that the people standing right next to him are the fastest people in the lineup just feeding bits and bits and bits it's fine if the people down at that end of the line are a little slower because so long as they're getting us enough we can sort of store up enough megabytes or kilobytes of bits so that the CPU always has something to do so in practice it's actually not a problem that it's going from big to small in this way now which to care about hard disk space when you're buying you should care about this why well more hard disk space means more movies and more songs and more documents and more room for backup so generally good things from consumers RAM more tends to be better but why what can you do if you have more RAM do you think more stuff but be a little more precise more functions at the same time so every time you double click some file or double click some program to open it again it's being loaded essentially from hard drive to ram or at least the parts of it that you need to use are loaded into ram many of us most of us probably run multiple programs at once you've got like a well instant messenger you've got microsoft word you've got excel you've got safari or firefox or whatever you got all these icons somewhere on your display and you're running multiple computer programs simultaneously now the white lie there is that you're not actually running those uh... programs simultaneously it's just you're so slow versus the computer which is so fast the computer's creating the illusion of all these things happening at once because at the end of the day if you take off the hood of the computer there's just this one cpu usually maybe these days to cps or to course as they're called but really there's very few brains inside of this computer and so you generally run five six ten programs at once what's really happening well when you have speeds of a billion something or others per second that means the computer can run microsoft word and execute its bits it can read and write its bits you know for a half split second then do the same for a while instant messenger then do the same for safari then do the same for firefox then do the same for your email all within the span of the second and even though a little happened here here here here we the humans is one second at all happened at once so far as i can tell and so far as i care and so there's this notion a computer doing multiple things at once but it really is an illusion at the end of the day only one thing is being used by the cpu at once or in fancy computers two things but it's really us that just don't realize even though we benefit from this this multi-tasking if you will care about ram sure cuz the more ram you have frankly the more programs you can have open at once is this necessary well it's just annoying if you have to start quitting programs it can speed up your computer for the following reason though if you have relatively little ram let's say five hundred megabytes and you're running something like photoshop which is very which is a graphics program which is very memory hungry the computers these days on our desk windows and macOS offer something called virtual memory and this is kind of a secret feature for the most part but if windows or macOS realizes that this this file's really taking up too much space and you really want to foreground this other program what it will do is secretly move stuff that is in ram to a separate part of the hard drive it will just have as its own sort of scratch space so to speak it will move those bits from ram to hard disk without telling you so that it can free up space in ram for that thing that you actually have in front of all of your windows so if you've ever noticed that clicking this icon to make this window go to the background in this one to the foreground it's kind of painful kind of feels like something is lagging there there's a little bit of a latency that's most likely because one of those programs that's in the background temporarily got booted and put on hard disk space unbeknownst to you virtual memory so to speak and the reason it's taking a split second maybe even a couple seconds to come back to the foreground for you because the computer has to secretly copy all those bits back into ram and move that other program you're putting to the background into the hard disk now having more ram essentially allows you to avoid that otherwise very tedious process so these days frankly one of the best things you can probably put what your money toward when buying a new computer probably not so much more gigahertz maybe more disk space but really more ram tends to give you the most pleasurable experience interactively because it means the computer can just give the illusion of doing yet more at once l2 cache l1 cache you'll often see these on the little stickers at the store and we'll see when we actually look at some consumer-oriented websites you'll see these numbers quoted generally they are tied to the cpu so you don't want to go into a store next week and say i'd like a computer with uh... more l2 cache please like doesn't really work that way it comes pretty tied to the cpu unless you're say building your computer where you really want to care about these numbers but in general more is better but generally it's not just one factor so when i said earlier that that one point three gigahertz computer could be faster than the one point five gigahertz computer why might that be well might be that the seemingly slower computer the one point three gigahertz maybe it has more ram which means you can do more at once which means you the human actually just don't feel so many delays might have more l2 and or l1 cache which even though it's a lower level detail can still help the cpu by just having it more bits ready and waiting for it but then two some cpus are optimized for certain types of operations so that if you're playing games or using photoshop sometimes one cpu might in fact be better than the other so at the end of the day besides just reading labels you'll find that actually reading a review where some techie people actually spent a few minutes or hours running photoshop on this computer and running photoshop on that computer and then tells you well to render some big fancy graphic on this computer took a minute on this one took a minute and a half maybe you decide based on real world time and not necessarily based on these low-level details so we just scratch the surface here and what we'll do next week is start to peel back some of these layers of hardware you might remember this guy here willy-willy which has a whole bunch of magnetic particles with which you can give them uh... eyebrows and hair and mustache and beard and so forth well these magnetic particles are not unlike what is actually found in today's hard drives and in yesteryear's floppy disk so in fact as the climax for today i'll take um... yesteryear's floppy disk which if you're still using by the end of the semester we should really get you off of these because they're not very reliable devices but does anyone recall how much space fits on a floppy? yeah so one point it's like a little over one point four four megabytes so if you consider your one gigabyte usb stick these days this is like a thousand floppy disks on your keychain roughly so if you look inside of one of these things as we will do essentially through videos next week cheap plastic and felt cheap plastic and felt this is the floppy drive that all of us use for many years there's a piece of metal in the middle to give it some rigor so it can spin but this is the so-called floppy part of the disk and what's essentially on here are even smaller magnetical magnetic particles than these that is we'll see next week to represent a zero might be oriented say north south like this up down but to represent a one might be flipped south north like this so we even using this very cheap primitive technology can we embody the same ideas of zeros and one so dan rose and i will stay around for one on one questions otherwise we will see you next week