< Return to Video

Hardware (15 mins)

  • 0:04 - 0:09
    If a computer is like a piano, then the
    term software refers to the code - what runs on it, like the music.
  • 0:09 - 0:13
    And the hardware is the physical parts of the thing.
  • 0:13 - 0:15
    So in this section, I'm going to talk about hardware, physical parts of the computer.
  • 0:15 - 0:22
    So probably one of the most important inventions of the twentieth century is the transistor.
  • 0:22 - 0:27
    And this is a little electronic component that can be used to build all sorts of different things.
  • 0:27 - 0:32
    The most common form of transistor today is built on what's called a chip.
  • 0:32 - 0:37
    And here's a picture of a chip, that I'm linking to from Wikimedia.
  • 0:40 - 0:44
    And so a chip is made of a little fingernail-sized piece of silicon.
  • 0:44 - 0:47
    And then different electronic components can be etched onto the silicon
  • 0:47 - 0:50
    and this allows you to essentially make the components very, very cheaply.
  • 0:50 - 0:59
    So the most likely, the most common component put on here is transistors. And you can make all sorts of stuff out of transistors.
  • 0:59 - 1:04
    So the things I'm gonna talk about later, CPUs and memory and whatnot, those all come down to chips that look like this.
  • 1:04 - 1:09
    Now a chip like this is said to be solid state
  • 1:09 - 1:11
    meaning there's no moving parts, there's no gears, there's no wheels.
  • 1:11 - 1:14
    And in a way, that makes it very reliable.
  • 1:14 - 1:15
    And as I said before, they can be made pretty cheaply.
  • 1:15 - 1:18
    And so this is one of the driving forces
    in the, computer revolution.
  • 1:18 - 1:22
    I should point out, this is the element silicon,
    which is like glass.
  • 1:22 - 1:28
    Not to be confused with silicone, which is like that kinda
    soft, rubbery stuff.
  • 1:28 - 1:34
    So, one of the most important forces driving silicon development is this thing called Moore's Law.
  • 1:34 - 1:38
    And so this was formulated by Gordon
    Moore. And it's just an observation about
  • 1:38 - 1:43
    how the manufacturing of chips with
    transistors on them tends to go.
  • 1:43 - 1:48
    And what the law says is that every 18 to 24
    months, approximately,
  • 1:48 - 1:53
    the number of transistors which can be fit onto one of those chips doubles.
  • 1:53 - 2:01
    So, you could sorta take that two ways. It might mean that for
    each year when I make a chip
  • 2:01 - 2:05
    after it doubles, well, now I can make that same chip but I get twice as many transistors.
  • 2:05 - 2:06
    So, in some sense it... it's more powerful.
  • 2:06 - 2:13
    Or you can think of it as just that the transistors are just
    getting cheaper and cheaper.
  • 2:13 - 2:15
    Now Moore's Law is not some law of nature, like the
    law of gravity.
  • 2:15 - 2:19
    It's just an observation about how transistor manufacturing tends to go,
  • 2:19 - 2:25
    but it's been true for over twenty years, and it seems to be continuing to be true.
  • 2:25 - 2:33
    So. Moore's law is why you can have computers now that are getting cheaper and they're showing up in thermostats and microwaves.
  • 2:33 - 2:38
    Essentially it's the doubling quality of Moore's law,
  • 2:38 - 2:47
    making what used to be a computer that would fill a room and cost millions of dollars now fit in the size of a sugar cube and cost under a dollar.
  • 2:47 - 2:49
    That is the effect of Moore's law when you think of doubling.
  • 2:49 - 2:50
    Well, just one doubling it's not that big.
  • 2:50 - 2:55
    If you have ten doublings that's a factor of a
    thousand.
  • 2:55 - 2:58
    So that's how you get from the room down to the sugar cube.
  • 2:58 - 3:00
    The other way you can think about this just in your own life,
  • 3:00 - 3:07
    is imagine buying... maybe six years ago buying a 50 dollar mp3 player.
  • 3:07 - 3:14
    had some amount of capacity. Maybe it had one
    gigabyte of capacity.
  • 3:14 - 3:18
    And then a few years later, with the same $50, if you
    bought an mp3 player it might have two or maybe four gigabytes of capacity.
  • 3:18 - 3:22
    And then a few years later, for the same $50, well now they all have eight gigabytes.
  • 3:22 - 3:26
    And what's going on is, well, basically there's a chip in the mp3 player that does the storage.
  • 3:26 - 3:30
    And by Moore's law, the manufacturing of that chip...
  • 3:30 - 3:33
    because there's more transistors that fit in there,
  • 3:33 - 3:37
    for pretty much the same price they can offer more and more capacity.
  • 3:37 - 3:40
    So that is the exponential quality of Moore's law.
  • 3:40 - 3:44
    So, to talk about computers, I'm gonna talk about the major parts that go into one.
  • 3:44 - 3:53
    And largely - oh, and here's a little picture of a computer - I'm going to say that there's the CPU, which is sort of the brains of the thing;
  • 3:53 - 3:58
    and then there's RAM, which is sort of the temporary scratch pad memory;
  • 3:58 - 4:01
    and finally, disk or flash for persistent structure.
  • 4:01 - 4:02
    So we'll talk about each one of those parts.
  • 4:02 - 4:09
    So, probably the most important part of the computer is the CPU, which stands for Central Processing Unit,
  • 4:09 - 4:12
    and it's inevitably described as kind of "the
    brains" of the computer. It actually does the computing.
  • 4:12 - 4:20
    So... the CPU has certain fairly simple operations that it can perform,
  • 4:20 - 4:28
    and so when you say that a computer runs at two billion operations per second,
  • 4:28 - 4:30
    really that's talking about the CPU: that means the CPU can do two billion things per second.
  • 4:30 - 4:33
    And that's a very typical number for 2012.
  • 4:33 - 4:39
    To say that it's the brains, we have to think
    about, well, the 'run' button in the earlier coding exercises,
  • 4:39 - 4:43
    where you had the code, and then something was executing the code.
  • 4:43 - 4:46
    Really, that was the CPU that was taking in that code and doing it.
  • 4:46 - 4:52
    So, before I talk about, RAM and disk and those things, I need to have a brief word about bytes.
  • 4:52 - 4:58
    So a byte is the, sort of, most common measure of information storage.
  • 4:58 - 5:03
    So one byte refers to approximately one letter that you might type,
  • 5:03 - 5:08
    like a T or an X or something. That fits in one byte.
  • 5:08 - 5:15
    Later on I'm gonna talk about RAM and disks and things like that. And those are all the sizes. How much information can they hold?
  • 5:15 - 5:20
    Those are measured in bytes. And later on, I'll go into more detail about the different sizes that you might have.
  • 5:20 - 5:24
    For now, I'll just say that one megabyte is a common size. That's about a million bytes.
  • 5:24 - 5:28
    And one gigabyte is about a billion bytes.
  • 5:28 - 5:32
    So,with that in mind, let's go to our second bit of technology here...
  • 5:32 - 5:38
    So RAM stands for Random Access Memory - or we might just say 'memory'-
  • 5:38 - 5:45
    and RAM is the temporary storage used by the CPU
  • 5:45 - 5:48
    to hold data and code that it's using right then just in
    the course of doing computation.
  • 5:48 - 5:55
    So in the code when we said something like 'new SimpleImage ("flowers.jpg")'
  • 5:55 - 6:02
    and I would say, 'well, this kind of loads the data into the
    computer' - really what was happening is the bytes of that data were being loaded into RAM,
  • 6:02 - 6:06
    and once they were in RAM then the CPU could do operations on them.
  • 6:06 - 6:10
    could do operations on them. So when you
    wrote code like 'pixel.setRed(0)' - really that was
  • 6:10 - 6:15
    going into RAM and manipulating of the data; actually making a change.
  • 6:15 - 6:18
    So, that sort of active stuff happens in RAM.
  • 6:18 - 6:25
    The main thing about RAM is that it is not persistent.
  • 6:25 - 6:27
    What that means is - when the power is removed, it just goes blank.
  • 6:27 - 6:32
    So it just works well as fast, temporary
    storage, but it's not long-term storage.
  • 6:32 - 6:36
    And you can kind of, I think you can have some
    intuition about that if you think about when you're working on
  • 6:36 - 6:42
    some, you know, paper, and you're typing in a word processor and then suddenly your computer shuts down...
  • 6:42 - 6:45
    maybe it crashes or the power goes out or something.
  • 6:45 - 6:51
    And so you have a sense that, well, whatever you were just... those last few bits you were typing. Those are gone.
  • 6:51 - 6:59
    Those were just in RAM. And the version that you have is the version that you saved.
  • 6:59 - 7:00
    So in a word processor when you hit the 'save' command, really what you are doing is
  • 7:00 - 7:06
    you're taking the version that is in RAM - this kinda temporary version - and you're writing it to disk.
  • 7:06 - 7:10
    (mumbled) I'm just getting something, and we'll talk about it in a second.
  • 7:10 - 7:14
    So that kinda gives you the sense of what does it mean to be persistent - like disk, or volatile - like RAM.
  • 7:14 - 7:20
    Alright, that leads us to our third hardware component: persistent storage.
  • 7:20 - 7:22
    So, the main thing about persistent storage:
  • 7:22 - 7:28
    It's a big area of bytes, but when you remove the power the data stays there.
  • 7:28 - 7:34
    So for the longest time persistent storage in computers has been done with a hard drive.
  • 7:34 - 7:41
    So a hard drive has a spinning disk in it. And there's a little head that writes magnetic patterns on the disk,
  • 7:41 - 7:44
    and it does that to record 0's and 1's, and store data.
  • 7:44 - 7:49
    And so when you... if you have a computer and you hear kind of a high-pitched 'whining' sound,
  • 7:49 - 7:55
    what you're probably hearing is the hard drive disk spinning in its little enclosure.
  • 7:55 - 8:00
    More recently there's been advances in what's called a flash drive.
  • 8:00 - 8:04
    And so a flash drive also stores 0's and 1's persistently, but it's solid state.
  • 8:04 - 8:12
    It just uses a chip - a so-called 'flash chip' - so there's no moving parts, it's very small, it's very reliable.
  • 8:12 - 8:15
    So, flash chips are used to make those little USB thumb drives
  • 8:15 - 8:20
    or SD cards, that you might put into a camera or something like that.
  • 8:20 - 8:27
    It used to be that per byte, flash was much more expensive than hard drives, and so hard drives were used for everything.
  • 8:27 - 8:29
    Sort of following the pattern of Moore's Law,
  • 8:29 - 8:30
    flash chips have been getting cheaper and cheaper.
  • 8:30 - 8:35
    And so it may be that the hard drive kinda dies out for day-to-day usage.
  • 8:35 - 8:39
    Like, we don't need it: we can just use these chips. So that remains to be seen.
  • 8:39 - 8:42
    So when you've got a hard drive or a flash chip
  • 8:42 - 8:50
    that just has this big area of bytes to do persistent storage, um, just on its own it's not really ready for the user to use.
  • 8:50 - 8:55
    Usually what happens is, the hard drive or flash drive is organised with what's called a file system.
  • 8:55 - 8:59
    And so the file system is just a way of organising this big area of bytes
  • 8:59 - 9:05
    and giving it that sort of familiar structure of files and folders.
  • 9:05 - 9:07
    And they each have names, and you can move them around and stuff.
  • 9:07 - 9:17
    And so a file is really just a way of taking some area of, you know, 100,000 bytes, and assigning a name to them.
  • 9:17 - 9:21
    So saying, 'look, this is flowers.jpg'. And flowers.jpg, that name, refers to those 100,000 bytes.
  • 9:21 - 9:23
    And then the user can copy it, or move it around, or whatever.
  • 9:23 - 9:29
    So, the file system just facilitates for you, seeing what data you have on there
  • 9:29 - 9:32
    and moving it around and organising it.
  • 9:32 - 9:35
    So that's our quick introduction.
  • 9:35 - 9:37
    So actually what I'd like to do is show you just pictures of actual hardware.
  • 9:37 - 9:37
    So, this is a picture of a motherboard.
  • 9:37 - 9:41
    This is a computer, a Shuttle computer, I bought in I think 2008, and then it broke.
  • 9:41 - 9:48
    So it became my little demo computer.
  • 9:48 - 9:52
    So this was a cheap computer, about $200 with all
    the parts.
  • 9:52 - 9:56
    So this is the motherboard all the electronic components plug into.
  • 9:56 - 9:58
    And right here in the middle is maybe the most important component. That's the CPU.
  • 9:58 - 10:05
    So let's zoom in on that.
  • 10:05 - 10:11
    So, if you kinda zoom in and look at the CPU, this metal
    package has the CPU chip in it.
  • 10:11 - 10:16
    And I'm gonna flip it over. If you flip it over you see there's all these gold pads here.
  • 10:16 - 10:21
    So the CPU is the most complicated chip on here and so it has a very large number of connections,
  • 10:21 - 10:23
    electrical connections to the motherboard.
  • 10:23 - 10:29
    And so then I can look again at my Wikimedia image, and now you can appreciate...
  • 10:29 - 10:34
    ...well, so there's these little tiny wires around the outside. So these connect to pads on the package
  • 10:34 - 10:37
    - the gold pads we were seeing -
  • 10:37 - 10:41
    and so inside the package they connect to little tiny spots
    around the chip
  • 10:41 - 10:43
    in order to get the electricity into the transistors on the side
    here.
  • 10:43 - 10:50
    The other thing I'll point out here is this copper thing. There's a second chip underneath here.
  • 10:50 - 10:56
    This is called a heatsink. So, the chip, because it has electricity running through it, it can heat up,
  • 10:56 - 10:59
    so there needs to be a way of dissipating that heat.
  • 10:59 - 11:01
    This is made of copper: copper's really good at
    conducting heat,
  • 11:01 - 11:07
    and so just by bolting that on there, it keeps the chip cool enough to operate.
  • 11:07 - 11:12
    There used to be another heatsink on top of the CPU here, but I removed it. Just so I could take it apart and show it to you.
  • 11:12 - 11:21
    All righty. So that's the CPU in the, uh, in this computer. So now let's look at the RAM.
  • 11:21 - 11:25
    So if you look at the side of the computer here, this is the RAM.
  • 11:25 - 11:31
    It's on a little separate card. And
    in this picture I have removed the card.
  • 11:31 - 11:34
    So the card fits into the slot here, so that's RAM.
  • 11:34 - 11:39
    So that's about 512 megabytes of RAM.
  • 11:39 - 11:42
    This is some years ago. You probably couldn't buy a RAM card that small nowadays.
  • 11:42 - 11:48
    So, you can see there's two chips here and there's two more chips underneath the stickers.
  • 11:48 - 11:55
    So this was made with four chips. Probably by Moore's Law, when this card was manufactured a few years before,
  • 11:55 - 11:57
    it probably used to be eight chips.
  • 11:57 - 12:01
    And then, by Moore's law, they can fit more under each chip and so they can just save money.
  • 12:01 - 12:06
    So, for the same 512 megabytes they could use fewer chips, so it's cheaper.
  • 12:06 - 12:11
    So that's...what do we have...CPU and RAM. So the last thing we need is persistent storage.
  • 12:11 - 12:15
    So, for this computer, persistent storage was provided by this. This is a hard drive.
  • 12:15 - 12:19
    So this is a three and a half inch hard drive - very typical size for a desktoop computer.
  • 12:19 - 12:24
    So this is where there's the spinning magnetic disk in here.
  • 12:24 - 12:32
    And this connects to the motherboard by this little SATA cable, which is a standard thing.
  • 12:32 - 12:36
    So those are the three parts of a computer.
  • 12:36 - 12:37
    That was a $200 computer, and it sorta did everything you'd want a computer to do.
  • 12:37 - 12:44
    More recently now we've got this alternative to the hard drive.
  • 12:44 - 12:50
    So this is a USB flash drive, or sometimes called a thumb drive.
  • 12:50 - 12:54
    So it's, you know, it's tiny. And I took this one apart.
  • 12:54 - 12:59
    And so if you look inside of it, this is a flash chip.
  • 12:59 - 13:05
    So this is the chip that just stores persistent data, little 0's and 1's, as little groups of electrons.
  • 13:05 - 13:09
    So this is the thing that's competing with the hard drive.
  • 13:09 - 13:16
    So this is a one gigabit chip, so it stores one billion bits.
  • 13:16 - 13:23
    And later on we'll look at how many bytes that might be. So that's a thumb drive.
  • 13:23 - 13:28
    This is an SD card, which is just a similar, you know, just an alternative to the thumb drive.
  • 13:28 - 13:31
    It's really just the same technology; it's just a different shape basically.
  • 13:31 - 13:33
    So this is the sort of thing you would use inside of a camera.
  • 13:33 - 13:38
    So as a last example, looking at that big
    computer...
  • 13:38 - 13:43
    So, one of the effects of Moore's Law is that you get these cheap little computers that can sort of fit into different places.
  • 13:43 - 13:48
    So a little computer on a chip is known as a microcontroller.
  • 13:48 - 13:50
    So the idea is, that instead of having all these separate chips
  • 13:50 - 13:57
    you can fit the CPU, the RAM, and the persistent storage
    all onto one chip.
  • 13:57 - 14:04
    And it's not gonna have a lot of power, but it's gonna be cheap. And Moore's Law has made that possible.
  • 14:04 - 14:08
    So microcontrollers, now, you can buy essentially the whole computer for under a dollar,
  • 14:08 - 14:12
    and it's just on the one chip. So these are the kinda computers - or I should say microcontrollers -
  • 14:12 - 14:14
    that you would find in a thermostat,
  • 14:14 - 14:18
    or they're probably scattered around your car doing
    little computer functions.
  • 14:18 - 14:27
    So, a neat example of a micro-controller is this
    guy. This is an Arduino board.
  • 14:27 - 14:33
    And this is a free and open source board, just offered
    by artists or hobbyists, or just for kinda playing around.
  • 14:33 - 14:37
    So this here. This is the chip; this is the micro controller.
  • 14:37 - 14:41
    So, it has a little bit of RAM, a little bit of CPU, and a little bit of persistent storage
  • 14:41 - 14:45
    just all on there. And then it's put on this board with some other support chips:
  • 14:45 - 14:50
    so, this is a USB chip, and it's got some power chips here to just make the whole thing work.
  • 14:50 - 14:54
    So, you can buy a version of this I think for about $20.
  • 14:54 - 14:56
    And the idea is, it's just a little computer,
  • 14:56 - 15:00
    so it can read sensors or switches, or control little lights or whatever.
  • 15:00 - 15:05
    So it's just a fun way to play around and make, like, an
    art project, or something like that.
  • 15:05 - 15:06
    So if you like working with your hands and
    you like wires,
  • 15:06 -
    then this is another form of computer that might be good to play with.
Title:
Hardware (15 mins)
Video Language:
English
imakegoodpie edited English subtitles for Hardware (15 mins)
imakegoodpie edited English subtitles for Hardware (15 mins)
imakegoodpie edited English subtitles for Hardware (15 mins)
stanford-bot edited English subtitles for Hardware (15 mins)
stanford-bot edited English subtitles for Hardware (15 mins)
stanford-bot added a translation

English subtitles

Revisions