Featured image of post CPU 101: A Beginner's Journey into Computer Processing Units

CPU 101: A Beginner's Journey into Computer Processing Units

This guide simplifies the complex world of Central Processing Units, covering their key functions, components, and the differences between major architectures. Ideal for anyone looking to understand the core element that powers our computers and devices.

# Introduction to CPUs

The central processing unit, or CPU, is a main component of the computer. It is the element that keeps your computer running. We’ve all heard about Intel and AMD, as well as a bunch of ARM CPUs that are mostly used in mobile devices. CPUs are everywhere, not only in your phone, PC, laptop, or tablet, but they can also be found in your car, refrigerator, cooker, and many other devices.

But how does it work, and what are the functions of this mysterious yet powerful component of our devices? In simple terms, the CPU acts like a controller; it processes data from input/output devices and helps them communicate with each other. The key functions of a CPU include performing arithmetic and logic operations, controlling and processing data, and interacting with other hardware components. Keep reading, as I’ll explain more later in this article.

# Key Components of a CPU

CPU has three main parts:

# Control Unit

The Control Unit fetches data from memory, decodes it into timing control signals, and these signals guide the operations of other CPU units. Moreover, the Control Unit enables communication with external devices.

# Arithmetic Logic Unit

The Arithmetic Logic Unit (ALU) performs arithmetic operations such as addition, subtraction, multiplication, and division on binary data and it also handles logical operations such as AND, OR, NOT that manipulate individual bits. The CU sends signals to the ALU, then ALU performs the operations and temporarily stores data during calculations in the registers. These registers hold operands and results. Then ALU sends the result back to CU, and cleans registers memory for next operations.

# Memory/Storage Unit

The Memory/Storage Unit (MU)’s main responsibility is to store instructions, data, and intermediate results. It includes registers and cache. Registers store temporary data during calculations. Cache stores data and instructions that are frequently used from a main memory or also known as a RAM (Random Access Memory). The Cache is a small fast memory that is usually integrated into CPU and acts like a bridge between CPU and RAM.

# CPU Cache

The CPU cache is a small, fast memory that stores data and instructions from RAM. Acting much faster than RAM, cache memory serves as a bridge between RAM and the CPU. A CPU can have three levels of cache: L1, L2, and L3. L1 is the fastest, usually ranging from 16KB to 64KB per core. The L2 cache, slower than L1 but faster than L3, has sizes that range from 256KB to 2MB. The L3 cache is the slowest of the three but still faster than RAM, with its size varying from 1MB to 128MB. However, some CPUs might have larger L1, L2, and L3 caches, depending on the CPU design. You can check information about your CPU cache online or by using tools like CPU-Z.

# Understanding Multicore Processors

Multicore processors are equipped with multiple cores, such as dual-core, quad-core, octa-core, etc. Each core is capable of executing operations and performing calculations independently. Additionally, each core possesses its own cache, and there may also be a shared cache for the entire chip. These cores operate in parallel, which means the CPU can handle different tasks simultaneously.

# Multithreading

Multithreading means that the processor doesn’t wait for one task to finish before starting the next one. It’s similar to a single cashier working in a busy store. Although the cashier can handle only one customer at a time, the store manager has figured out an efficient strategy. When one customer is paying, the cashier begins scanning the next customer’s products. This overlapping of tasks reduces processing time. The cashier switches back and forth between customers to ensure that both are served well.

# CPU Clock Speed and Overclocking

The clock speed of a CPU refers to the number of cycles it can perform per second. It’s measured in hertz (Hz), with modern CPUs typically measured in gigahertz (GHz), where 1 GHz equals 1 billion cycles per second. The CPU’s base clock speed is determined by an electronic oscillator, also known as a clock generator, which is a small component on the motherboard generating impulses at a certain frequency. Additionally, the overall CPU speed is calculated by multiplying the base clock (BCLK) by the CPU multiplier. For instance, if the CPU clock speed is 3.6 GHz and the base clock is 100 MHz, the multiplier would be 36.

Modern CPUs can dynamically modify their clock speeds using technologies like Intel’s Turbo Boost or AMD’s Precision Boost. This means that when the workload is light, the CPU may run at a lower speed to save power and reduce heat. Overclocking involves increasing a CPU’s clock speed by adjusting the clock multiplier and the voltage of the CPU. While it can enhance performance, overclocking can also lead to overheating and potentially decrease the stability or lifespan of the CPU. Not all CPUs support overclocking.

