Welcome to Computer Science E1, Understanding Computers in the Internet. My name is David Mainland. This is Lecture 1 Hardware. We're going to begin tonight with Woolly Woolly. A very gentle introduction, if you will, to Computers in the Internet. And the relevance is to these floppy disks that hopefully each of you has one, having come in the door earlier. So on this disk is presumably data. Back in the day, this is where we all save documents and where some of you may still be saving documents. But if you stop to wonder what is actually inside of this floppy disk, how in fact the data is being saved? Well, believe it or not, it's not too dissimilar to how Woolly Woolly works there. How does Woolly Woolly work? Okay, so it's magnetic. This was a toy that I had, at least when I was a kid, where if you lie it down flat after shaking it around a bit, so that all these little black, tiny magnetic particles fall to the bottom, you then take a little pin that is but a magnet on the end of it, and then you can draw like a mustache on Woolly. You can give him a little beard, put hair on the top of his head, sort of like this. But the reason that that all works is because the tip of this little pencil was magnetized, and the little particles that comprise his mustache and beard and hair are themselves magnetic particles. Well, it turns out that inside of this so-called floppy disk are particles not unlike those. And in fact, you've probably heard for many years, even if you don't understand it until tonight, that the language that computers speak is what? What is this language that all computers speak? Yeah, binary. And if you're not sure what that means, you probably at least heard that computers use what two numbers a whole lot? Yeah, zeros and ones. Well, it turns out that if you take magnetic particles that are, you know, little hair-like things, and you polarize it such that one end is positive and one end is effectively negative, well, you can represent two things in the world. You can represent something like the number zero, and you can represent the number one. Or similarly, you can represent positive, or you can represent negative simply by flipping that little particle around. If it's this way, it's a one. If it's this way, it's a zero. So what exactly is inside of this floppy disk? In fact, where does it get the name floppy? It's not all that floppy. There's a piece of film inside of this. What are you never supposed to do with these floppies? Okay, take them through the airport. They probably be okay going through the X-ray machines because there's not so much of a magnetic field. What should you not do with these, though? Okay, open it. This is about as open as the floppy disk should ever get. There's a point that this little thing slides and covers things you're not supposed to touch. If you're probably not supposed to do this manually or touch what's inside of it, what else should you not do with a floppy disk? Don't heat it and don't put a strong magnet next to them. In fact, you can destroy your data by accidentally putting this next to something that's particularly magnetic, whether that's an electrical device in your house or literally a magnet sitting on, for instance, the refrigerator. Well, why is that exactly? Well, there is a film in here, a floppy disk, if you will, something that is literally floppy and is only kept in a horizontal position by the plastic coating that makes up the outside of this disk. But how do you think your Microsoft Word documents are stored on that floppy disk inside? Sorry? Particles? Verticals? Vertical in what sense? Yeah, so this is where these woolly woolly particles come in. You have coating the top and the bottom of that floppy disk that's inside of this plastic shell, a whole bunch of those particles, millions of tiny little particles smaller than the ones we use for willy. You can't so much see these particles, but they are there. And when you put a disk like this into a floppy drive like this, what happens is that there's a little magnetic arm, a reading arm similar to a phonograph, a record player that reads those particles and retells the computer, well, that particle is positive. That is, it's a one. Or that particle is negative. That's a zero. And all of those zeroes and ones, as we'll see tonight, ultimately compose your Microsoft Word document. But it's a lot more fun if we look at this at a slightly lower level. So while I take this floppy disk out of the drive, let's go ahead and do what you've never supposed to be doing before and actually slide this thing to the side yourself. Alright? What do you see inside that window? And if you're missing a floppy disk, there's somebody in the window there. Slide that little metal shutter over to the side. And what do you see? There's that plastic film we discussed. So there's that floppy disk. What if you touch it with your pinky? What do you feel? A floppy film. A floppy disk. Well, let's take this one step further. Watch your eyes and certainly those next to you.  But be careful, there's a little spring that tends to fly to the right or to the left. So now there's not so much protecting that little film.  You wiped off some of those particles, or you certainly distorted the alignment of those particles. Well, let's go one step further and actually insert your fingers in that little plastic opening and just crack this thing open in half. Thereby destroying the solution set to this year's exam. But out of this comes the so-called floppy disk. Now how many of these particles are on these floppy disks? How much data do you think you can store on these floppy disks? I heard a lot, and then I heard what here? Lots. So there's lots of particles, but on a higher level. How many megabytes, kilobytes, any of these buzzwords you've heard? How much stuff is on here? Four megabytes. Not quite four. Not quite a hundred. Yeah, 1.44 megabytes of data fit on here. Now we can put that into perspective for tonight's purposes by saying that is like half of an mp3. And an mp3 is like a song file that have become much popularized by Napster and so forth, and you would listen to on your machine. Well, a Microsoft Word document might be 200 kilobytes. In other words, you could probably fit five or seven large Microsoft Word documents on this disk. Now 1.44 megabytes, mega implies millions, as we'll see later tonight. Well, that means there's at least 1.44 million woolly woolly particles on this disk. Again, smaller, we don't see things on this disk, but they are in fact there. Now contrast this just jumping ahead a few years, decades, this is a hard drive. Inside of every one of your computers is most likely one of these. How big is this hard drive do you think? Sorry? Thirty what gigabytes? Yeah, so it's probably about 30 gigabytes. That means there's at least 30 billion of those particles on there. So in order of magnitude more than this, we'll come back to what all these numbers mean so that you can appreciate that all the more. But at the end of the day, all your data is is zeros and ones represented by magnetic particles that are aligned either say this way or that way, ones or zeros. And we'll see now in just a moment exactly how you make up a Microsoft Word document, how you make up your favorite song using just this very basic alphabet of zeros and ones. So this constitutes your first souvenir for tonight. We'll pass around some of this equipment additionally in just a bit, but let's proceed to a very basic question. How does a computer compute? Well, it actually computes quite similarly to how we humans compute, but it does it obviously much faster. Well, out of this discussion of computation, we'll come an understanding of how that data is actually stored on the disk. Well, let's start with this more simple question. How do you represent, how do you count? You a human, how do you count? Okay, so on your fingers, right? One, two, three, four, five. So that's sort of like aligning five particles in say an upward direction, each of which represents one and there's five particles pointing up or positively charged. So we now have the number five. Unfortunately, we humans run out of space fairly quickly and can't perform particularly large computations on our fingers, but computers similarly use fairly limited storage space. But the fact that they only speak zeros and ones allows them to represent, as we'll see, fairly large numbers using only those zeros and ones. Take a look at this, perhaps one of the earliest of computers. This is a what? So this is an abacus and this is essentially a more advanced form of raising your finger to represent the number. Rather you roll a bead upward and different columns in this abacus represent different values, like a one's column, a ten's column, that sort of thing when you learn to grade school math. Well, that in effect is a computer, but tonight's discussion will be a sort of simpler view of this. So we all know to at least some extent what an abacus is. Don't worry about how it actually works because we're going to simplify it. And we're going to say that the abacus that is nearest to a computer in equivalence is something like this. So this is just a little device with a lot of rungs on it going top down and there's these little beads on each of those rungs and we shall say that if that rightmost bead is down, you are representing the number one. If that bead is sorry, if it is down, you're representing the number zero. If you push that bead upwards, that's as though you raised your finger to count one. But we're going to be a little more advanced with the other columns rather than just say to represent the number two, you raised the rightmost two beads. That would be a fairly limited approach because what would the biggest number be if we mirrored the human world and represented numbers by just raising the beads and saying, okay, one, two, three, four, what's the largest value we could count up to here? About 13. One, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen. There's thirteen beads up there. So it's as though we had thirteen fingers, but that's actually quite limited. We can't really count very high and that's a very limited mathematical world if the largest numbers you can represent is a thirteen. We're far from the computers of today. But now let's consider this. Suppose that the rightmost bead, yeah, it still represents a one or a zero. But now let's make the second column, the so-called two's column, which means if you raise that bead, you're incrementing your count by two, or if you leave it down, it's still zero. In the third column, we're going to call that the four's column. If that bead is up, you are adding a value of four to your total count, but if you don't put it up, you're not adding anything, just zero. The next column will be the eighth column. The next column will be the sixteenth column, thirty-two, sixty-four, and so forth. Now with that logic, my question is this, can we represent the number three using this approach? Yeah, so to represent a three, there's no column labeled the three's column, so it's not as simple as just raising one bead in the three's column, but what if we do a combination? Raise the bead in the two's column, raise the bead in the one's column, what is two plus one? Well, it's three. What about the number seven? How would we represent the number seven using this simple abacus? Yeah, so the four's column, the two's column, and the one column would all be up, and every other bead down, four plus two plus one is seven. What's the largest number we could represent with this abacus? Roughly. Yeah, it's close to that. That's pretty good. It's closer to eight thousand. It's close to double the right most column, but we'll see why that is in just a bit. Let's start with a simpler question for now. What number is in fact being represented by the abacus in this configuration? Seven oh five eight? I think that's a little high. Oh, I think I heard the answer. I think it's 1999. You can double-check this map, but notice again that if the beads are down, that means it's a zero. If they're up, that means it's whatever the column is representing. So let's start at the left. We have no four ninety-sixes, no two forty-eighths, but we do have one ten twenty-four, so our total count is ten twenty-four. We're going to add to that five twelve. We're going to add to that two fifty-six plus one twenty-eight plus sixty-four plus eight plus four plus two, and if you add all of that up, you should get nineteen ninety-nine. Nineteen ninety-nine. Okay. Yeah, that's what it's seeming to me too. How did we get nineteen ninety-nine? Nineteen ninety-eight. That's what it is. Thank you. I was forgetting the year in which I did this example the first time. Nineteen ninety-eight, this example was invented. So it's nineteen ninety-eight, but okay, what's the relevance of this? It's a fun little mental exercise if even that, but what's the relevance to what we just talked about? Well, suppose that a computer doesn't use these little beads to represent values, but instead it uses those little magnetic particles. And to represent a bead being down, it simply stores a negatively charged particle, something like this. Whereas if it wants to represent a one, it will store a positively charged particle, something that looks like this. In other words, all you need is something that has two states, a bead that can be up or down, or magnetic particle that can be positive or negative. Or we can go one step further and say, you know what, Harvard Hall 104 is currently representing the number one. Now, the number zero. Why is that? Well, we can use the lights as these binary digits, a zero or one. They have two states, off and on. We'll just arbitrarily say off is zero, on is one. You could certainly say the opposite is true. So how does a computer actually start to store up values? Well, on a floppy disk, it might store a whole bunch of these particles in a row. If you wanted to store any numbers between zero, one, two, and three on a floppy disk, how many magnetic particles would you need? In other words, if you wanted to store, for instance, the answer to a multiple choice test, as we might in a solution set on this disk, you want to be able to store the number one, two, three, or four, a, b, c, or d. Or rather, zero, one, two, or three. Just four different things. How many particles do you need to represent four different things like that? Okay, I heard three and I heard two. What do I hear over here? Three? Eight. Overkill. But we'll get there. It's just two. Because think about it this way. If we had two of these particles, maybe we could have them aligned upwardly. Maybe that's representing a. We could have one up and one down. That could represent b. We could have two down. That could represent c. Or we could have this one, this one down, and this one up. And represent d. Let's move this now away from the world of magnetics and into the world of electricity. Because in fact, all of these devices you hear about today, like the iPod, the Nano, and the Shuffle, and these USB drives, and these are all terms we'll revisit, actually are what's called solid state memory, which means they're not necessarily magnetic, but they do something that's more similar to turning a light on or turning a light off, and leaving it on or leaving it off. Well, with that said, let's change our idea of an abacus or our idea of magnetic particles to light bulbs, switches, on or off. So what is the largest possible value we could represent with eight light bulbs? Henceforth called bits. Anything that can be either on or off, or be in other words a zero or a one, will henceforth be called a bit, a binary digit, by, in binary meaning two, two states. We have eight bits. What's the largest possible value we can represent if we did have eight bits now? Not quite. Not quite one five five. Two five five is the largest possible number. Well, how do we get that? Just turn all these light bulbs on, in other words push all of those beads up, and you get one 28 plus 64 plus 32 dot dot dot 255 in total. Well, let's reinforce this. What does that represent? The light bulb has now gone on. The particle is now positive. Eh, just a one, right? The only thing on is the thing in the ones column. We'll call that a one. What's this? Oh, I heard two and a three. I heard more twos now. Any holdouts on three? It's just two because the twos column is lit, but not the ones column, because remember this is all additive. What's this, though? There's your three. What's this? Four. Four. You've just learned to count in binary. We haven't written out the numbers one, two, three, four. Rather we've written out zero zero zero zero zero zero zero in the top row. All zeroes. We've then written in the second row zero zero zero zero zero zero zero zero one. In the next row zero zero zero zero zero zero zero one zero. And so in the end we've just done zero one one zero one one one zero zero. And it's just convenient to ignore all of the light bulbs that are off to the left because it's just redundant. It's not necessary, but they're there on the overhead. Alright, well what about the relevance now to an actual computing device? We've just said that floppy disks use these magnetic particles. Other devices in the computer world use things that are more like light switches, case in point, a calculator. These things have been around for decades. Little desktop calculators that perform basic arithmetic. Well how does a calculator work? You turn it on now you fill in the blanks. How does it work? Alright, I'll fill in the blanks. You hit a number. You hit the number two. Think about what you probably have never considered before. What just happened when you hit the number two on the calculator? Magnets started to work. They're actually probably aren't magnets in most calculators. They're completely electronic, which is why if you unplug them you usually lose the value that's in them. Whereas a floppy disk retains its alignment. So you push number two. I mean just conceptually, in layman's terms, what's got to be happening? You see constantly now the number two on the screen. What does that imply to you? Okay, it's got to be counting that value somewhere or more to the point it's got to be storing that value somewhere. So let's say for the sake of discussion that inside of a calculator which will redraw roughly as this there's the screen up here and there's all of the buttons down here but underneath those buttons is probably a little circuit board. Some kind of electronic device and some mechanism for storing numbers at least temporarily. Now there aren't little lights most likely in the calculator being represented as in the previous slide but there's something that's storing electricity. Such that if that thing is storing electricity it represents a one and if there's no electricity there it's representing a zero. So I push the number two well let's assume for the sake of argument that we have a very simple calculator the largest numbers that this thing can work with are zero through 255 which means how many bits do I need to install in this calculator? Just the eight bits. In other words I need to have eight light bulbs or the equivalence thereof if I want this calculator to be able to store not only the number two but up to the number 255. Why? Because the biggest number we can represent is by throwing all of those light switches on and turning all of those light bulbs on. So in other words inside underneath the buttons of this calculator is a bit of storage space. That storage space we'll call a register and that register size is eight bits. In conceptual terms there's eight little light bulbs inside this thing called a register but in reality it's just some kind of electronic circuitry a capacitor specifically that's storing an electrical charge and there's eight of those. So one, two, three, four, five, six, seven, eight. Don't worry we're not going to write numbers on top of those but there's eight capacitors or something representing each of those eight bits. So I push the number two what just happened to that register? What just happened to the light bulbs inside of that register? Well not all of them though. Just one of them the second one from the right just as in our earlier example. Now I hit the plus button but let's assume for the sake of argument that the calculator knows how to represent the notion of plus using some other kind of memory. But now I've got to be able to hit the number three. Well hopefully the calculator has another register for me otherwise I'm going to forget the original value. So we've got another eight bits in another register so this is another register. I hit the number three which of the eight light bulbs or equivalents in that register just got turned on and I'm going to be getting three. Not the third one the first two recall. The first two. If it were the third one the biggest number we could represent would be eight and that again would be problematic. So it's just the first two from the right. Again just like our diagram earlier. Now I hit equals. There's probably a third register in there for the answer currently being displayed. We'll draw it here which of its light bulbs just got turned on when I did two plus three equals. First and third. So first and third would imply first, second, third are on. What does this represent? Here's your ones column. Here's your twos. Here's your fours. Is that the number five? Yeah, exactly. So inside this third register would effectively be the number 101 or really eight light bulbs all of which are off except these two. And where are the others? Well again I've just omitted them for the sake of discussion but they're there. They're just zeros. It's like in math class you would probably rarely write this if it suffices to write that. Alright, so binary system. Are you limited to the maximum number of 255 if you use the binary system to count? Clearly your calculator can perform mathematical computations bigger than 255. So what does that imply about its registers? Bigger, what does bigger mean? More bits can be stored. There's more switches inside that can be turned on or off. And let's jump way ahead of ourselves and if I said that a register had 32 bits inside of it, what's the biggest number you could punch into this calculator? Doesn't sound that much bigger, right? 8 bits, 255, 32 bits, I mean how big could that be? It's roughly four billion. By the end of this class if you want to be a real geek you can go home take out an old calculator, try typing in a number and you can sort of reverse engineer exactly how big the storage space is for numbers because at some point it won't let you input more digits either because the screen is too small but more to the point because there's no memory to store the larger numbers. Let's try one last example here with our little light bulbs. What is this? What is this representing top to bottom? Sorry? Good answer. Five registers specifically. Top to bottom. Collectively then top to bottom. What five values are being stored? Clicking for everyone else? 90210. Significance? Beverly Hills specifically. Beverly Hills 90210 the henceforth the zip code when we get to our security lecture that you type into any website that wants to know where you are when you don't want to tell them you need a valid one. One, two, three, four, five. Tens not to work. 90210 does tend to work. In fact I think in AOL instant messenger that is where I'm constantly getting the current weather reports from. 90210 Beverly Hills, California. 90210. Well that's all fine and good but computers obviously do a lot more than store numbers. We can certainly rewrite this slide as zeros and ones just to make it more boring and make it look like we're more technical than we are so far but that's the same idea. We just redrawn things as zeros and ones as we did here but in effect that's what's going on inside of something like a register. Well suffice it to say for now that computers too have registers. In fact they also have something else. There's a brain inside of this calculator.  What is the brains of your computer typically called? The processor we'll come back to this but it's the CPU. The processor that Intel inside, well what does that mean? What's inside? A processor made by Intel. Intel's processors happen to be called what? The Pentium. The Pentium 1, the Pentium 2, the Pentium 4, the Celeron, all these buzzwords that we'll again come back to. But let's now consolidate this all quick little activity. I'm going to give you just about 60 seconds and what we want here is the base 2 representation of each of the base 10 numbers at right. Now I'm making it sound harder than it really is. Base 10 is just decimal, right? Deck meaning 10. The decimal system that we're used to is just the counting number 01234 down to 255 and where I put dot dot dot you can put dot dot dot but on the right hand side we want base 2. What could that possibly be referring to? Yeah, just binaries. In other words I'll get you started. The number 2 under base 10 written in base 2 is going to be 1 0. 1 0. I'll give you one more. The number 4 row in binary in base 2 is going to be 1 0 0. So go ahead and take about 60 seconds and see if you can fill in that chart.  And I will try to coax you along here with a little music. Now go ahead and if you will say hello to at least one of the persons next to you and then look at their answers and see if you can unitedly come up with answers you believe to be perfectly correct. We'll give you one more round. We've reached the end of the theme song which means we'll start off easy. Anyone from this side of the room 0 0 or just 0 or 8 0s depends on how many bits you're using but certainly 1 or 2 suffices. Another softball. 0 1 or just 1. I'll use just to be efficient as few bits on the board as possible. How about 2? Alright, 1 0. We do need the 0 this time because it is significant. 3 4 15. Okay, I heard two different things. Let me hear from this side of the room from which I heard no one. I heard 4 ones here. I heard 4 ones here but I heard something with 0s over there. 1 1 0 0 1. That sounds a little too big. It is in fact why is that? Well this is the 1's column, the 2's 4's and the 8's. So 8 plus 4 is 12 plus 2 is 14 plus 1 is 15. So your number was a little too big. How about 255? It's not as hard as it might sound. 7 ones? 8 ones? It's 8 ones. 1 2 3 4 5 6 7 8. If you don't believe me believe it or not you can check the math yourself. This is the 256 column. This is the 128 column on down. If you add all those up you will get 255. How do you get from 8 ones though representing 255 to 256? It's just 1 and then 8 0s. 1 2 3 4 5 6 7 8. It's as though you added 1 just like in grade school math. It's as though you added 1 to this column but you overflowed so you have to carry then you overflowed. You have to carry, carry, carry, carry. The first place you can actually leave a 1 is at the left hand side. That's a bit of an aside. So not bad. You now know how to count not up to 8 but to 256 in binary but unfortunately we do not yet have the ability to actually display values that is rather characters, words, graphics on the screen and after all we've advanced beyond the age of a calculator to an actual computer that can manipulate arbitrary things like text and graphics and sound but we're getting there but for the meantime and this is unofficially our goal in this course is to turn you into such the geeks that you actually now understand the Sunday comics such as this one reprinted on your lecture slides if you have trouble reading it. That's sort of a pretty sad or scary day when you now understand jokes like this and laugh at them, right? You've joined the ranks of me and the teaching fellows. Well let's now move beyond the realm of 256 and just start tossing out some of the jargon with which you've been familiar but related to some of these new basics. So we've talked about bits all night so far. A bit is just a 0 or a 1. Well that doesn't let you count very high so the world has arbitrarily said that if you have 8 bits in a register or just 8 bits under discussion you can go ahead and call 8 bits 1 byte. So 1 byte simply means 8 bits, 8 bits is 1 byte. It's just an equivalent. If however you want to talk about thousands of bytes, well you might want to use a bit of shorthand like we do with kilometers and kilograms and say not 1,000 bytes but 1 kilobyte. But in the world of computers 1 kilobyte is not quite equal to 1,000 bytes. It happens to be equal to 1,024 bytes. For a variety of reasons. Suffice it to say for now it's a power of 2 and that's a useful thing in the computer world and there are historical reasons as well. But if you want to talk about millions of bytes what prefix can we toss in front of the word byte? Mega byte just like we did with the floppy. A floppy disk can hold 1.44 megabytes so that's 1.44 million bytes or 1,440,000 bytes. If we want to go one step further and talk about gigabytes like we did for the so-called hard drive, well then you are talking about roughly 1 billion, 73 million 741,824 bytes or roughly 1 billion bytes. And then we get up to beyond bytes. The types of storage space that your companies or your universities might have in their network operation centers when you have 1,000 gigabytes what do you have? You have 1 terabyte, T-E-R-A terabyte. It's about as high as we can go but the real geeks know how to count even beyond the terabytes. Alright so that's just to put aside some of the buzzwords that I'm sure you've heard floating around over time but now we're going to make it more interesting and move back into the realm of computers away from the realm of calculators so that we can actually now display conceptually really words on a computer screen. Well currently as we know a computer or a calculator can just store numbers right? We've just talked about how you can store numbers using multiple bits and you can count from 0 to 255. You throw some more bits, toss 32 bits into the foray and we said you can represent the number 4 billion roughly. Well that's great but I just need to represent 26 English characters on my screen. I don't need all of that space and yet you seem to have left me no room for storing characters, just numbers. Well it turns out that computers use what's called the ASCII character said ASCII is just an acronym up there, American Standard Code for Information Interchange do not write that down. It is not interesting, will not serve you well but that is what it means but what it refers to is just a mapping of numbers to letters. In other words if a computer wants to display the number or the letter A on the screen well what it does is it assumes that A will be represented in hardware by the number 65. Now how did I come up with that? Well look at the several columns here in red in the third column almost all the way at the top is the letter A at right in red move your eyes now to the left of that same column and under the deck for decimal system column we see the number 65 which is to say if a computer's register is storing the number 65 albeit in bits but really the number 65 well a computer will assume that that 65 in certain context is not the number 65 it is the letter A. Similarly if you want to show a lower case A well you will do so if a register contains not the number 65 but what decimal number? 97. Look now at the fourth column lower case A is the third row in red move your eyes to the left and you see under the decimal column 97 which means if that register is storing the number 97 a lower case A will be displayed on the screen and a computer is just hard coded to know that 97 means lower case A 65 means capital A it's stored in what's called the ROM but we'll come back to that tonight but that's what a computer knows. Fortunately you can represent other characters so ASCII is itself limited such as these funky characters but things for other languages beyond English accented characters umlauts and so forth but you can represent no more than it seems with ASCII how many different characters? 255 but really if we count the zero that was on the previous slide that chart started at zero 256 total possible characters is all that a PC today can display on the screen. Well that's clearly false these days any of you who have ever seen or viewed a web page or written in like an Asian language know that you can't really use any of these characters to write in a variety of Asian alphabets so there are actually newer systems than ASCII that are sort of built on top of this same idea but that use more bits to represent characters how many bits does ASCII appear to be using to represent characters? If the biggest one is 255, 8 bits which means if I want to store in a computer the word high how many bits do I need if the computer is using ASCII 16, 8 for each letter 8 for each letter. Let's reinforce this even further now by calling a few of you to partake and I gotta make one quick mention here and we'll talk about this more in just a second. There's a camera in the back of the room which means if you do partake means all your family and friends can theoretically watch you which is why we have this nicely mimeographed legal copy from Harvard's legal department which essentially says that you give your consent to appear in the video so if you choose to volunteer tonight or anytime in this semester just realize that just as the camera's on me it will soon be on you if you're uncomfortable with that fine we're never gonna compel you to volunteer but if you'd like to just realize that we do need you to sign that. With that said I need 8 volunteers. Why 8? 8 volunteers and this it doesn't get easier than this. 8 volunteers to hold a piece of paper 1 volunteer, 2 volunteers 6 more to go, 3 volunteers you will be the 128th column you will be the 64th column you shall be the 32's column. You see where we're going with this yet? The 16's column the 8's column still need a few more. Number one is still available. Here we go. 4's column 2's column and my number one volunteer is the 1's column. Alright so they have already quite cleverly lined themselves up correctly. What we are going to do now is put the burden on you the audience to figure out exactly what the heck is going on here in class. Now this is ultimately relevant to the exercise at hand but what we need each of you to do is hold your column numbers out not the answer keys. So now we have a bite of volunteers if you will. Here's the 128th column there is the 1's column.  But the rule is this, if their hand is raised they are representing a 1 and if it's down awkwardly at their side they're representing a 0. What these folks are gonna do for us though is not another mathematical exercise but send you a message using ASCII. So we're now going to represent an English word or words or sentence something but using this bite of volunteers as representing a fight using the ASCII character set. So with that said on the backs of your papers you should have an instruction that says during round one you should do something. Let's begin round one. We have two hands that have gone up. What number first of all is being represented by the bite of volunteers only two of whom have raised their hands. I hear 66 that's pretty good and it's pretty easy. 164 plus 1 2's column or if we want to really expound it we have 0 1 0 0 0 0 1 0 which is aka 66. What's the first letter they're representing then given the ASCII character set? I hear murmurs. B. B? Agreed? Okay. B. Round two. Okay hold them up high because we have what five volunteers raising their hand now. Yeah I hear it right over here. I hear it right back there. This left side's coming around. What number? 79 is correct. What letter? Oh it's the second letter. Okay round three. Last round. Okay I hear a number over here. Left side? I hear 87 in the middle. Left side? This side? 87 which is letter W what have we spelled? Okay bow or bow so please take your bow volunteers and thank you very much. So you've all now learned not only to count on a round of applause but you've now learned not only to count in binary but to spell in ASCII. Let's pause here and glimpse at where we're going tonight. This is an overview of computer hardware tonight but also an overview of the course. This is where we began and we'll end down there at virtual memory tonight. The goal tonight is to give you both one a sense of the course and two a sense of computing. After all you will certainly walk home tonight with already an understanding of what it means for computers to speak in one's and if you only walk away with that tonight frankly I think we're in pretty good shape. I think we've raised the technical bar already. I think you can impress your friends or family at home over the dinner table and if not you can certainly confuse them which is a step in some direction. Well what's this course all about? Well here are the expectations as stated on the syllabus and you can roughly follow along if you'd like with the syllabus which is among tonight's handouts. The expectations for the course are to attend or watch play in that in a moment. All lectures complete nine problem sets, take two exams and produce a final project. More on those in just a moment. The lectures in this course are categorized as follows. We pretty much cover a little bit of everything some in more detail than others but ultimately a little bit of everything. Tonight we're at hardware. Next week we'll be at hardware continued. We'll move from there to a software lecture moving on to two lectures about the internet from there to multimedia, security, development, programming, .coms, computer science itself and along the way discuss a number of other things. Along this way in fact we'll have a couple of respits for me talking and we'll have two computer science E1 movie nights. The first one of which is coming at you in lecture three for our software lecture. We will take a look and I will give you a little teaser trailer for this next week at a movie called the Pirates of Silicon Valley which is a dramatization of the growth of both Microsoft and Apple and you have two actors representing both Bill Gates of Microsoft and Steve Jobs of Apple and it's actually a wonderful depiction of what really happened over the past ten, twenty years leading up to about a few years ago before Apple sort of resumed its explosive growth. So I think we'll have a great time with that if not because of the movie if because we supply you that night with free popcorn and soda. And you are welcome that night to bring family and friends and we make it a true movie night for E1. The second of our two movie nights comes toward the end of the semester and is during our .coms lecture we will take a look at a brilliant documentary called and I know documentaries sound boring this one is cool called Startup.com which was a documentary filmed by two entrepreneurs who had started a company called theGovWorks.com and they rather immodestly boldly decided to document on film all of their activities during the .com boom thinking that wow this will be brilliant, we'll make a fortune not only on our company but on selling the footage of our experience running at .com. Well one of those proved to be true. It did debut as a movie but what it literally traces is the rise and then fall of a fairly representative .com company called GovWorks. So we'll have a lot of fun and popcorn with that as well. Books for the course there are no required books for this course one because we supply you with a whole lot of information in class but two they're really darn expensive all books these days and I do not think it is necessary or appropriate for us to ask that you not only pay for the course but hundreds of dollars in books so a few options here. If you are interested in procuring any books for this course we recommend the following but we recommend either of two sets. For those of you who are fairly new to the world of computing we have what we've called set one for true beginners. These are excellent books that supplement the lectures and do reinforce a lot of the material we discuss. Also goes off in different directions than we have time for in the course but in the end a pretty gentle supplement that is a very easy read. Lots of pictures, lots of diagrams are very easy to read kinds of books. For those of you for whom too many pictures and too much hand holding might actually get a little boring we have what we call set two for students more savvy. Covers fundamentally the same material but with more technical detail. You'll hear the books use the words like capacitors and transistors a lot more often than you'll ever see them in the other books and that's fine you'll still walk away having understood the material but to different levels of depth. So I think it really depends on where you're coming from as to which of these sets of books you should dabble in. I will say that you should buy them online not at the coop since you will pay much, much less if you buy them online even if you have to wait a week or two to get them. We have links to third party sellers on Amazon on the course's website but they're also all on reserve in Grossman Library for those of you who would like to take a look at them but would like to just take a peek at them for free in the library.  They don't fall into either of the sets but for those of you who come mid-semester or from Zen find that you really like what's called DHTML or CSS or those of you who are coming in as true Mac aficionados we have two books that are specifically tailored to those interests as well. Sections. Well this course is roughly half conceptual and half practical for the local students and by that I mean the following in addition to lectures in which I'll try my best to be as interactive as you've seen tonight as possible there's only so much we can do in a lecture hall and so we offer these things called sections. Sections are led by teaching fellows whom I'll introduce in a bit. They happen roughly weekly on a variety of topics and it's in sections that local students really get their hands dirty with computer equipment and with using a computer. Many of these sections will take place in a computer lab in which you'll have your own computer workstation in front of you and a number of activities led by the teaching fellows. Those activities this semester include the following in section one which won't start until next week and beyond. A section called dissecting a PC literally you will have not only these kinds of toys in front of you but the original machine from which I ripped them and you will actually do the ripping and the dissection of the computer as an exploration of what's actually inside of your or representative computer. In section two upgrading a PC we will frantically put the machines back during the week off and you will then upgrade the PC by for instance adding more RAM, adding another hard drive, skills that hopefully you'll enjoy exiting the course with so that you can do these kinds of things yourself in the future. Other sections include exploring the internet, treasure hunting, search techniques, finding things better and faster on the web, building and configuring a wireless LAN that is for your own home network, how you might connect things wirely and wirelessly designing your own gifs, jpegs and pings that is your own graphics, designing rather disinfecting a PC how do you get rid of stuff that you don't want there from spyware to viruses worms and a whole bunch of other stuff building websites with XHTML you'll learn by courses in how to make your own website using this language called XHTML and you'll learn how to enhance them with languages called CSS and SSI and you'll also get a taste but just a taste of what it means to program. There are whole semesters devoted to programming. We will teach you in a week how to program using a language called JavaScript. Now I know this may sound like a lot but hopefully it sounds like a lot of excitement and it actually is but this goes to this point of our trying to give you a little bit of exposure to everything and ultimately empowering you in this course to know yes what we teach you but also in the absence of an answer on your own where you go to find answers. There will hopefully be many questions this semester that I put in a blank stare for or at least pretend to know the answer to but really I'm frantically checking something online or winking at the teaching fellow so that they can look something up and a lot of the fact, a lot of the reason that I think the teaching fellows and I on occasion hopefully seem to know a bit more about this stuff because we've been asked the questions before and we know rather rapidly how to get answers and we hope to empower you with those same skills by terms n. In addition to these things called sections we have what are called workshops. These are off the path of sort of the official syllabus agenda. They are not material on any way that's tested but they go beyond the scope of sections and offer additional opportunities for local students for hands on activities. Using a PC and the course's website will be the very first workshop that we'll talk about in more detail next week. These workshops happen on Saturday afternoons purely optional. This first one though in particular is really meant for those of you who are a little bit nervous or very little bit nervous and who really want to hit the ground running be brought up to speed perhaps so that you don't feel so much out of your zone. But again we'll address that more next Thursday. But other workshops this semester are learning how to do more interesting stuff with a Windows PC, configuring it, fixing problems, doing the same on a Macintosh. Inside the net building a PC more detail on the internet and on computer hardware. Computer games will be the focus of another workshop. Digital photography and a tour of an actual large network that is of Harvard's University Information System. So a whole lot of stuff. Don't commit all this to memory now because each week will remind you what's coming up and tease you as to what you can gain from going to these sorts of things. And will also remind you of the problem sets of which there are only nine. The point of these problem sets you'll find is really to reinforce the material that we find to be most core to the class and we hope and will distribute problem set one next week that you also find them fun. Among the activities this semester will be a virtual shopping spree at a local computer store for which we will give you a virtual thousand or two thousand dollars for you to virtually spend and in reality annoy the sales people by asking them questions to which you'll hopefully realize that you have better answers than they. But more on that later in the semester. The final project in the course is typically a fun culmination for students for their website skills. Again by courses and you'll know how to make your own websites. You'll know what it means to write HTML to program and in the final project you'll have an opportunity to really have fun with those new skills. We specify very few parameters and pretty much say go make a website which tonight might seem like among the scarier things you've ever been tasked with by terms and it will be fun and I promise you that but there's also an option to do a paper in lieu of that if you find that this whole web mastering thing is not for you. Again more on that in the future and there's more detail on these things in the syllabus. Grades are straight forward. They will be weighted as follows. You will incidentally be allowed to drop your lowest problem set score if one does not go particularly well or if you miss it. The course's website. The URL is here. It's on the syllabus. It's linked on the Extension Schools website. Many of you have probably seen it before and that's a good thing because you'll hopefully find there to be a huge number of huge makes it sound intimidating. Just the right number of resources available to you for this course and by that I mean copies in electronic format of all of the handouts distributed so if you ever miss something or want to look it up online all such handouts are under the lectures page. Any such resources from sections are under the sections page. Anything from workshops is under the workshops page. It doesn't get more straight forward than that hopefully. Copies of problem sets, copies of software that you might want to download and install on your own machines at home. You need not buy anything for this class. We'll also post archives of announcements here and this semester we will also be as my 4 a.m. rendering of an iPod on John Harvard's ears suggests what are called podcasts. These are the newest craze these days and let me start by saying this. This is a distance education course which means just as there are many of you here tonight there are also many visitors sitting out in internet land watching as locally as down the street but just not in the lecture hall but also sometimes as far as Japan, Central or South America, Canada, Western Europe we've had a variety of students over the past several years. These are what are called distant students for the simple reason that they are not here and you too can take advantage of the resources we provide them with. For instance under the lectures link each week you will see links not only to the handouts but to the results of this video camera that's been on me all night. If you miss a class you can watch the video online. If I said something too quickly you can rewind and watch something again online. Reviewing for exams and so forth. In short for local students use them as you see fit and distant students will hopefully find them the next best thing to sitting here on campus just to give you a quick sense of what these things look like. We have here for instance a little snippet of a lecture from a couple of terms past. All of the software you need for this is free you do need an internet connection obviously in a PC or a Mac or a Linux computer but in workshop one if you need a bit of hand holding with setting this up do attend it looks a little bit like that. You can make things larger sometimes any slides that I use will appear at right you can jump around rewind and so forth but the short of it is that it works pretty well. It certainly depends on the quality of your internet connection if you're on dial up I'm not going to look so good on TV but maybe that's true no matter your connection but if you have cable DSL it actually works pretty well. What we are also doing this year as John Harvard suggests is also distributing the audio as what's called the podcast. Those of you with an MP3 player like an iPod or any other brand can if you wish engage with us in a bit of an experiment and actually copy lectures audio not video onto the iPod and believe it or not some students actually do find this historically helpful students that in many classes record the lectures with a little tape recorder anyway. Those of you who like to hear my voice but would rather not see me point at certain things might find it the next best thing or the next best use of time to doing nothing on the subway or in the car so use those as you see fit more on that next week once we have the first one posted but again it's an experiment on our part it is really in response to my absolute delight with having rediscovered books on tape but on my iPod it seems a wonderful use of time when I'm just walking places to not hear my own self speak I don't listen to my own lectures but to hear others read books to me so we'll see what you decide to do with them. How much do we have left? Okay question. You will access it via the website download the audio to your iPod but more details next week once we have the first one set up. So let's go ahead don't sit up just yet we're going to go ahead and pause the video I'm going to turn our attention to the several handouts tonight if you are comfortable with but you are never obligated to appear on video do put your signature and name on this form. Alright a couple of last administrative details feel free to continue filling those out and ultimately those handouts should make their way to Ray Diaz whom I'll introduce in just a moment the email address for the courses staff is both here on the website on the syllabus elsewhere use that to reach all of the teaching fellows and myself we also host though what's called a listserv or mailing list to which will subscribe all of you this is not a list on which you'll get ads and so forth but rather only correspondence from hopefully each other it's a form in which you can engage in conversations questions comments with other students the staff is on it as well so in the absence of say a correct answer to some question will occasionally chime in but we'll also use this for movie reviews which I'll mention in just one second and that second is now staff's picks are an opportunity for you to take advantage of some extra credit opportunities as I mentioned on the syllabus becoming a computer person a.k.a. nerd does not happen overnight but movies can help and so what we have linked on the course's website our number of picks from the staff the teaching fellows and myself of movies that are particularly germane to the world of computers and the internet and even if with the cheese factor communicate some interesting lessons even if that lesson is to reveal to you how completely unrealistic the movie actually is case in point in the movie swordfish starring John Travolta there is a computer hacker who somehow hacks into very important computer systems by ever so delicately balancing on the screen geometric shapes and just when they're also properly aligned the system is compromised like it is completely out of nowhere and that is incredibly unrepresentative of what actually would go on when a hacker is trying to compromise a computer I don't recall the movie but I've seen rather recently maybe even in the movie sneakers which is another one of our picks where you very quickly see this hacker typing on the computer screen all of this cryptic character scrolling down in white text on a black screen but if you pause the thing and look closely the person is essentially typing quickly things like dir enter which if you're familiar with the world of DOS or Unix that just shows you what files are in the directory so it's like double clicking a lot and making this seem like you're hacking into a computer hopefully by course's end you'll know the real from the Hollywood but we have a whole slew of movies here and the parameters are these if you during the course of the semester watch one of these movies and write a 200 or so word review of that movie with a thumbs up a thumbs down send it over to the listserv for others to engage in you will receive up to 5 points on the most recently submitted problem set so it is a very low impact way of accumulating a few additional points perhaps on a problem set that didn't go so well but it's also a good excuse to watch movies and get away with it as schoolwork so we hope you get something out of at least a few of these films here well finally we have this picture here which is from MIT's archives of hacks a number of years ago some enterprising MIT students connected a fire hydrant to a world or fountain the thing actually somehow worked at MIT and to the top right of the photo that not pictured is a sign that says getting an education at MIT is like drinking from a fire hydrant so we are not so bold as to equate ourselves with an MIT education in this class but there is a whole lot of material covered in this course as the what 16 page syllabus suggests and as my rapid fire conversation this evening suggests but just as you cannot swallow all of the water being shot at you from a fire hydrant so do we not expect for all such information to go down easy if at all in this course again the point of this course is to introduce a little bit of everything to you how much you walk away with is somewhat a function of how well we do that and how interested you are in that material but ultimately we hopefully have done our job even if you forget what the heck a terabyte is in the future or how you represent the number 65,536 well you know how to go back you know where to go back and figure these kinds of things out so that even if you don't know the answer to some question or what's going on at some conversation over the water cooler you know what terms to Google later that night so that you can in the next day and say well I disagree with whatever they were talking about the IT guys at the water cooler so appreciate that this is a fairly fast moving course there's a lot of material that's really a function of the space in which this course is right you can't pick up a magazine these days without seeing a reference to the internet or to Google or to any number of IT related information technology related topics but by courses then you'll have a clue if you will as to what's going on in a variety of spaces you'll have exposure to if not mastery of some of those spaces as well and to help you get there we have what we dubbed the not dumb question box which takes different forms each week based on whether or not we accidentally throw it out but this is a box that we will typically put by the window with the handouts and it's simply a way for you very casually to write down a question when no one's looking at you and you're getting some more candy and slip it into the box and hopefully I'll remember to go pick them up on occasion read them aloud if that is the idea and then answer it publicly so realize more often than not we get the candy wrappers in here but that's okay too but do feel free to ask semi anonymous questions that way if it's particularly germane to the lecture or you just got to know now the teaching staff if I could introduce this year's teaching staff this would be Ray Dan perhaps we should have each of them say a few words Ray in particular about his role as head teaching fellow first I'll be collecting your sectioning forms etc etc and if you have problems later in the semester when you actually have greats to look at looking at then you can come to me I don't normally stand so awkwardly close to the staff but I'm the only one with a mic so that explains why Roman I look at the camera at the same time my name is Roman I'm a software engineer I just finished off this computer science I'm coming from Russia but I'm not actually your typical hacker who's been surrounded by machines since age three and just hacks away I actually probably sent my first email just six years ago and now I do have a career in this and my purpose in this course is hopefully to help you share in the experience of experiencing the excitement of learning the computer's science and new and computer terms so it's going to be fun I'll stand up I'm Daniel I'm the last teaching fellow I'm a student at MIT I have quite a bit of experience with computers I guess I work in the tech support department for MIT so I do get lots of calls and I get to answer them and I'm looking forward to seeing you in the section any questions for any of them or for me administrative content wise or otherwise anything at all alright CPU's what was the CPU central processing unit yes central processing unit a big way of saying the brains of a computer you will see so many acronyms in this course some of them are useful to remember some of them not so useful most of which are always on our yellow jargon sheet so do not worry about scribbling profusely such acronyms as these but what is the CPU well again it's the brains of a computer a calculator has some kind of CPU it's not as expensive or as large or as advanced as a PC's CPU but it's the brains of the computer it's the hardware that knows when you provide it with input for instance two values previously stored in registers how to actually add those together and put the new value in the third register this is what a typical processor might look like today this is an example of what's called the Pentium 4 which this is a Pentium 3 I believe but it looks almost the same it actually is just the small thing glued to this big blue thing the blue thing anyone makes it look a lot bigger than it really is it's what's called a heat sink it is a very cheap piece of metal with a lot of surface area it is glued with a special type of glue to the CPU so that there's no space so that the heat from the CPU is dissipated as best as possible through all of these metal prongs they're just dumb metal there is no magic here and a fan will typically blow air over this thing to actually get the hot air away I'll pass all of these things around feel free to keep them moving throughout the audience CPU's can also take on different shapes that there is a Pentium 3 like the one I'm passing around snails not so much inside of a computer but this was a sort of goofy ad that Apple did perhaps effectively a few years ago when they wanted to ever so not so subtly convey the idea that the Pentium was slower than the PowerPC which is Apple's version of a CPU and so they had ads with the Pentium 2 at the time on top of a snail and that was about as detailed as the ad got this is the Pentium 2 looks huge but it's because you have a huge heat sink on the back of it it's a different format it's like a cartridge like an old Nintendo cartridge it's just a different way of plugging it into the motherboard Intel has since gone back to the square type that we're passing around there and I'll start this on this side of the room they can also look like this this is a G4 if you've ever heard of a PowerMac G4 well that is the CPU inside of a PowerMac G4 it's similar to the Pentium 3 and the Pentium 4 it's just a square and even the CPU itself is incredibly small you have a square about this big going around most of that is a piece of ceramic so that you can connect all of those gold pins to a motherboard which we'll talk about in a second but the CPU itself if you can see the square in the middle of say the Pentium 3 at top right that's the CPU the rest is just to spread things out so that you can put more pins underneath it to connect it to the actual computer and finally you have this which is an AMD K6 or K7 AMD is just a competitor of Intel's they make compatible processors they look almost exactly the same they work fundamentally the same but they're often much cheaper because they simply don't have the same brand recognition as Intel does okay I already used this term and incidentally where are we going tonight well again this is an introduction to hardware next week we'll focus more on hardware at a macroscopic scale because after tonight you will not likely need to talk about these thousands of little traces underneath the motherboard again since never will the problem with your computer be that there's a bad trace and if it is that is not something you can fix the way you fix that is this goes over there into the trash can or it gets repaired but more likely it will just be replaced so next week is where we'll talk about again a higher level the bigger pieces of equipment like these things here talk about what you need to know when buying a computer but tonight we're building our way up starting with the basics the building blocks so that everything here after has this solid foundation hopefully well this is a motherboard what does that mean the not so much the brain the CPU that we're passing around is the brain and the CPU plugs into all of these little holes in this square here yes more like the body and I'll go so far as to say a cheesier analogy like the central artery system where this is the device inside of the computer and think about like a desktop PC there's a lot of space in there well this gets smack dab on the side of one of the plastic walls of that case typically or on the floor of it if it lies horizontally this is like the central artery system it connects the CPU to all the other stuff in the computer some of that stuff is connected directly into the motherboard as we'll see more detail next week sometimes you have cables wires going into the motherboard connecting things like the lights on the outside of the computer the disk drives and so forth but generally speaking the motherboard just connects everything together creates a pathway between everything those pathways are generally called buses buses just like the public transportation just like a bus follows a route a line along which people or information flows so do you have buses on a motherboard incarnated as traces traces just like saying tiny little wire but generally speaking it's a bus because it's just a pathway that data follows well data what do we mean by data do you think at this point bits well so far we've only talked about storing bits how do you transmit bits how could you transmit bits well electronically what does that mean well suppose that I've got one register here and I need to send data to another register there just like the CPU might when it's adding 2 plus 3 it needs to put 5 somewhere else well how do you get 5 into that other register well you can think about silly real world things like well maybe just turn on a light turn off a light turn on a light turn off a light so maybe I've just transmitted 1 0 1 0 so it's essentially a flow of electricity along these little wires on the motherboard that communicate information if electricity is flowing it's essentially a 1 being transmitted if there's nothing flowing it's essentially a 0 it's a bit of a simplification but the idea in the end is pretty much just that signal on signal off 0 1 1 0 I'll pass this around now but where might I want to go to and from well the brains are fine if that's where all the math has to be performed but it's in the CPU that you have registers so in fact a computer CPU does have registers but it typically has very few most CPUs have 32 maybe 64 registers each of which has 32 bits that's not much data that's not even a floppy disk's worth of data the implication then is that most of the data in your computer might pass through the CPU but it's certainly not stored there in fact where it is stored when a program is running is in these things what's this stuff called yeah this is Ram when someone asks you how much memory does your computer have to be honest most people incorrectly answer oh I've got 20 gigabytes or 40 gigabytes or 100 gigabytes that's not really what you should answer when you're asked how much memory does your computer have memory colloquially means how much RAM do you have random access memory well what does that mean well this is the electronic storage space there's tons of little transistors capacitors all those technical words that essentially just store ones or zeros inside your computer's RAM and it's when you are running a program or looking at a document on the screen that document that program are not stored in the CPU wouldn't even fit but it is stored here in RAM how much RAM does a typical computer have these days 512 what megabytes so that's a good value let's put some numbers to some of these common pieces of hardware so RAM might come in quantities of 512 megabytes you might have a gigabytes if you're a server you might have two or four gigabytes if your computer's somewhat older you might have 256 megabytes if it is 10 years old you might have 32 megabytes if it is 20 years old you might have 4 kilobytes so that's where we've gone but I put down these numbers just as representative you can go in between these higher below but I would say these days if you were to buy a new computer and again we'll talk about this more next week you probably want to be more in this range no lower than this range better yet a gigabyte that's sort of like the nice the juicy part of the RAM curve now if you will but we talked about hard disk earlier well why is there a need for this if we already have some storage space well when you are running programs you need to be you want them presumably to be very quickly accessible and RAM is fast RAM is completely electronic which means it uses electricity to store your values and it can get the data in and out of the CPU very quickly so if this is your CPU you have programs being stored in RAM but suppose that you're working on a Microsoft Word document and it is in RAM that is it's loaded in memory and all of a sudden the power goes out worst case scenario what has just happened you've lost it right how many of you has this happened to in the past myself included now fortunately I got tripped up last year when I asked what happens the answer was like nothing because Microsoft Word now saves things automatically for the user but there was a day where that wasn't always true and even now sometimes that doesn't work well why is that well RAM is what's called volatile memory that just means it doesn't have electricity flowing through it it doesn't have any data stored in it well this would be a bad thing if you wanted to support the save feature that most programs have so where is most data stored permanently yeah it's stored on what's called a hard disk and yes this is a type of memory so it's not a completely egregious error to say oh I have 20 gigabytes of memory but it's not really what you would mean this is how much hard disk space you have how much storage space do you have and you can say it a number of other different ways but the numbers are quite different a hard drive comes as we said earlier maybe 20 gigabytes 40 gigabytes I recently got a 250 gigabyte hard drive you can see them as large as 400 gigabytes these days so they get quite large 10 years ago 320 megabytes 320 megabytes megabytes was how much RAM I had in my computer and again how many megabytes are in a gigabyte there are a thousand megabytes in a gigabyte so having a hard drive that was only 320 megabytes in 1995 vis-a-vis a hard drive that is now 400 gigabytes is quite a huge improvement over the past two years of course the data is getting larger for a variety of reasons but so is the storage space as well so this is kind of the picture of what's going on in your computer when you install some program where does that program get stored hopefully on the hard drive because if it got installed here what would happen when you pull the plug or turn it off you lose it and you have to install Microsoft Word every damn time you run it not such a happy world but if it's stored here this is non-volatile memory and it's stored long term because it's stored magnetically so believe it or not what is inside of a hard drive is a lot of these things they're not quite so floppy in fact they're much stronger because these things don't spin very fast and a floppy disk does not itself spin very fast which is why it's so darn slow a hard disk has several what are called platters they look like that but they're stiffer material but on top of them are those woolly woolly like particles but many more of them impact ever so tightly together and the drives themselves spin quite quickly how fast is a typical hard drive today yes so many rpms what do we mean by rpms here rotations or revolutions per minute so a hard drive storage space is in the gigabytes these days its speed is in rpms 7200 rpms previous to this you might see drives that are 5400 rpms some hard drives can go as high as 10,000 rpms but this is what's most likely to be in your computer today or purchased tomorrow megahertz megahertz is something different so in fact let's fill in the one blank we've left on the board we have numbers for ram over here we have numbers for hard drives over here but we've ignored the CPU we did say it's got some storage space what kind of storage does the CPU have what's inside of a CPU it is the processor but it has a few of those registers that we borrowed from the world of calculators but only like 32 of them 64 of them each of which only hold maybe 32 bits that's not so much that's not even close to the size of a hard disk or even ram but we haven't talked about a CPU's speed what is the speed of a CPU measured in not gigabytes kilohertz of these days megahertz or gigahertz so a common CPU today might be running at 2 gigahertz maybe yesterday at 1 gigahertz maybe 6, 8 years ago at 233 megahertz so what's on your desk at home or in the office is probably something these days in the 230 to 900 megahertz range or one to maybe 2 or 3 gigahertz range now what do we mean by 1 gigahertz well Hertz is a nice little unit it was named after Mr. Hertz and all it means is 1 something per second 1 over s so what does this mean well a computer whose CPU operates at 1 gigahertz can do 1 billion things per second 1 giga meaning 1 billion Hertz per second now what does that mean what is it doing 1 billion times per second well it can kind of be anything now a CPU does math because everything it does boil down to zeros and ones even letters of the alphabet at the end of the day so a CPU only understands numbers ergo it understands things like addition, subtraction, multiplication and suffice it to say scary as it might be you can build today's computer systems out of those very simple primitives addition, subtraction, multiplication and so forth and it's in a low level hardware course that you actually begin to understand how that is even possible but it's baby steps it's taken many years of increasing advances to actually go from addition and subtraction to playing quick on your computer but that's what it's ultimately about math well what this means if your CPU runs at 1 gigahertz is that roughly it can perform 1 billion additions per second 1 billion subtractions per second in other words it can do 1 billion things per second now how does it time this well inside of a CPU is literally a crystal of some sort you know how a lot of wristwatches work they're oscillating crystals so it's a little crystal that oscillates at a certain frequency which means roughly 1 billion times per second I can't demo this very well 1 billion times per second it oscillates and on every strike of the clock as it's called the clock in the computer is just this ticking crystal essentially something something can be done on each oscillation a bit of a simplification but in the end that's what the speed's referring to ergo the faster your CPU the more stuff can go on per unit of time the faster the computer is but it's not everything as we'll discuss briefly next week just getting a processor that's faster doesn't redress how much RAM you have or how fast the RAM is because this does have speeds associated with it but it's in nanoseconds and is usually not so much up to the consumer to decide hard drives obviously have different speeds but there are even more numbers associated with hard drives that we'll glance at again next week but what are these things that I'm about to pass around yes they are RAM but give me another acronym for these things chips sorry they are chips not an acronym but I'll take it chips describe these things dims sims if you want to be technical these are I believe these are both dims and a dim just means dual inline memory module and it's simply the more technical word to describe a stick of or a chip of RAM and I think I've got a couple of illustrative pictures here we have on the board just a couple of labeled pictures of motherboards that tell you where various things are we will for instance take a quick glance at this now where do such dims as those get put on a motherboard like this on the yeah on those horizontal lines you can kind of guess right it's probably got to go there there or there well the first there is the correct one in these four slots can you put RAM and for local students in section one will you see how to actually take RAM out and put it back in as well as in section two on the right hand side you have something called expansion slots we'll come back to that next week but what's that slot one for do you think what else kind of slides into a motherboard that we've already seen tonight yeah it's the Pentium two specifically the cartridge the Nintendo like cartridge goes in that thing labeled slot one the other CPUs that I passed around the other CPU goes in something that looks like that this is a Pentium one motherboard an older motherboard that took the different type and we'll tease a variety of these things apart in section as well as in our discussion on problem set one of this picture here which is sort of a scarier looking version of what's a cartoon above but is a real picture of a CPU but very nicely labeled with what everything is but I'm going to jump ahead to RAM here for a second here you have from top to bottom a SIM to dims and what are called rims which is just another type of RAM and we'll get to this in the course over the course of various discussions when you go to buy a computer when you go to upgrade a computer it's then when these various terms come into play because you have to go into the store or go online and know if you're looking for dims or sims or rims if you're looking for a slot one CPU if you're looking for another type of CPU but the nice thing these days is if you want to upgrade your computer let's say and it's a Dell computer well how do you figure out what kind of RAM you need for the computer well almost always these days it's gotten quite easy you go to Dell's website you tell the website what computer you have and it tells you what to buy now that's all fine and good if you want to pay Dell's prices for the RAM if you want to know now go one step further what you'll exit this course with is an understanding of what numbers and what acronyms and what technical specifications are actually relevant on Dell's website so that you can then go plug those into another price comparison website and find the same thing for maybe half the price so it's then where it becomes germane to know well what is a dim similarly might the user's manual tell you exactly the same information but we'll see more of this over time backing up you have one other type of RAM of memory this thing known is ROM so we've talked about two types three types of memory so far a register which is used during the computation during additions and subtractions just like in a calculator we talked about RAM which is where programs and files reside while you're working on them and a hard drive which stores data long term files and programs in reverse if you double click Microsoft Word Microsoft Word is copied in effect from your hard drive to RAM where it then in piecemeal is fed in and out of the CPU so that the CPU knows what it means to run Microsoft Word Microsoft Word is just a set of instructions stored as zeros and ones the CPU knows what those instructions mean and knows to display the window to display the print dialog and so forth when you go to file save the data goes from RAM to back to the hard drive but there are a couple of other types of memory ROM is one of them and ROM stands for read only memory when you boot up a PC many PCs look something like this yes so this is what's known as the BIOS screen BIOS basic input output system should be on your jargon sheet well what is that the BIOS is just a program permanently stored on your motherboard inside of a chip called ROM in fact one of the black chips on the motherboard being passed around is the ROM chip inside of there is a program written by some programmer somewhere and what the BIOS does this program is it tells your computer how to turn on and it does very basic tasks it's the BIOS that knows what ASCII is it's the BIOS that knows oh 65 in a register or in RAM means a capital A it's the BIOS that knows those basics it's the BIOS that knows what it means when you hit the letter A on the keyboard the BIOS knows that oh those electrical signals coming off the keyboard that is in A I should put the number 65 in memory it knows what it means when you move the mouse it knows what it means when you connect a printer all of the basics related to hardware what it also knows is how to hand control off to something called the operating system so the first thing that happens when you turn on your computer is a power on self test or post what does that mean it's when like the ticker starts counting up all of the RAM in your computer it's when it tells you what's inside your computer it's just testing itself to make sure nothing is wrong if you want to see something go wrong unplug your keyboard tonight turn on your computer if it's a PC and you'll most likely get an error message during this power on self test saying no keyboard present and if it's a stupid BIOS frankly you'll also get a message saying press F1 to continue no joke so plugging your keyboard back in you can configure the BIOS through what are called the CMOS settings another buzz word on your jargon sheet and these are just the very low level configuration options for a BIOS it's in the CMOS settings that you can change the date and time you can also do this in Windows and macOS at an easier user friendlier level it's here where you can tell the computer what hard drives are in it it's here where you can set a password that comes on when you turn the computer on independent of Windows and a whole bunch of other things that will show you for local students in section this is not something that most people need to touch these days because manufacturers have gotten better about automatically configuring all of this stuff but it's in this course where you will hit F2 or delete which are the common two buttons to bring up the BIOS screen in fact if you go home tonight turn on a PC and you see a little message even if it's brief that says press F2 or Dell for setup DEL well that means go to the CMOS settings in other words configure the BIOS you can break things but fortunately almost all menus have an option that says reset to default so that is your friend if you start poking around with these things if you're using a Mac to their credit they have made it even simpler to the extent that there really aren't these days correct me if I'm wrong Dan any user configurable BIOS settings that you can easily access there are still types of memory you can tweak but there is no equivalent of the PC's rather archaic and user unfriendly approach so the little happy face that comes on when you turn on a Mac that's about as complicated as it gets when you turn it on no joke one last type of memory if I may turns out hard disks are big but guess the price that you pay not in dollars for having a lot of storage space slow why well inside of that hard drive is a mechanical reading head the platter spin just like a floppy disk spins anytime you have physical things that are this big moving you're gonna hit some threshold of speed that threshold specifically is this might sound fast to a human and not very fast to a computer much faster is RAM why there are no moving parts in fact it's for this reason that things like your CPU RAM are unlikely to break there's no moving parts nothing's ever moving there's no reason the things should die unless for instance it gets overheated which could affect it electronically RAM is faster but why don't you have more of it or as much of it as you do hard disk space in other words why this disparity between 400 gigabytes and maybe one gigabyte of RAM sorry you don't store data as RAM but it sounds like it'd be kind of a nice thing if I could store more things in RAM because that means presumably I could run more programs at once even if temporarily but there's always this tradeoff smaller in size because the cost goes up RAM is more expensive per megabyte or per gigabyte than hard disk space but the advantage and the reason you want it is because it's faster similarly registers are blazingly fast but they're not a particularly efficient way of storing data and in effect they're not very different from what RAM is but a CPU also doesn't need more than a few registers but RAM relative to those registers is kind of slow which is why there exists one other type of memory in this discussion which gets inserted into our picture here which is called L2 cache and then another type called L1 cache level one level two that's all it means what does this mean they're just other types of memory they look almost the same physically as RAM but they're found in smaller quantities because they're more expensive but they're faster level one cache is even faster than L2 but it's more expensive and so you have less of it in your computer why do I point this out well even most computers today even at Best Buy on the tips stickers will tell you how fast the CPU is how big the hard drive is how much RAM is in there and quite likely how much L2 and L1 cache is there the funny thing is somewhat misleading because these two numbers are almost always dependent on what CPU you have which is to say that you the consumer shouldn't really care about how much L1 or L2 cache it is because you can't and should not ask the salesman if he could you know maybe he could bump up the L2 cache and I'll pay for this now it doesn't work like that right the L1 cache is almost always soldered on to the CPU the L2 cache is almost always soldered on to the motherboard so you get what you're getting with the package with these things but the more L2 cache the better in general the more memory you have the better which is why the Celeron for instance is cheaper than the Pentium 3 and the Pentium 4 the Celeron which is one of Intel's CPU lines designed really for consumers it is almost identical to the Pentium 3 and now Pentium 4 but they essentially shot it in the foot and removed some of its cache but it's marketing techniques right you can essentially ship the same product call it something else dumb it down slightly but your manufacturing costs haven't changed but your market segment has so another instance of that sort of thing we will look next week at things like secondary storage here we'll end tonight with a couple of useful videos though we'll look both at the floppy disk again at the hard drive again as well as at optical media like CDs and DVDs but what's helpful at this point is not to pass so much of the hardware around which are welcome to look like look at on your way out but to take a look at some of the more specifics for instance let's try to make this just a bit more real components of your computer communicate with each other they use a special electronic pathway called a bus just like a passenger bus that can transport a large amount of people the computer's bus can carry a great deal of information the bus allows the computer's standard peripherals such as keyboard to monitor to talk to each other in other parts of the PC the bus is made up of numerous electronic pathways called circuit lines the power and data travel the original IVM PC's 8-bit bus has 62 lines 8 of which transmit power to the adapter cards another 8 to 32 lines carry data to various components such as the memory chips or display the next 20 lines are called address lines they carry a coded roadmap to where the information is traveling each adapter card has a unique destination or address on the route of the bus the bus's lines carry commands for standard computer operations such as reading and writing data every component plugged into the bus is constantly looking for signals coming down the command lines for example when a signal to write data appears only the input output device is recognized as the command other devices such as the memory circuits do not, alerted by the right command the IO devices check the address lines the bus is addressed and adapter accepts the data and follows the new command otherwise the adapter simply ignores the instruction it's certainly more technical than some of the conversations we've had so let's actually, let me give you a little bit of a teaser for what you'll see, well actually what we saw tonight and we'll look at the hard drive next week it's a little easier to wrap your mind around the program, save data, or even files from one PC to another the part of the disk we see is actually just a hard plastic shell, the working disk which is inside is protected by a sliding metal shutter, this thin inner disk called the cooking, is coded not with chocolate chips, but with a very thin layer of magnetic material, when you slip the disk into your floppy drive, a system of levers pushes back into the metal shutter, the levers also pinch to rewrite heads closer so they almost touch the cookie a motor at the base of the drive spins the cookie based on commands from your PC the PC also signals another motor to move the rewrite head back and forth over the surface of the disk, so they can read or write data before your PC writes data, your drive first checks the right protect tab in the corner of the floppy disk this is open, light from a tiny diode shines through and strikes a diode on the other side, this biodebends head to your PC don't run on this disk, but if the tab is closed no light gets through, and the PC knows it, okay to write data, let's make that ever so slightly more technical with this one to write data on your floppy disk, your PC does the drive to send tiny forces of electricity to the heads, the pulses make the head act like little electrical magnets, each head creates a magnetic field that reaches the surface of the disk, remember the magnetic coating on the cookie? the magnetic field alters the tiny particles in this coating, if current runs through the heads one way, the particles are arranged with the northern south poles in one direction, but if current flows through the head the opposite way the polarity reverses, to read data from the disk, the magnets move into the same positions over the cookie, but this time the process is reversed, the cookie particles create a magnetic field in the coils of wire, and this creates a current to read right heads, the disk drives the test with flow of electricity and passes it onto the PC the PC translates the back and forth of current changes into a series of ones and zeroes, the binary language of computer data so let's do you go home with sort of a scary technical taste in your mouth, notice that we've ramped up to things tonight we started with woolly woolly and then slipped binary past you and let's similarly ease out of tonight's discussion with something that I'll hopefully make a few of you a little less uneasy about what you've gotten yourself into and let me give you this discussion this is the on-off switch if you use this switch to read your computer you should wait 10 seconds after turning it off before you turn it on again, this will help your PC keep everything clear so take the week to digest everything we've done tonight, please leave any of the handouts we need back from you with Ray, feel free to come up and ask us any questions you might have there is no homework this week and we look forward to seeing you next Thursday good night


