Tutorials

▷ What is a processor and how does it work

Table of contents:

Anonim

Today we are going to see some hardware. Our team is made up of a large number of electronic components that together are capable of storing and processing data. The processor, CPU or central processing unit is its main component. We are going to talk about what a processor is, what its components are and how it works in detail.

Prepared? Let's start!

Index of contents

What is a processor?

The first thing we will have to define is what a microprocessor is to know everything else. The microprocessor is the brain of a computer or computer, it is made up of an integrated circuit encapsulated in a silicon chip that is made up of millions of transistors. Its function is to process the data, control the operation of all the devices of the computer, at least a large part of them and most importantly: it is in charge of performing the logical and mathematical operations.

If we realize it, all the data that circulates through our machine are electrical impulses, made up of signals of ones and zeros called bits. Each of these signals is grouped into a set of bits that make up instructions and programs. The microprocessor is in charge of making sense of all this by performing basic operations: SUM, SUBTRACT, AND, OR, MUL, DIV, OPPOSITE AND INVERSE. Then we have to the microprocessor:

  • It decodes and executes the instructions of the programs loaded in the main memory of the computer. Coordinates and controls all the components that make up the computer and the peripherals that are connected to it, mouse, keyboard, printer, screen, etc.

The processors are currently usually square or rectangular in shape and are located on an element called a socket attached to the motherboard. This will be responsible for distributing the data between the processor and the rest of the elements connected to it.

Architecture of a computer

In the following sections we will see the entire architecture of a processor.

Von Neumann architecture

Since the invention of microprocessors until today, they are based on an architecture that divides the processor into several elements that we will see later. This is called Von Neumann architecture. It is an architecture invented in 1945 by the mathematician Von Neumann that describes the design of a digital computer divided into a series of parts or elements.

The current processors are still largely based on this basic architecture, although logically a large number of new elements have been introduced until we have the extremely complete elements that we have today. Possibility of multiple numbers on the same chip, memory elements at various levels, built-in graphics processor, etc.

Internal parts of a computer

The basic parts of a computer according to this architecture are the following:

  • Memory: is the element where the instructions that the computer executes and the data on which the instructions operate are stored. These instructions are called the program. Central Processing Unit or CPU: it is the element that we have previously defined. It is in charge of processing the instructions that come to it from the memory. Input and output unit: it allows communication with external elements. Data buses: are the tracks, tracks or cables that physically connect the previous elements.

Elements of a microprocessor

Having defined the main parts of a computer and having understood how information circulates through it.

  • Control unit (UC): it is the element that is in charge of giving orders through control signals, for example, the clock. It searches for instructions in main memory and passes them to the instruction decoder to execute. Internal parts:
    1. Clock: Generates a square wave to synchronize processor operations Program Counter: Contains the memory address of the next instruction to be executed Instruction Record: Contains the instruction that is currently executing Sequencer: Generates elementary commands for processing of instruction. Instruction decoder (DI): it is in charge of interpreting and executing the instructions that arrive, extracting the operation code of the instruction.

  • Logical arithmetic unit (ALU): it is in charge of making the arithmetic calculations (SUM, SUBTRACTION, MULTIPLICATION, DIVISION) and logical operations (AND, OR,…). Internal parts.
    1. Operational circuit: they contain the multiplexers and circuits to make operations. Input registers: the data is stored and operated before entering the operational circuit Accumulator: stores the results of the operations performed Status register (Flag): stores certain conditions that must be taken into account in subsequent operations.

  • Floating point unit (FPU): This element was not in the original architecture design, it was later introduced when the instructions and calculations became more complex with the appearance of the graphically represented programs. This unit is responsible for performing floating point operations, that is, real numbers. Record Bank and Cache: Today's processors have volatile memory that bridges from RAM to the CPU. This is much faster than RAM and is responsible for speeding up the access of the microprocessor to the main memory.

  • Front Side Bus (FSB): Also known as a data bus, main bus, or system bus. It is the path or channel that communicates the microprocessor with the motherboard, specifically with the chip called the north bridge or nothbridge. This is responsible for controlling the operation of the main CPU bus, RAM and expansion ports such as PCI-Express. The terms used to define this bus are "Quick Path Interconnect" for Intel and "Hypertransport" for AMD.

