Newly Open!

What is CPU? ~ Why Is CPU Called the Brain of Computer? ~

What is CPU?

Hi everyone, I'm Yoshi.

In this article, I'm going to explain CPU, which is considered to be the brain of the computer.

We will explore the points below:

  • Why is CPU called the brain of the computer?
  • Is a higher clock frequency better?
  • What are multiple cores and multiple threads?

Let's get started!

What Controls Memory?

I have explained that memory and storage are devices that store data.

What is the difference between memory and storage? Memory vs. Storage ~Both Are Units to Store Data, but _ _ _ Is Different!~

Writing some data to the memory

Since memory and storage serve only as storage devices, it is necessary to have a separate device that gives instructions to write and read data. It is similar to the way that "a notebook by itself is meaningless, but when a human writes notes in it and rereads them, the notebook becomes a recordable object". CPU is responsible for this role.

What Is CPU?

CPU

"CPU" stands for Central Processing Unit. As mentioned above, it instructs the memory and storage devices to write or read "this data". In addition to storage, a computer has input devices such as a mouse and keyboard, and output devices such as a display. The unit that controls all of these devices in the computer is the CPU.

CPU  interprets programs

This instruction is done according to the orders given in the instruction book called "Program" or "Software". In other words, a CPU is a device that interprets a program and controls each device according to its instructions.

Programs that Give Instructions to CPU

Now let's talk a little bit about the program.

Programs tell the CPU how to control devices

The CPU controls other devices, but how it controls them depends on the device and the situation. You know that touching the same part of a smartphone screen behave in different ways depending on the application you are running. In other words, you need something to tell the CPU how to control the screen, like "For this screen touch, do A, for this touch, do B". That's a program (software).

In other words, a "program" or "software" can be said to be "a document of instructions that tells the CPU how to control a device". In the case of this example, the application software, commonly referred to as the app, is giving the instructions.

Note

About the difference between programs and software

The terms "program" and "software" mean the same thing, and you can replace "program" with "software", and vice versa. They are mainly used in different contexts. The term "program" is used when the focus is on things generated by programming. On the other hand, the term "software" is used to focus on items that are not part of the hardware.

The Five Components of Computer

Then, what kind of devices does the CPU control?
 Computers are equipped with a variety of hardwares which can be categorized into the following five types.

5 components of a computer

  • "Input unit" that receives instructions from humans (e.g., mouse, keyboard)
  • "Output unit" that expresses the results of instructions (e.g., displays)
  • "Storage unit" that stores data (e.g., memory, storage)
  • "Arithmetic and logic unit" that performs arithmetic, logical, and comparative operations described in the program
  • "Control unit", which is a device that control these devices

These are conceptual names given to understand the work that the computer is doing. These five devices are called the "five components of a computer".

5 components/devices of a computer

Of these, the "arithmetic and logic unit" and the "control unit" do not exist as separate hardware, but the CPU plays the role of both of them. The CPU is an "arithmetic and logic unit" that performs operations according to program instructions, and it is a "control unit" that controls other devices.

Note

The five components are connected by lines called "bus". In reality, the bus on which the instructions of "control unit" to control other devices flow is different from the bus on which the data exchanged between "arithmetic and logic unit", "storage unit", "input unit" and "output unit" is carried by those instructions.

Specific Examples of the Five Components

It's getting a little complicated, so let's take the example of computers and video games.

CPU behavior in computer

In the case of computers, they receive human instructions from input devices such as the keyboard and mouse. Then, according to the instructions of the program, the arithmetic unit calculate the next action. At this time, the computer stores the results of the calculation and other data needed later in its memory. Finally, the results of the action are displayed on a display or other output device. These processes are controlled by the controller. The computer operates by repeating this process over and over again.

CPU behavior in video game

What about in the case of video games? You can control cars or characters on the screen by manipulating a controller. This is accomplished by an input device called a controller that receives human instructions, and the CPU in the game console calculates and stores the next action according to the game software (program), and displays the result on the display.

I/O devices

The input and output devices mentioned here are sometimes called "I/O devices: Input/Output devices".

Note

These actions are described in a simplified manner. The actual operation is a bit more complicated and may also differ from device to device.

CPU Performance

CPU can be compared to the brain of a computer

I explained that a CPU is a control unit and an arithmetic and logic unit. Since it performs calculations and controls other devices, the CPU is sometimes compared to the "brain of the computer". So, you can imagine that the performance of a computer or video game depends on the performance of its brain, the CPU.

Have you ever considered upgrading your CPU when you buy a computer? By making the brain more powerful, we can expect to improve the processing speed of computers.

