WEBVTT 00:00:15.000 --> 00:00:17.000 Do you remember when you first realized 00:00:17.000 --> 00:00:18.000 that your computer was more 00:00:18.000 --> 00:00:20.000 than just a monitor and keyboard? 00:00:20.000 --> 00:00:23.000 That between the mouse click and the video playing, 00:00:23.000 --> 00:00:25.000 there was something that captured your intention, 00:00:25.000 --> 00:00:26.000 understood it, 00:00:26.000 --> 00:00:27.000 and made it real? 00:00:28.000 --> 00:00:30.000 What is that something? 00:00:30.000 --> 00:00:32.000 Is it gremlins? 00:00:32.000 --> 00:00:33.000 Let's imagine that we can shrink down 00:00:33.000 --> 00:00:35.000 to the size of an electron 00:00:35.000 --> 00:00:37.000 and inject ourselves into a click of a mouse. 00:00:37.000 --> 00:00:39.000 If you took your mouse apart, 00:00:39.000 --> 00:00:42.000 you'd see that it's really a very simple machine. 00:00:42.000 --> 00:00:43.000 It has a couple buttons 00:00:43.000 --> 00:00:46.000 and a system for detecting motion and distance. 00:00:46.000 --> 00:00:48.000 You might have an optical mouse 00:00:48.000 --> 00:00:50.000 that makes these measurements with lights or sensors, 00:00:50.000 --> 00:00:52.000 but older ones did this with a hard rubber ball 00:00:52.000 --> 00:00:54.000 and some plastic wheels. 00:00:54.000 --> 00:00:56.000 Same concept. 00:00:56.000 --> 00:00:57.000 When you click a button on your mouse, 00:00:57.000 --> 00:00:59.000 it sends a message to the computer 00:00:59.000 --> 00:01:01.000 with information about its position. 00:01:01.000 --> 00:01:03.000 When your mouse click is received, 00:01:03.000 --> 00:01:06.000 it's handled by the basic input/output subsystem. 00:01:06.000 --> 00:01:09.000 This subsystem acts like the eyes and ears 00:01:09.000 --> 00:01:12.000 and mouth and hands of the computer. 00:01:12.000 --> 00:01:13.000 Basically, it provides a way for the computer 00:01:13.000 --> 00:01:16.000 to interact with its environment. 00:01:16.000 --> 00:01:18.000 But, it also acts like a buffer 00:01:18.000 --> 00:01:21.000 to keep the CPU from being overwhelmed by distractions. 00:01:21.000 --> 00:01:23.000 In this case, I/O subsystem decides 00:01:23.000 --> 00:01:25.000 that your mouse click is pretty important 00:01:25.000 --> 00:01:28.000 so it generates an interrupt to the CPU. 00:01:28.000 --> 00:01:31.000 "Hey, CPU! Got a click here." 00:01:31.000 --> 00:01:34.000 The CPU, or central processing unit, 00:01:34.000 --> 00:01:36.000 is the brains of the whole computer. 00:01:36.000 --> 00:01:39.000 Just like your brain doesn't take up your whole body, 00:01:39.000 --> 00:01:41.000 the CPU doesn't take up the whole computer, 00:01:41.000 --> 00:01:44.000 but it runs the show all the same. 00:01:44.000 --> 00:01:46.000 And, the CPU's job, it's whole job, 00:01:46.000 --> 00:01:48.000 is fetching instructions from memory 00:01:48.000 --> 00:01:50.000 and executing them. 00:01:50.000 --> 00:01:52.000 So, while you're typing, typing, typing, 00:01:52.000 --> 00:01:53.000 maybe really fast, 00:01:53.000 --> 00:01:55.000 like 60 words a minute, 00:01:55.000 --> 00:01:57.000 the CPU is fetching and executing 00:01:57.000 --> 00:01:59.000 billions of instructions a second. 00:01:59.000 --> 00:02:02.000 Yes, billions every second: 00:02:02.000 --> 00:02:04.000 instructions to move your mouse around on the screen, 00:02:04.000 --> 00:02:07.000 to run that clock widget on your desktop, 00:02:07.000 --> 00:02:08.000 play your internet radio, 00:02:08.000 --> 00:02:11.000 manage the files you're editing on the hard drive, 00:02:11.000 --> 00:02:12.000 and much, much more. 00:02:12.000 --> 00:02:16.000 Your computer's CPU is one heck of a multitasker! 00:02:16.000 --> 00:02:17.000 "But, oh my gosh, 00:02:17.000 --> 00:02:18.000 there's a very important mouse click 00:02:18.000 --> 00:02:20.000 coming through now! 00:02:20.000 --> 00:02:22.000 Let's drop everything now and deal with that!" 00:02:23.000 --> 00:02:24.000 There are programs for everything 00:02:24.000 --> 00:02:26.000 that the CPU does. 00:02:26.000 --> 00:02:28.000 A special program for the mouse, 00:02:28.000 --> 00:02:29.000 for the clock widget, 00:02:29.000 --> 00:02:30.000 for the internet radio, 00:02:30.000 --> 00:02:33.000 and for dealing with letters sent by the keyboard. 00:02:33.000 --> 00:02:35.000 Each program was initially written by a human 00:02:35.000 --> 00:02:37.000 in a human-readable programming language, 00:02:37.000 --> 00:02:38.000 like Java, 00:02:38.000 --> 00:02:39.000 C++, 00:02:39.000 --> 00:02:41.000 or Python. 00:02:41.000 --> 00:02:43.000 But, human programs take up a lot of space 00:02:43.000 --> 00:02:47.000 and contain a lot of unnecessary information to a computer, 00:02:47.000 --> 00:02:49.000 so they are compiled and made smaller 00:02:49.000 --> 00:02:52.000 and stored in bits of ones and zeros in memory. 00:02:52.000 --> 00:02:55.000 The CPU realizes that it needs instructions 00:02:55.000 --> 00:02:57.000 for how to deal with this mouse click, 00:02:57.000 --> 00:02:59.000 so it looks up the address for the mouse program 00:02:59.000 --> 00:03:01.000 and sends a request to the memory subsystem 00:03:01.000 --> 00:03:04.000 for instructions stored there. 00:03:05.000 --> 00:03:07.000 Each instruction in the mouse device driver 00:03:07.000 --> 00:03:09.000 is duly fetched and executed. 00:03:09.000 --> 00:03:12.000 And, that's not nearly the end of the story! 00:03:12.000 --> 00:03:14.000 Because the CPU learns that the mouse was clicked 00:03:14.000 --> 00:03:16.000 when the cursor was over a picture 00:03:16.000 --> 00:03:18.000 of a button on the monitor screen, 00:03:18.000 --> 00:03:21.000 and so, the CPU asks memory for the monitor program 00:03:21.000 --> 00:03:23.000 to find out what that button is. 00:03:23.000 --> 00:03:25.000 And, then CPU has to ask memory 00:03:25.000 --> 00:03:27.000 for the program for the button, 00:03:27.000 --> 00:03:28.000 which means that the CPU needs 00:03:28.000 --> 00:03:30.000 the monitor program again 00:03:30.000 --> 00:03:32.000 to show the video associated with the button, 00:03:32.000 --> 00:03:34.000 and so it goes. 00:03:34.000 --> 00:03:37.000 And, let's just say there are a lot of programs involved 00:03:37.000 --> 00:03:39.000 before you even see the button on the screen 00:03:39.000 --> 00:03:41.000 light up when you clicked it. 00:03:41.000 --> 00:03:43.000 So, just a simple task of clicking your mouse 00:03:43.000 --> 00:03:46.000 means visiting all of the critical components 00:03:46.000 --> 00:03:48.000 of your computer's architecture: 00:03:48.000 --> 00:03:49.000 peripherals, 00:03:49.000 --> 00:03:51.000 the basic input-output system, 00:03:51.000 --> 00:03:52.000 the CPU, 00:03:52.000 --> 00:03:53.000 programs, 00:03:53.000 --> 00:03:54.000 and memory, 00:03:54.000 --> 00:03:56.000 and not one gremlin.