Skip to playerSkip to main contentSkip to footer
  • 5/23/2025
How does a computer work? The critical components of a computer are the peripherals (including the mouse), the input/output subsystem (which controls what and how much information comes in and out), and the central processing unit (the brains), as well as human-written programs and memory. Bettina Bair walks us through the steps your computer takes with every click of the mouse.

Lesson by Bettina Bair, animation by Flaming Medusa Studios.
Transcript
00:00Music
00:15Do you remember when you first realized that your computer was more than just a monitor and keyboard?
00:21That between the mouse click and the video playing, there was something that captured your intention, understood it, and made it real?
00:28What is that something? Is it gremlins?
00:32Let's imagine that we can shrink down to the size of an electron and inject ourselves into a click of a mouse.
00:38If you took your mouse apart, you'd see that it's really a very simple machine.
00:42It has a couple buttons and a system for detecting motion and distance.
00:47You might have an optical mouse that makes these measurements with lights and sensors,
00:51but older ones did this with a hard rubber ball and some plastic wheels. Same concept.
00:56When you click the button on your mouse, it sends a message to the computer with information about its position.
01:02When your mouse click is received, it's handled by the basic input-output subsystem.
01:07This subsystem acts like the eyes and ears, and mouth and hands, of the computer.
01:12Basically, it provides a way for the computer to interact with its environment.
01:16But it also acts like a buffer to keep the CPU from being overwhelmed by distractions.
01:21In this case, the I-O subsystem decides that your mouse click is pretty important, so it generates an interrupt to the CPU.
01:28Hey CPU, gotta click here!
01:31The CPU, or central processing unit, is the brains of the whole computer.
01:36Just like your brain doesn't take up your whole body, the CPU doesn't take up the whole computer, but it runs the show all the same.
01:43And the CPU's job, its whole job, is fetching instructions from memory and executing them.
01:50So while you're typing, typing, typing, maybe really fast, like 60 words a minute, the CPU is fetching and executing billions of instructions a second.
01:59Yes, billions. Every second.
02:02Instructions to move your mouse around on the screen, to run that clock widget on your desktop, play your internet radio, manage the files you're editing on the hard drive, and much, much more.
02:12Your computer's CPU is one heck of a multitasker.
02:16But oh my gosh, there's a very important mouse click coming through now! Let's drop everything now and deal with that!
02:22There are programs for everything that the CPU does.
02:25A special program for the mouse, for the clock widget, for the internet radio, and for dealing with letters sent by the keyboard.
02:32Each program was initially written by a human in a human-readable programming language, like Java, C++, or Python.
02:40But human programs take up a lot of space, and contain a lot of unnecessary information, to a computer.
02:47So they're compiled and made smaller, and stored in bits of ones and zeros in memory.
02:52The CPU realizes that it needs instructions for how to deal with this mouse click.
02:57So it looks up the address for the mouse program and sends a request to the memory subsystem for instructions stored there.
03:03Each instruction in the mouse device driver is duly fetched and executed.
03:09And that's not nearly the end of the story.
03:12Because the CPU learns that the mouse was clicked when the cursor was over a picture of a button on the monitor screen,
03:18and so the CPU asks memory for the monitor program to find out what that button is.
03:23And then the CPU has to ask memory for the program for the button,
03:27which means that the CPU needs the monitor program again to show the video associated with the button.
03:32And so it goes.
03:34And let's just say that there are a lot of programs involved before you even see the button on the screen light up when you clicked it.
03:41So just the simple task of clicking your mouse means visiting all of the critical components of your computer's architecture.
03:47Peripherals, the basic input-output system, the CPU, programs, and memory, and not one gremlin.
03:56The CPU is a huge application of the panic.
03:58It's noteworthy, but the CPU has to use the power of the battery .
04:05It's noteworthy, but the CPU has to use the power of the battery.
04:08You can see the CPU is noteworthy, but the CPU is noteworthy.

Recommended