Source: sleeperfurniture.co

Source: ixbtlabs.com

  • Back Side BUS (BSB): this bus communicates the level 2 cache memory (L2) with the processor, as long as it is not integrated in the CPU core itself. Currently all microprocessors have cache memory built into the chip itself, so this bus is also part of the same chip.

Two or more core microprocessor

In the same processor, not only will we have these elements distributed inside, but they are now replicated. We will have several processing cores or what is the same several microprocessors within the unit. Each of these will have their own cache L1 and L2, normally the L3 is shared between them, in pairs or together.

In addition to this we will have an ALU, UC, DI and FPU for each of the cores, so the speed and processing capacity multiply depending on the number of cores it has. New elements also appear inside the microprocessors:

  • Integrated memory controller (IMC): Now with the appearance of several cores the processor has a system that allows you to directly access the main memory. Integrated GPU (iGP) - The GPU handles graphics processing. These are mostly floating point operations with high-density bit strings, so the processing is much more complex than normal program data. Due to this, there are microprocessor ranges that implement inside them a unit exclusively dedicated to graphics processing.

Some processors, such as AMD Ryzen, do not have an internal graphics card. Just your APUs?

Microprocessor operation

A processor works by instructions, each of these instructions is a binary code of a certain extension that the CPU is able to understand.

A program, therefore, is a set of instructions and to execute it it must be carried out sequentially, that is, executing one of these instructions at each step or period of time. To execute an instruction there are several phases:

  • Instruction search: we bring the instruction from memory to the processor Instruction decoding: the instruction is divided into simpler codes understandable by the CPU Operated search: with the instruction loaded in the CPU you have to find the corresponding operator Execution of the instruction: perform the necessary logical or arithmetic operation Saving the result: the result is cached

Each processor works with a certain set of instructions, these have evolved along with the processors. The name x86 or x386 refers to the set of instructions that a processor works with.

Traditionally 32-bit processors have also been called x86, this is because in this architecture they have worked with this set of instructions from the Intel 80386 processor that was the first to implement a 32-bit architecture.

This set of instructions needs to be updated to work more efficiently and with more complex programs. Sometimes we see that in the requirements for a program to run come a set of acronyms such as SSE, MMX, etc. These are the set of instructions that a microprocessor can deal with. So we have:

  • SSE (Streaming SIMD Extensions): They empowered the CPUs to work with floating point operations. SSE2, SSE3, SSE4, SSE5, etc: different updates to this set of instructions.

Processor incompatibility

We all remember when an Apple operating system could run on a Windows or Linux PC. This is due to the type of instructions from the different processors. Apple used PowerPC processors, which worked with instructions other than Intel and AMD. Thus, there are several instruction designs:

  • CISC (Complex Instruction Set Computer): it is the one used by Intel and AMD, it is about using a set of few instructions, but complex. They have higher consumption of resources, being more complete instructions that require several clock cycles. RISC (Reduced Instruction Set Computer): it is the one used by Apple, Motorola, IBM and PowerPC, these are more efficient processors with more instructions, but less complexity.

Currently both operating systems are compatible because Intel and AMD implement a combination of architectures in their processors.

Instruction execution process

  1. The processor restarts when it receives a RESET signal, in this way the system prepares itself by receiving a clock signal that will determine the speed of the process. In the CP register (program counter) the memory address at which the The control unit (UC) issues the command to fetch the instruction that the RAM has stored in the memory address that is in the CP. Then, the RAM sends the data and it is placed on the data bus until which is stored in the RI (Instruction Register). The UC manages the process and the instruction passes to the decoder (D) to find the meaning of the instruction. This then goes through the UC to be executed.Once it is known what the instruction is and what operation to perform, both are loaded into the ALU input registers (REN).The ALU executes the operation and places the result in the data bus and the CP is added 1 to execute the following instruction.

How to know if a processor is good