Okay, the next presentation is from Wenxin Zhao and Yao Zhao, okay. They bring us high-frequency targeted attacks. They use this method to win the car CTF yesterday. Thank you, Hai Bing. Hi, my name is Yao Zhao. This is my friend, Wenxin Zhao. We're both NLP researchers and in our spare time, we work on adversarial attack and defenses for neural networks. And today we're going to talk about our method, high-frequency targeted attacks that we used in yesterday's CAD computation. So in the first half, I'm going to introduce some basic concepts of adversarial attacks and defense. And then the second part, we're going to talk about our techniques in the computation. So neural networks are becoming a lot more popular in image classification and are deployed in a lot of commercial systems. In this case, when an image is given to a neural network, the network takes in the raw pixel and calculates the activation through a lot of hidden layers and then output a final label for the image. In a popular case like ImageNet, there can be a thousand labels for an image. And an adversarial attack against a neural network is that we apply some small perturbation on the input image and make the prediction of the neural network fail to another class. In this case, we changed a correct label from Snail to Fox. There are generally two types of attacks, an adversarial attacks. The first one is non-target attacks. It basically changed the correct label to any non-correct label without a specific target. The other one is the targeted attacks. That is to give a target and perturb the image to have it classified wrong in the other target. So the method of constructing adversarial images are the most popular method, is the gradient-based attack. When given an input image, and the neural network, we can calculate the loss through the neural network and calculate the gradients back to the image. And then if we perturb the image in the way that is opposite to the gradients, then we can get an adversarial image that can fool the original neural network. A more powerful attack is the iterative attack. It applies the same gradient method again and again over many iterations. And as you can see in the curve, the more iterations we apply this method, the higher successful rate the attack can be. So in the realistic system, there can be black box attacks and white box attacks. So for white box attacks, the attacker have access to the model weights. In this case, gradient attack can be applied and the gradients can be accurately calculated. Usually the attack success rate is very, very high. In the black box case, model weights are not accessible to attackers. So to successfully attack neural network, we need to either guess the neural network the defender is using or ensemble a lot of neural networks and attack them at the same time. For those ensemble attacks, like single neural network attack, we add the loss function of many different kinds of neural networks together and calculate the gradients back through all of the neural network at the same time and apply the same gradient based attack as the previous step. So in this competition, we focused on the targeted attack and the target attack has some specific behavior that when you use the attack method on model, it usually doesn't transfer to a different model. In this case, we have a lot of different attack methods on the rows and columns and they can only attack the defender using the same model and the attack images really apply to new defenders. So Vincent is going to talk about this computation and the method and system we're using. Thank you for the introduction. Something I want to add is for example here. You see that especially for a targeted attack, the image is not transferable which means you have to guess. The first thing is that it's really expensive to train a new model. So we think that in practice, if you work on the image nets, people will use the pre-existing pre-trained model instead of train their own model. So they only have a couple of dozen models out there. So the question is if we can attack them all, so we can with high probability to attack any system, because we assume that people are using ensemble of those models and some combination of them to do the defense. So that's our assumption and it's basically the case actually. And then the other thing is that it's not transferable. So that means if somebody is using Inception V3 and we don't have that model, so it's really hard for us to build an attack model, an adversary image to attack that model without using that model to generate the image. So for competition, what's important here? So we are allowed to submit our attack every six seconds. So that's a budget we have. The competition runs for 30 minutes, so that means we can try 300 times or maybe 200 times. So the key here is we want to try different combination of ensembles and to generate the image, but we want to do that really fast. So how to do that? So basically it's quite simple. We run a multi-thread program. So there is one thread which do the submission. So the submission is controlled by one thread. And the image is put into the double-ended queue. And we have an automatically generated generator to generate a separate image as well as a manually generated. So automatically generated, we have some prefixed ensembles combinations. We have like 50 of them. And we will try them all, so it's fully automatic. And to make it run fast, so you have to... I mean the technical details is basically we use a tensor flow and the tensor flow is pretty slow to build a graph. The build graph takes like 30 seconds. So you don't want to build a graph for each iteration. So we want to reuse the graph, but we want to change the ensembles. So for each ensemble, you have some weights. So weights is as an input, so not a graph. And the bad thing for tensor flow is like, for example, in this batch, you don't want to use that model. So you don't want to evaluate that model. But tensor flow doesn't support that. So there's some space to improve that. But basically right now it's like if you have five models in your ensemble, so no matter you use it or not, tensor flow will always evaluate that model. So it takes time, but still good enough. And so that's basically for our automatic generator. And for menu generator, so we will look at the results of the feedback and come up with some combinations we think might work and submit that job to CPU. So automatic generator is run on GPU. And menu generator is run on CPU so that they will not compete for memories. But definitely menu generator is slower. So that's our strategy. So what you can see yesterday is that we attack everybody crazy, right? So I mean the success rate is not high, but as long as we can get some scores, that's fine. So that's what we did yesterday. Yeah, our strategy. Yeah, thank you. Question? It's tremendous, yeah. So it's like if you use our model. So our biggest ensemble is that we use seven models. So to build a graph, it takes like 30 seconds. And then to do the computation, I mean we calculate, we compute 10 images at once. So 10 images takes like 20 seconds. But for CPU, if you do the same thing for just one image, it takes like four minutes, something like that. Yeah, it's a different skill. So basically, in CTF, you probably did one. You guys did one main work type program. Yeah, yeah, yeah. So we heavily rely on the automatic, those predefined ensembles. We guess them. We guess those people might use them. That's our strategy. Yeah, because nowadays we still believe that. So for the black box tags or the key is to guess what model the opponent is using, right? Cool. Thank you. Thanks for listening to Yao. So this is the last presentation. Yeah, we finished this morning. Thanks everyone.