What is the difference between CPU and GPU

Modern smartphones work due to different components, but it is the central and graphics processor (CPU and GPU) that are considered the main ones.

Despite the similar name and the fact that in general their main role is to process huge amounts of data, between the GPU and CPU There is a huge difference. But before delving into their differences, let's look at what they have in common.

GPU and CPU cores are blocks, each of which performs specific tasks. The size and volume of blocks can be different. It depends on the architecture of the processor. Both GPU and CPU have an ALU. This is an arithmetic-logical unit that is necessary to perform mathematical operations. Other blocks have access to memory (to load and save data), perform decoder or cache tasks. This is where the similarities end. Now let's talk about the differences between CPU and GPU.

What is the CPU

The central processing unit of a computer or smartphone can be compared to the human brain. This is a fairly flexible component that performs a whole range of tasks and is responsible for the device's performance. The CPU performs all logic and arithmetic tasks. This is what guarantees the operation of the operating system Android and the applications installed on the smartphone.

Processors are often found in multiple core configurations, ranging from four to eight for mobile devices and up to 16 for desktop and server hardware. The design of multi-core processors allows multiple applications and task threads to run simultaneously, which greatly improves performance and energy efficiency.

Each core runs at a clock speed, typically 2 to 3 GHz for mobile devices, and up to 5 GHz for computers. In addition, the CPU can have different amounts of high-speed private memory that is used to store instructions and data (i.e. cache). Cache memory can be either individual for each core or shared between them. It is necessary to speed up the execution of tasks and switch between them.

The processor handles various types of data and provides overall device functionality.

Inside most of the modern processors, there are several alu performing mathematical operations. In addition, CPU processes and rebuilds virtual memory for all user-running applications. For this reason, the processor is the most necessary tool for starting the operating system.

Next composite device CPU - transition prediction module. Its use allows you to preload and execute instructions that may be needed in the near future. This saves considerably and allows you to optimally use the processor computing resources.

What is GPU

GPU has an excellent CPU character load. Therefore, graphics processors do not use transition prediction modules. It is in this that the key lies the understanding of the differences between GPU and CPU.

If the central processor is necessary for performing various tasks, then the video card has a strictly defined purpose - rendering and processing of three-dimensional graphics. GPU Much faster and energy efficient solves these tasks. However, the graphics processor is not so flexible in its range of workloads.

The video card kernels have one or more Allu, but in contrast to those used CPUs they are designed completely different. They are capable of processing 8, 16 or 32 operations at the same time. In addition, the kernel GPU can consist of dozens or hundreds of individual blocks of Alu, thanks to which the graphics processor performs thousands of operations. This is especially useful during the processing of shadows on high-resolution displays.

GPU This is a separate computer or smartphone device, designed for graphic rendering and used as an accelerator of three-dimensional graphics.

due to the fact that GPU is intended for processing computer graphics, it is designed for massive Parallel calculations. Therefore, video cards have an obvious advantage in large amounts of information being processed.

Compared to the central processors, graphic have a special architecture aimed at an increase in the rate of calculation of textures and complex graphic objects. In addition, GPU is a more limited set of commands.

As for the clock frequency, then GPU, this indicator is usually lower than that of CPU. With this often we are talking about hundreds of MHz. This is due to heat and power limitations, since many more transistors are required to process massive amounts of data in parallel.

Parallel computing can be used not only as a 3D graphics accelerator. With it, video rendering, various cryptography and machine learning algorithms (like object detection) will run much faster on GPU rather than on CPU.

What is the difference between CPU and GPU

As a final analogy, imagine CPU as a Swiss Army knife, and GPU as a machete. The former is useful for a variety of tasks, from cutting a rope to opening canned food. Agree that trying to open a can of beans with a machete is not the best idea. But if you need to go through the dense thickets of the jungle, then you will probably prefer the machete, not the Swiss knife.

The CPU is suitable for a variety of types of calculations, especially since it has a wider set of instructions than a video card. Its cores are more flexible, allowing the CPU to allow multiple tasks to be turned on and off at the same time. The GPU has a limited set of instructions and focuses on performing one, strictly defined task. At the same time, the GPU performs much more calculations per cycle.

Despite the fact that the GPU and the CPU have a roughly similar structure (both are built from transistors), process data and numbers, the main difference between them is that each performs strictly defined tasks.