What Is CPU
The CPU (Central Processing Unit), sometimes known as “processor,” is one of the most important components in a computer system. Being the brain of the computer system, its task is to take care of all the data calculation and make sure they are processed in the fastest time possible. CPU is not something you can see from the outside of the computer. In fact, you won’t be able to see the CPU on a fully-assembled PC. To see it, you have to remove the computer casing, unplug the wire, and remove the heatsink (and fan), and only then can you see the surface of the CPU. The shape of the CPU is a small square chip with many connector pins underneath. The images below show the back and the top of a CPU.
How CPU Works
To keep it simple, the way a CPU works can be illustrated with the following three steps: While it may seem easy, all three steps must be completed in a few seconds. A delay in any of these steps will result in a lag in the computer.
Clock Speed
Every CPU is equipped with an internal clock that provides it with a working “rhythm.” The “Clock Speed,” also known as “Clock Rate,” refers to the number of operations the CPU can perform in a single second. This is the number in Hz (Hertz and, by extension, megaHertz and gigaHertz seen as MHz and GHz) you usually see next to a CPU’s name. The problem is that, to go faster, you have to push more electricity through a CPU, and that produces heat. After the top ceiling of 4 GHz, it’s hard to keep a CPU adequately cooled down. The performance of a CPU in Hz affects mostly single-threaded applications. Most modern software, like the popular Chrome and Firefox browsers, is designed to take advantage of multiple cores (more about this in the next section) and threads, rather than solely depending on the clock speed. Typically, the computer would perform better on a CPU with multiple cores but slower clock speeds than a quicker but single-core one.
Number of Cores
Since increasing the actual speed became harder and harder to pull off, CPU manufacturers decided to add multitasking capabilities by adding more cores to the CPU. It is a disservice to describe multicore CPUs as the equivalent of “slapping two or more CPUs together in the same package.” They might look like that to the average consumer, but their actual designs are much smarter than just gluing two CPUs next to each other. By coexisting on the same die, the individual cores of a multicore CPU share some resources, both to cut down manufacturing costs and improve performance. For example, they might share a piece of cache memory, the connections to other elements on a motherboard, etc. Multicore CPUs can be homogenous or heterogeneous. Homogenous CPUs contain two or more identical cores. Heterogeneous CPUs contain cores of different types. For example, the CPUs in modern smartphones usually include a central core that’s better at general operations and multiple smaller ones that help with photography, A.I., etc. With CPU manufacturers turning their attention to adding more cores instead of further pushing the GHz limit, modern software and operating systems followed suit. Most modern software is already taking advantage of multiple cores, but you may still find a lot of tools, applications, and even games, that perform better with a higher single-core speed than with multicores. This happens because some workloads simply cannot be parallelized, split into smaller chunks, and spread across multiple cores.
Cache and Architecture
Back in the 8-bit days, a computer’s RAM was quick enough to provide a CPU with everything it needed. As CPUs kept speeding up, RAM started playing catch-up. That’s when the cache was introduced to the mix. A cache, which is effectively a small and extremely fast memory, is added to the CPU to store immediate instruction from the RAM. Since the cache runs at the same speed as the CPU, it can rapidly provide information to the CPU at the shortest time without any lag. There are different levels of cache. Level 1 (L1) cache is the most basic form of cache and is found on every CPU. Level 2 (L2) cache has a bigger memory size and is used to store more immediate instructions. In general, the L1 cache caches the L2 cache, which in turn caches the RAM, which in turn caches the hard-disk data. With the newer multi-core technology, there is even an L3 or L4 cache that is bigger in size and is shared among the various cores. It is worth noting that those may become less important in the future if someone finds a way to speed up the connection between the CPU and RAM significantly. We mention this because AMD might have somehow managed to pull this off and is one of the reasons their next generation of Zen architecture processors is exciting. The above are the factors that affect CPU performance. You may also want to know the differences between an Intel and AMD CPU, and how to choose an AMD CPU.