The way computers work is similar to the way humans read and study, with programs being moved from the hard disk to memory and processed by the CPU. This similarity allows us to discover ways to increase computer performance, which can then be applied to solve problems in human society.
When it comes to exam season, there are many subjects to study and many resources to refer to. Before we start studying, we take a pile of the things we’re going to study today from among the many materials on our bookshelves and stack them on our desk. Then we start reading, line by line, starting with the most urgent subjects. I open several books at the same time, glance from side to side, and if there’s something I haven’t gotten to yet, I go back to the bookshelf to get the last of the material I need. This is a story that everyone goes through during exams, but it’s actually a metaphor for what happens inside a computer. When we click on a program in a folder to run it, we’re pulling it from the bookshelf, stacking it on our desk, and letting the processor read it line by line. Let’s take a closer look at how the way programs run on a computer is similar to our study process.
Just as the first place we go to start studying is the bookshelf, the first place we look when running a program is the hard disk. Just as books with letters on them are sorted into categories on a bookshelf, programs composed of 0’s and 1’s are grouped into similar categories on a disk. The structure of a hard disk is easy to understand if you think of it as a cylindrical structure with multiple layers, like the ones you often see in CD bins. Just as you would rotate a CD to find the CD you want, you rotate the disk to find the program. When you use an external hard drive, you hear the sound of something spinning, and that’s the disk spinning to find the program. When you find the program you want to run, you grab it and a bunch of related programs and move them into memory. Memory is to a computer what a desk is to a person: a temporary place to put today’s study materials.
Now we need to organize the materials on the desk. Just as you need to organize your materials efficiently to study well, your computer needs to organize the programs in memory. For example, sometimes a program will terminate because memory is full, but if you look closely at the memory usage history, there are empty spaces scattered here and there, so there is plenty of room for other programs to run. This situation is called “fragmentation,” and how you solve it determines the performance of your computer. Similarly, when studying, if you don’t organize your materials well, it will take time to find what you need, which will reduce your efficiency.
Also, like the example mentioned in the introduction, computers sometimes go to the hard disk to retrieve program code that has not yet been imported into memory, and this is called swap in. The perceived distance to the hard disk is very long, so the more times you swap in, the slower your computer feels. Another way to improve your computer’s performance is to import all the related programs that will be executed in the future from the hard disk at the beginning. Now that you’ve brought all the materials for today’s study to your desk and are organized, all that’s left is to start studying. In the world of computers, the CPU is the workhorse.
The third device we’re going to look at is the CPU. It’s no secret that the performance of the CPU has a huge impact on the performance of a computer. While the performance of the human brain is not determined by how fast you can read, the performance of a CPU is determined by its clock speed, which is how much data it can read per second. The Intel i7-13700, a CPU currently on sale in 2024, has a clock speed of 5.4 GHz, which means it can read 5.4 billion zeros or ones in a second. When a computer reads code line by line, it’s called “fetching,” but instead of fetching one program and then reading another, it switches back and forth between the codes of different programs in order of urgency. Sometimes, if the speed of jumping from program to program is so fast that it appears to the user that two programs are running at the same time, this is called “multi-tasking”. This phenomenon is similar to the way a good student might open multiple materials at the same time and finish the day’s work in one sitting.
Your computer’s CPU, like your brain, is the center of your workload. The key to this process is how efficiently the CPU handles multiple tasks. For example, when studying multiple subjects, you need to prioritize the most important ones in order to be efficient, just as your computer needs to prioritize the most important tasks to maximize performance. A CPU’s multitasking capabilities are essential for handling multiple tasks simultaneously, similar to how we prepare for multiple subjects at the same time and focus on each one. The ability of a CPU to quickly process multiple tasks is a key factor in the overall performance of a computer.
So far, we’ve seen how the process of running a program stored on disk on a computer is similar to the process of studying in a library. To summarize, running a program means that the code, which is organized on disk as a sequence of zeros and ones, is moved into memory when we need it and processed by the CPU line by line. In addition to the above, the workings of computers have evolved over the course of their nearly 100-year history to mirror the human world, so some of the problems that have traditionally been challenging in computer science have often been solved by following efficient methods that we take for granted in our daily lives. Therefore, if this trend of computer development continues, it is expected that in the future, we will be able to solve problems in human society by using the problem-solving process in computers.
The similarities between computers and humans are striking. Machines that were created to mimic human behavior are now becoming more human-like again. When we realize that many of the techniques used to increase computer performance are actually mimicking human behavior patterns, we need to think about how we can maximize human creativity and efficiency in a modern world that lives alongside computers. This is not just about technological advancement, but will be an important challenge for a future where humans and machines coexist in harmony.