To know if a microprocessor is good or bad, we must look at each of its internal components:

Bus width

The width of a bus determines the size of the registers that can circulate through it. This width must match the size of the processor registers. In this way we have that the width of the bus represents the largest register that it is capable of transporting in a single operation.

Directly related to the bus will also be RAM memory, it must be able to store each of these registers with the width they have (this is called the memory word width).

What we currently have when the bus width is 32 bits or 64 bits, that is, we can simultaneously transport, store and process chains of 32 or 64 bits. With 32 bits each having the possibility of being 0 or 1 we can address a quantity of memory of 2 32 (4GB) and with 64 bits 16 EB Exabytes. This does not mean that we have 16 Exabytes of memory on our computer, but rather it represents the ability to manage and use a certain amount of memory. Hence the famous limitation of 32-bit systems to address only 4 GB of memory.

In short, the wider the bus, the more work capacity.

Cache

These memories are much smaller than RAM but much faster. Its function is to store the instructions that are just going to be processed or the last ones processed. The more cache memory, the higher the transaction speed that the CPU can pick up and drop.

Here we must be aware that everything that reaches the processor comes from the hard drive, and this can be said to be tremendously slower than RAM and even more so than cache memory. It is for this reason that these solid-state memories were designed to solve the large bottleneck that is the hard drive.

And we will ask ourselves, why then do they not only manufacture large caches, the answer is simple, because they are very expensive.

Internal processor speed

Internet speed is almost always the most striking thing when looking at a processor. "The processor runs at 3.2 GHz, " but what is this? Speed ​​is the clock frequency at which the microprocessor works. The higher this speed, the more operations per unit of time it will be able to perform. This translates into higher performance, that is why there is a cache memory, to accelerate the data collection by the processor to always do the maximum number of operations per unit of time.

This clock frequency is given by a periodic square wave signal. The maximum time to make an operation is one period. The period is the inverse of the frequency.

But not everything is speed. There are many components that influence the speed of a processor. If for example we have a 4-core processor at 1.8 GHz and another single-core at 4.0 GHz, it is sure that the quad-core is faster.

Bus speed

Just as the speed of the processor is important, the speed of the data bus is also important. The motherboard always works at a much lower clock frequency than the microprocessor, for this reason we are going to need a multiplier that adjusts these frequencies.

If for example we have a motherboard with a bus at a clock frequency of 200 MHz, a 10x multiplier will reach a CPU frequency of 2 GHz.

Microarchitecture

The microarchitecture of a processor determines the number of transistors per unit of distance in it. This unit is currently measured in nm (nanometers) the smaller it is, the greater the number of transistors can be introduced, and, therefore, the greater number of elements and integrated circuits can be accommodated.

This directly influences energy consumption, smaller devices will need less electron flow, so less energy will be needed to perform the same functions as in a larger microarchitecture.

Source: intel.es

Component cooling

Due to the enormous speed reached by the CPU, the current flow generates heat. The higher the frequency and voltage there will be a greater generation of heat, therefore it is necessary to cool this component. There are several ways to do this:

  • Passive cooling: by means of metallic dissipators (copper or aluminum) that increase the surface of contact with the air by means of fins. Active cooling : In addition to the heatsink, a fan is also placed to provide forced air flow between the fins of the passive element.

  • Liquid cooling: it consists of a circuit made up of a pump and a finned radiator. The water is circulated through a block located in the CPU, the liquid element collects the heat generated and transports it to the radiator, which by means of forced ventilation dissipates the heat, again lowering the temperature of the liquid.

Some processors include a heatsink. Normally they are not a big deal… but they serve to get the PC up and running and improve it at the same time

  • Cooling by Heatpipes: the system consists of a closed circuit of copper or aluminum tubes filled with fluid. This fluid collects heat from the CPU and evaporates rising to the top of the system. At this point there is a finned heatsink that exchanges the heat of the fluid from the inside to the outside air, in this way the fluid condenses and drops back down to the CPU block.

We recommend you

This concludes our article on what a processor is and how it works in detail. We hope you liked it.

Tutorials

Editor's choice

Back to top button