Let's take a look at some performance indicators to see what kind of CPU can be called high-performance.

Clock Frequency

Examples of synchronized dancing

Imagine a scene where a group of several people are practicing a dance. In order for everyone to match the choreography, the choreographer would clap to keep everyone having the same rhythm. This is called "synchronization".

CPU clock

In the same way, computers are designed to work according to a periodic signal called a "clock". The devices move in sync with the clap, or clock, generated by the representative. The number of times this clock is repeated in one second is called the "clock frequency" or "clock rate". So, just as dancers dance more quickly to a faster clap or beat, a CPU runs faster with a higher clock frequency.

CPU in the MacBook

Here are the specifications of the CPU in the MacBook. Understand that the word "processor" in the description means almost the same thing as "CPU". For this MacBook, you have the option to upgrade the CPU from 1.1GHz to 1.2GHz. So you can replace it with a CPU that has a higher clock frequency if you pay extra money.

The "G" in "1 GHz" represents 10 to the 9th power = 1 billion, and the "Hz" represents the number of frequencies per second (the number of times you clap your hands). Therefore, "1.1GHz" indicates a CPU that can run 1.1 billion times per second.

Should Clock Frequency Be Higher?

From what I have said so far, you may think that it is better to have a higher clock frequency. However, if the clock frequency is set too high, several problems can occur.

Higher clock generate heat and consume electric power

First, just as the faster you dance, the more you sweat and get tired, the higher the clock frequency, the more heat the CPU generates and the more power it consumes. For example, the battery life of mobile devices such as smartphones is an important factor, so it would be a problem if the battery of the phone runs out quickly due to high power consumption.

1GHz oscillates 1 billion times per second

Another problem arises. At 1 GHz, one clock is one billionth of a second. In other words, the hands are being clapped at a very short interval of one billionth of a second. Clock signals are electric currents, which travel at roughly the speed of light (300,000 km/s). Even with that speed, the clock signal can only advance about 30 cm in this short time. So the next clock signal is emitted when it has advanced 30cm.

If you are trying to synchronize, you have to finish your choreography before the next clap comes. This is because the dance will be disjointed if you are still doing the previous choreography when the next clap is given. In other words, if the people who synchronize are not within 30cm of each other, in the example of dancing, the dance will fall apart.

CPU components miniaturization

When the clock frequency is increased to 3 GHz, the distance is reduced to 10 cm. Thus, in order to increase the clock frequency, it is necessary to miniaturize the components of the CPU and place them within the CPU. However, this miniaturization is reaching its limits.

Note

The value of 300,000 km/s, the speed of light, is the speed of propagation through a vacuum. Therefore, the speed of the current flow on the CPU's circuitry is even slower than that.

Number of Cores

CPU core

So the idea was conceived to reduce the generated heat by keeping the clock frequency to a moderate level, and to improve the CPU performance by installing multiple cores instead. The term "core" refers to the central part of the CPU's work, and multiple cores means that there are multiple "arithmetic and logic units" and "control units" in a single CPU. The aim is not to increase the speed of a single core, but to improve the performance of the CPU as a whole by incorporating multiple cores.

A CPU with two cores is called a "dual-core CPU", while four cores are called a "quad-core CPU". Regardless of the number, a CPU with multiple cores is called a "multi-core CPU".

CPU core in the MacBook

In the previous example of the MacBook, we can see that the CPU has four cores.

Number of Threads

CPU thread

Also, a technology called "thread" has been introduced. This is a technology that increases the number of "control units" in the core, making the computer look like it has more cores than it does. By increasing the number of "control units", we aim to reduce the time when the "arithmetic and logic unit" is not in use as much as possible, thereby increasing efficiency and improving performance. However, since the "arithmetic and logic unit" itself is not increasing, the performance improvement is not as great as the increase in cores.

This technology to increase the number of threads is called "HTT: Hyper-Threading Technology" for Intel CPUs and "SMT: Simultaneous Multithreading" for AMD CPUs.

Note

There is another technology known as "cache". The cache is a storage area that can be read and written faster than memory, and by installing it inside the CPU, performance is improved.

Summary

Finally, I will summarize the contents of the article so far.

In this article, I have explained "What is CPU?".

Summary

CPU is;

  • a "control unit" and an "arithmetic and logic unit".
  • a central part of the five components of a computer.

Also, an indicator of CPU performance is;

  • the "clock frequency" with higher frequencies resulting in faster processing, but problems can occur if the frequency is too high.
  • the "number of cores, threads", etc. aiming to improve the performance of the CPU using a different concept than clock frequency.

よし

Thank you for reading the article. Talk to you later!