If you decide to overclock your CPU, you might want to invest in a better cooling system. Additionally, you will need software like HW Monitor to check your CPU temperature and a CPU benchmark like Maxon Cinebench tool to assess performance changes. When increasing the multiplier (CPU rate), I recommend starting from 0.5x to 1x. Before increasing the voltage, you should consult the manufacturer’s website to find out your CPU’s maximum voltage, as exceeding it can cause permanent damage to your CPU and potentially other components. After making changes, monitor the CPU temperature and performance for any unusual changes. Overclocking can lead to CPU overheating, potential freezes, unpredictable reboots, and data corruption, resulting in an unstable PC. Personally, I would not recommend overclocking your CPU.

# ARM and x86

ARM architecture is based on the RISC (Reduced Instruction Set Computing) design, which emphasizes efficiency. It utilizes a simplified set of instructions that can be executed quickly and with lower power consumption. This simplicity allows for the creation of smaller, more energy-efficient chips. Traditionally, ARM processors are known more for their low power usage than for high performance. However, recent developments in ARM technology have significantly enhanced their performance capabilities. Even Apple has started using ARM processors in their MacBooks, iMacs, and Mac minis, making ARM processors increasingly competitive.

ARM’s licensing model allows various manufacturers to create their own versions of ARM processors, which can lead to compatibility issues. On the other hand, the x86 architecture, developed by Intel and also used by AMD, is based on the CISC (Complex Instruction Set Computing) design. It supports a wide range of complex instructions, allowing for more versatility in programming but potentially resulting in higher power consumption and larger chip sizes. x86 processors are known for their higher performance capabilities, especially in demanding tasks like gaming or complex computations, and are typically faster in terms of raw processing power compared to ARM processors.

In conclusion, ARM is associated with efficiency and low power consumption, making it ideal for mobile and embedded devices, while x86 is renowned for higher performance and is commonly used in desktops, laptops, and servers.

# x86 vs x64

The x86 architecture, based on the CISC design, was developed by Intel and is also used by AMD. These processors feature a rich set of instructions and allow for complex operations to be executed in a single cycle. They are widely used in desktops, laptops, and servers. Originally, x86 processors were limited to supporting a maximum of 4GB of RAM and could process 32 bits of data per cycle. However, the x64 architecture, which is an extension of x86, enables the processing of 64 bits of data per cycle. Furthermore, x64 architecture supports significantly more RAM, up to 16 exabytes, compared to the 4GB limit in the original x86 architecture.

# CPU Socket

A CPU socket is an interface between the motherboard and a microprocessor, providing both mechanical and electrical connections between the CPU and the motherboard. There are three different types of CPU sockets mostly used nowadays: Pin Grid Array (PGA), Land Grid Array (LGA), and Ball Grid Array (BGA).

# Pin Grid Array (PGA)

PGA sockets have retention clips that apply a constant force and use a handle mechanism for insertion, providing superior mechanical retention and avoiding bent pins. In PGA architecture, the pins are located on the underside of the processor package and are inserted into the motherboard’s CPU socket using zero insertion force (ZIF). ZIF minimizes the amount of force needed to install a CPU into the motherboard’s socket or slot.

# Land Grid Array (LGA)

LGA sockets use a surface plate and a lever. The latch plate ensures a good connection and increased mechanical stability. Commonly used by Intel and AMD CPUs, in LGA architecture, the pins are in the socket instead of on the processor.

# Ball Grid Array(BGA)

The Ball Grid Array socket requires soldering and is not user-replaceable, whereas LGA and PGA sockets are replaceable.

# Summary

This blog post offers a good overview of the central processing unit or CPU, the main component that powers computers and many other electronic devices. It breaks down the CPU’s structure and functions, highlighting the Control Unit, Arithmetic Logic Unit, and Memory/Storage Unit. These components are crucial for executing instructions, performing arithmetic operations, and storing data.

The post delves into the concept of CPU cache, explaining its role as a fast intermediary between RAM and the CPU, and discusses the evolution from single-core to multicore processors. It illustrates how multicore processors enhance performance by executing multiple tasks simultaneously and explains the concept of multithreading using an everyday analogy.

Further, it covers CPU clock speed, detailing how it is measured and the role of the electronic oscillator in setting the base clock speed. The topic of overclocking is also addressed, including its benefits, risks, and the need for effective cooling and monitoring systems.

Additionally, the post explores the various types of CPU sockets, including Pin Grid Array (PGA), Land Grid Array (LGA), and Ball Grid Array (BGA). It elucidates their unique features and highlights the importance of the mechanical and electrical connections they provide between the CPU and motherboard.

A key part of the post contrasts the ARM and x86 architectures. It outlines ARM’s efficiency and suitability for mobile devices and discusses the high-performance capabilities of x86 processors, typically used in desktops and servers. The post also explains the x64 architecture, an extension of x86, which supports greater data processing and increased RAM.

# Thank You for Reading

Thank you for taking the time to read this comprehensive guide on CPUs. If you have any questions, notice any mistakes, or would like to suggest topics for future posts, please feel free to reach out or leave a comment.

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy