How does the processor work? How does a computer processor work? What kind of data can the cpu work with.

A personal computer is a very complex and multifaceted thing, but in each system unit we will find the center of all operations and processes - a microprocessor. What does a computer processor consist of and what is it for?

Probably, many will be delighted to learn what the microprocessor of a personal computer consists of. It consists almost entirely of ordinary stones and rocks.

Yes, it is ... The processor contains substances such as silicon - the same material that makes up sand and granite rocks.

Hoffa processor

The first microprocessor for a personal computer was invented almost half a century ago - in 1970 by Martian Edward Hoff and his team of engineers at Intel.

Hoff's first processor ran at just 750 kHz.

The main characteristics of a computer processor today, of course, are not comparable with the above figure, the current "stones" are several thousand times more powerful than their ancestor, and before that, it is better to familiarize yourself a little with the tasks that it solves.

Many people assume that processors can "think". I must say right away that there is not a grain of truth in this. Any super-powerful processor of a personal computer consists of many transistors - a kind of switches that perform one single function - to pass the signal further or stop. The choice depends on the signal voltage.

If you look at it from the other side, you can see what the microprocessor consists of, and it consists of registers - information processing cells.

To connect the "stone" with the rest of the personal computer devices, a special high-speed road is used, called a "bus". Tiny electromagnetic signals "fly" along it with lightning speed. This is how the processor of a computer or laptop works.

Microprocessor device

How does a computer processor work? In any microprocessor, 3 components can be distinguished:

  1. The processor core (this is where the separation of zeros and ones occurs);
  2. Cache memory is a small storage of information right inside the processor;
  3. A coprocessor is a special brain center of any processor, where the most complex operations take place. The work with multimedia files is also going on here.

The diagram of a computer processor in a simplified version is as follows:

One of the main indicators of a microprocessor is its clock frequency. It shows how many clock cycles the "stone" performs per second. The power of a computer's processor depends on the combination of the indicators listed above.

It should be noted that at one time the launch of rockets and the operation of satellites were controlled by microprocessors with a clock frequency thousands of times lower than that of their current counterparts. And the size of one transistor is 22nm, the interlayer of transistors is only 1nm. For reference, 1 nm is 5 atoms thick!

Now you know how a computer processor works and what successes have been achieved by scientists working at companies that produce personal computers.

A personal computer consists of many components connected in unified system... The interaction and control between them is carried out thanks to the central processor, it acts as an electronic brain of the PC. Without it, any equipment, be it a laptop, tablet or system unit, is a pile of pieces of iron. Let's take a closer look at how the computer's central processing unit works and what is its structure.

Before proceeding to consider the key characteristics of the CPU, it is necessary to understand what types it is. There are many central processing units or CPUs, as they are called abroad, and they are divided according to the following criteria.

Capacities:

  • There are weak, single-core models, the production of which has been stopped and can be purchased only after a long search;
  • Medium and powerful models with 2 to 16 cores;

By way of application:

  1. Gaming;
  2. Server;
  3. Budgetary;

By manufacturer:

  • Central processing unit from Intel;
  • CPU from AMD;

Note! In addition to Intel and Amdash CPUs, there are products manufactured under the brands of other companies, but they are in little demand, making up a small part of the total volume of goods on the computer hardware market.

Many users mistakenly believe that Intel products differ from AMD only in name, but this is far from the case. The structure of each central processing unit produced under the trademark of these companies differs significantly from the competitors. Due to this, they have their own advantages and disadvantages. For example, Intel products are endowed with the following positive characteristics that distinguish their central processors from AMD:

  1. Most PC component manufacturers tailor their products to Intel CPU standards;
  2. During operation, they consume less energy, reducing the load on the system;
  3. Show more performance when working with one program;
  4. The best choice for gaming assemblies of system blocks;

AMD products also have a number of characteristics that allow them to actively compete in the computer hardware market:

  • Unlike Intel CPUs, AMD CPUs have an overclocking function that increases the original power by up to 20%;
  • The best ratio of price and quality of goods;
  • Graphics cores those built into the CPU have more capabilities than Intel's, allowing you to work faster with video;

CPU description

So, we figured out the types of CPUs and their distinctive features, it's time to move on to the description of the product itself and figure out what it is. For ease of understanding, we will break it down into several points, highlighting in them key features products:

  1. CPU assignment;
  2. Its structure;
  3. Basic characteristics;

With their help, we will understand how the processor works and how it works.

Appointment

The main task of any central processor is the execution of computational processes, with the help of which a set of commands are transmitted to devices, necessary for execution. The commands are located in the PC's RAM and are read by the CPU directly from there. Accordingly, the higher the processing power of the processor, the faster the entire system has.

Structure

The general structure of any central processor consists of the following blocks:

  1. Interface block;
  2. Operating unit;

The interface block contains the following components:

  • Address registers;
  • Memory registers, in which the codes of transmitted commands are stored, the execution of which is planned in the near future;
  • Control devices - with its help, control commands are formed, which are subsequently executed by the CPU;
  • Control circuits responsible for the operation of ports and system buses;

The operating unit includes:

  1. Microprocessor memory. Consists of: segment registers, characteristic registers, registers general purpose and registers counting the number of instructions;
  2. Arithmetic logic unit. With its help, information is interpreted into a set of logical, or arithmetic operations;

Note! The operating unit and the interface unit operate in parallel mode, but the interface part is one step ahead, writing commands to the register block, which are subsequently executed by the operating part.

The system bus is used to transfer signals from the central processor to other components of the device. With each new generation, the structure of the processor changes slightly and recent developments are very different from the first processors used at the dawn of computer technology.

Characteristics

The characteristics of any central processor have a large impact on performance as individual elements system, and the entire complex of devices as a whole. Among the main characteristics that affect performance parameters are:

  • Clock frequency; It takes one clock cycle to process one piece of data transmitted inside the PC. It follows that the higher the clock frequency of the purchased CPU, the faster the device works, processing large amounts of information at a time. The clock frequency is measured in megahertz. One megahertz is equivalent to 1 million ticks per second. Older models had a low frequency, which is why the operating speed left much to be desired. Modern models have high clock rates, allowing you to quickly process and execute the most complex instruction sets.
  • Bit depth; Information intended for processing by the CPU enters it through external buses. How much data is transferred at one time depends on the bit depth. This affects performance. Older models were 16-bit, while modern ones are 32 or 64-bit. 64 discharge system today it is considered the most advanced and modern software products and devices.
  • Kesh - memory; Used to increase the performance of the device in the computer, creating a buffer zone that stores a copy of the last data array processed by the processor. This makes it possible to quickly perform a similar operation if necessary, without wasting time on contacting shared memory personal computer.
  • Socket; Option for attaching the device to the motherboard. Different processor generations, like motherboards have their own supported sockets. This should be considered when buying. Sockets also differ from manufacturer to manufacturer.
  • Internal frequency multiplier; The processor and motherboard operate at different frequencies and there is a frequency multiplier to synchronize them with each other. The base or reference frequency is the operating frequency of the motherboard, which is multiplied by the personal CPU factor.

Of the side characteristics that are not directly related to the production technology, heat generation and the amount of energy consumed during operation are distinguished. Powerful devices generate a lot of heat and require a lot of energy supply during operation. For their full operation, auxiliary cooling systems are used.

Now there is a lot of information on the Internet on the topic of processors, you can find a bunch of articles about how it works, where registers, clocks, interrupts, and so on are mainly mentioned ... But, for a person who is not familiar with all these terms and concepts, it is quite difficult like this "with fly "to delve into the understanding of the process, but you need to start small - namely, with an elementary understanding how the processor is arranged and what main parts does it consist of.

So, what will be inside the microprocessor, if you disassemble it:

the number 1 denotes metal surface(cover) of the microprocessor for heat dissipation and protection against mechanical damage what is behind this cover (that is, inside the processor itself).

Number 2 is the crystal itself, which in fact is the most important and expensive part of the microprocessor to manufacture. It is thanks to this crystal that all calculations take place (and this is the most important function of the processor) and the more complex it is, the more perfect it is, the more powerful the processor is and the more expensive it is, respectively. The crystal is made from silicon. In fact, the manufacturing process is very complex and contains dozens of steps, more details in this video:

Number 3 is a special textolite substrate, to which all other parts of the processor are attached, in addition, it plays the role of a contact pad - there is a large number of golden "dots" are contacts (you can see them a little in the figure). Thanks to the contact area (substrate), close interaction with the crystal is ensured, since it is not possible to directly influence the crystal in any way.

The cover (1) is fixed to the substrate (3) with a high temperature resistant adhesive sealant. There is no air gap between the crystal (2) and the lid, its place is taken by thermal grease, when solidified, it forms a "bridge" between the processor crystal and the lid, which ensures a very good heat outflow.

The crystal is connected to the substrate using soldering and sealant, the contacts of the substrate are connected to the contacts of the crystal. This figure clearly shows how the contacts of the crystal are connected to the contacts of the substrate using very thin wires (in the photo, 170x magnification):

In general, the device of processors from different manufacturers and even models from the same manufacturer can vary greatly. but circuit diagram work remains the same - all have a contact substrate, a crystal (or several located in one case) and a metal cover for heat dissipation.

This is how a contact substrate looks like Intel processor Pentium 4 (processor upside down):

The shape of the contacts and the structure of their arrangement depend on the processor and the computer motherboard (the sockets must match). For example, in the figure just above, the processor pins are without "pins", since the pins are located directly in the motherboard socket.

And there is another situation where the "pins" of the contacts stick out directly from the contact substrate. This feature is typical mainly for AMD processors:

As mentioned above, the device different models processors from one manufacturer may differ, we have a vivid example of this - a quad-core processor Intel Core 2 Quad, which is essentially 2 dual-core processors of the core 2 duo line, combined in one case:

Important! The number of crystals inside a processor and the number of processor cores are not the same.

In modern models of Intel processors, 2 crystals (chips) fit at once. The second chip is the graphics core of the processor, in fact, it plays the role of a video card built into the processor, that is, even if the system is absent, the graphics core will take on the role of a video card, and quite powerful (in some processor models, the computing power of graphics cores allows you to play modern games on medium graphics settings).

That's all central microprocessor device, in short, of course.

The processor is the main part of any computing device. But many users have very little understanding of what a processor is in a computer and what function it performs. Although in modern world this is important information, knowing that many serious misconceptions can be avoided. If you want to know more about the chip that powers your computer, you've come to the right place. In this article, you will learn what a processor is for and how it affects the performance of the entire device.

What is central processing unit

IN this case, we are talking about the central processing unit. After all, there are others in the computer, for example, a video processor.

The central processing unit is the main part of a computer, which is an electronic unit or an integrated circuit. It executes machine instructions, or program code, and is the backbone of a device's hardware.

Simply put, it is the heart and brain of the computer. It is thanks to him that everything else works, he processes data streams and manages the work of all parts common system.

Physically, the processor is a small, thin, square board. It has a small size and is covered with a metal cover on top.

The bottom of the chip is occupied by contacts through which the chipset communicates with the rest of the system. Opening the lid of the system unit of your computer, you can easily find the processor, unless it is covered by a cooling system.

Until the CPU issues the appropriate command, the computer will not be able to perform even the simplest operation, such as adding two numbers. Whatever you want to do on your PC, any action involves accessing the processor. That is why it is such an important part of the computer.

Modern central processors are able not only to cope with their main tasks, but can also partially replace the video card. New chips are released with a separate space for video controller functions.

This video controller performs all the basic necessary actions that are required from a video card. In this case, RAM is used as video memory. But do not be mistaken that a powerful modern processor can completely replace a video card.

Even middle class video cards leave the video controller processors far behind. So, the option of a computer without a video card is suitable only for office devices that do not imply the implementation of any difficult tasks related to graphics.

In such cases, there really is an opportunity to save money. After all, you can just have a processor chipset with a good video controller and not spend money on a video card.

How the processor works

We sort of figured out what a processor is. But how does it work? It is a long and difficult process, but if you understand it, everything is quite easy. The principle of operation of the central processor can be considered in stages.

First, the program is loaded into RAM, from where it gets all the necessary information and a set of commands that must be executed by the processor control unit. Then all this data goes into the buffer memory, the so-called processor cache.

Information comes out of the buffer, which is divided into two types: instructions and values. Both those and those fall into the registers. Registers are memory locations built into the chipset. They also come in two flavors, depending on the type of information they receive: instruction registers and data registers.

One of the constituent parts of the CPU is the arithmetic logic unit. It deals with performing transformations of information using arithmetic and logical calculations.

This is where the data from the registers comes in. After that, the arithmetic logic unit reads the incoming data and executes the commands that are necessary to process the resulting numbers.

Here again, a split awaits us. Final results are divided into finished and unfinished. They go back to the registers, and the finished ones go to the buffer memory.

The processor cache consists of two main levels: upper and lower. The most recent commands and data are sent to the top cache, and those that are not used go to the bottom.

That is, all the information on the third level is moved to the second, from which, in turn, the data goes to the first. And the unnecessary data, on the contrary, is sent to the lower level.

After the computing cycle is over, its results are again recorded in the computer's RAM. This is done so that the CPU cache is freed and available for new operations.

But sometimes there are situations when the buffer memory is completely full, and there is no room for new operations. In this case, the data that is not currently being used goes to the RAM or to the lower level of the processor's memory.

Types of processors

Having figured out how the CPU works, it's time to compare different types of it. There are many types of processor. There are both weak single-core models and powerful devices with many cores. There are those that are designed exclusively for office work, and there are those that are necessary for the most modern games.

There are currently two main processor makers - AMD and Intel. It is they who produce the most relevant and demanded chips. You need to understand that the difference between the chips of these two companies is not in the number of cores or overall performance, but in the architecture.

That is, the products of these two companies are built on different principles. And each creator has his own unique type of processor, which has a structure different from the competitor.

It should be noted that both options have their own strengths and weaknesses. For example, Intel differ in the following pluses :

  • Less energy consumption;
  • Most hardware developers focus specifically on interaction with Intel processors;
  • In games, the performance is higher;
  • Intel is easier to interact with the computer's RAM;
  • Operations performed with only one program are faster on Intel.

At the same time, there are also their own minuses :

  • Typically the cost Intel chipsets more expensive than AMD analog;
  • When working with several heavy programs, performance drops;
  • The graphics cores are weaker than those of the competitor.

AMD differ in the following advantages:

  • Much better value for money;
  • Capable of ensuring reliable operation of the entire system;
  • There is an opportunity to overclock the processor, increasing its power by 10-20%;
  • More powerful integrated graphics cores.

However, AMD is inferior in the following parameters:

  • Interaction with RAM is worse;
  • More power is spent on the processor;
  • Frequency of work on the second and third levels buffer memory below;
  • In games, performance is lower.

While their pros and cons stand out, companies continue to release best processors... You just have to choose which one is preferable for you. After all, it is impossible to say unequivocally that one firm is better than another.

Main characteristics

So, we have already figured out that one of the main characteristics of a processor is its developer. But there are a number of parameters that you need to pay even more attention to when buying.

Let's not stray too far from the brand, and mention that there are different series of chips. Each manufacturer produces its own lines in different price categories, created for different tasks. Another related parameter is CPU architecture. In fact, these are his internal organs, on which the entire operation of the chip depends.

Not the most obvious, but very important parameter is the socket. The fact is that on the processor itself, the socket must match the corresponding socket on the motherboard.

Otherwise, you will not be able to combine these two essential components of any computer. So, when assembling a system unit, you either need to buy a motherboard and look for a chipset for it, or vice versa.

Now it's time to figure out which characteristics of the processor affect its performance. Without a doubt, the main one is the clock speed. This is the amount of operations that can be performed in a given unit of time.

This indicator is measured in megahertz. So what does the chip's clock speed affect? Since it indicates the number of operations in a certain time, it is not difficult to guess that the speed of the device depends on it.

Another important indicator is the amount of buffer memory. As mentioned earlier, it is top and bottom. It also affects processor performance.

A CPU can have one or more cores. Multi-core models are more expensive. But what does the number of cores affect? This characteristic determines the power of the device. The more cores, the more powerful the device.

Output

The central processor plays not only one of the most important, but even the main role in the operation of a computer. The performance of the entire device will depend on it, as well as the tasks for which it is generally possible to use it.

But that doesn't mean you have to buy the most powerful processor for your average computer. Find the perfect model for your needs.

You are reading these lines from your smartphone, tablet or computer. Any of these devices are based on a microprocessor. The microprocessor is the heart of any computing device. There are many types of microprocessors, but they all perform the same tasks. Today we will talk about how the processor works and what tasks it performs. At first glance, all this seems obvious. But many users would be interested in deepening their knowledge of the most important component that ensures the operation of a computer. We will learn how technology based on simple digital logic allows your computer to not only solve math problems, but also be an entertainment center. How are just two numbers - one and zero - transformed into colorful games and movies? Many have asked themselves this question many times and will be happy to receive an answer. After all, even at the base of recently us AMD processor Jaguar, on which the latest game consoles are based, follows the same ancient logic.

In English literature, a microprocessor is often referred to as a CPU (central processing unit). The reason for this name lies in the fact that a modern processor is a single chip. The first microprocessor in the history of mankind was created by the corporation back in 1971.

Intel's role in the history of the microprocessor industry


We are talking about the Intel 4004 model. It was not powerful and only knew how to perform addition and subtraction. At the same time, he could process only four bits of information (that is, it was 4-bit). But for its time, its appearance was a significant event. After all, the entire processor fits into one chip. Before the advent of the Intel 4004, computers were based on a whole set of chips or discrete components (transistors). The 4004 microprocessor formed the basis of one of the first portable calculators.

The first microprocessor for home computers was the Intel 8080, introduced in 1974. All the processing power of an 8-bit computer was contained in a single chip. But the announcement of the Intel 8088 processor was really important. It appeared in 1979 and since 1981 began to be used in the first mass personal computers IBM PC.

Further, the processors began to develop and gain power. Anyone who is at least a little familiar with the history of the microprocessor industry will remember that 8088 was replaced by 80286. Then came 80386, followed by 80486. Then there were several generations of Pentiums: Pentium, Pentium II, III and Pentium 4. All this Intel processors based on the basic 8088 design. They were backward compatible. This means that the Pentium 4 could process any piece of code for the 8088, but it did it at a speed that increased about five thousand times. Not so many years have passed since then, but several more generations of microprocessors have changed.


Since 2004, Intel has started offering multi-core processors. The number of transistors used in them has increased by millions. But even now, the processor obeys general rules that were created for early chips. The table shows the history of Intel microprocessors up to and including 2004. We will make some explanations of what the indicators reflected in it mean:
  • Name Processor model
  • Date The year the processor was first introduced. Many processors were introduced multiple times, each time their clock speed was increased. Thus, the next modification of the chip could be re-announced even several years after its first version appeared on the market.
  • Transistors The number of transistors in the chip. You can see that this figure has been steadily increasing.
  • Microns (Width in microns). One micron is equal to one millionth of a meter. This value is determined by the thickness of the thinnest wire in the chip. In comparison, a human hair is 100 microns thick.
  • Clock speed. Maximum processor speed
  • Data Width. "Bitness" of the arithmetic-logical unit of the processor (ALU, ALU). An 8-bit ALU can add, subtract, multiply, and do other things on two 8-bit numbers. 32-bit ALU can work with 32-bit numbers. To add two 32-bit numbers, an eight-bit ALU needs to execute four instructions. A 32-bit ALU will handle this task in one instruction. In many (but not all) cases, the width external bus data coincides with the "bitness" of the ALU. The 8088 had a 16-bit ALU, but an 8-bit bus. For late Pentiums, a situation was typical when the bus was already 64-bit, and the ALU was still 32-bit
  • MIPS (Millions of instructions per second). Allows you to roughly estimate the performance of the processor. Modern microprocessors perform so many different tasks that this indicator has lost its original value and can be used mainly to compare the processing power of several processors (as in this table)

There is a direct relationship between clock speed, as well as the number of transistors and the number of operations performed by the processor per second. For example, the clock speed of the 8088 processor reached 5 MHz, and the performance: only 0.33 million operations per second. That is, it took about 15 processor cycles to execute one instruction. In 2004, processors were already able to execute two instructions per clock cycle. This improvement was brought about by increasing the number of processors in the chip.

A chip is also called an integrated circuit (or just a microcircuit). Most often it is a small and thin silicon plate, into which transistors are "imprinted". A chip whose side reaches two and a half centimeters can contain tens of millions of transistors. The simplest processors can be squares with sides as small as a few millimeters. And this size is enough for several thousand transistors.

Microprocessor logic


To understand how a microprocessor works, one should study the logic on which it is based, as well as become familiar with assembly language. This is the native language of the microprocessor.

A microprocessor is capable of executing a specific set of machine instructions (instructions). Operating with these commands, the processor performs three main tasks:

  • Using its arithmetic logic device, the processor performs mathematical operations: addition, subtraction, multiplication and division. Modern microprocessors fully support floating point operations (using a dedicated floating point arithmetic processor)
  • The microprocessor is capable of moving data from one type of memory to another
  • The microprocessor has the ability to make a decision and, based on its decision, "jump", that is, switch to the execution of a new set of instructions

The microprocessor contains:

  • Address bus This bus can be 8, 16, or 32 bits wide. She deals with sending the address into memory
  • Data bus: 8, 16, 32 or 64 bits wide. This bus can send data to memory or receive data from memory. When talking about the "bitness" of the processor, we are talking about the width of the data bus
  • RD (read) and WR (write) channels, providing interaction with memory
  • Clock line, providing processor clocks
  • Reset line, which resets the command counter and restarts the execution of instructions

Since the information is rather complex, we will proceed from the fact that the width of both buses - the address and data buses - is only 8 bits. And let's take a quick look at the components of this relatively simple microprocessor:

  • Registers A, B and C are logic chips used for intermediate data storage
  • Address latch is similar to registers A, B and C
  • The command counter is logic chip(latch) capable of incrementing the value by one in one step (if it receives the corresponding command) and zeroing the value (provided that the corresponding command is received)
  • ALU (Arithmetic Logic Unit) can perform addition, subtraction, multiplication and division between 8-bit numbers, or act as a normal adder
  • The test register is a special latch that stores the results of the comparisons performed by the ALU. Usually ALU compares two numbers and determines if they are equal or if one of them is greater than the other. The test register is also capable of storing the carry bit of the last adder action. It stores these values ​​in a trigger circuit. In the future, these values ​​can be used by the command decoder to make decisions.
  • The six blocks in the diagram are labeled "3-State". These are sort buffers. Multiple output sources can be wired, but the sort buffer allows only one of them (at a time) to pass a value: "0" or "1". Thus, the sort buffer can pass values ​​or overlap the output source's ability to transfer data.
  • The instruction register and instruction decoder keep all of the above components under control.

This diagram does not show the control lines of the command decoder, which can be expressed in the form of the following "orders":

  • "Register A to accept the value arriving in currently from the data bus "
  • "Register B to accept the value currently coming from the data bus"
  • "Register C to accept the value currently coming from the arithmetic logic unit"
  • "Register the command counter to take the value currently coming from the data bus"
  • "To the address register, take the value currently coming from the data bus"
  • "The command register to take the value currently coming from the data bus"
  • "Increase the value of the command counter [by one]"
  • "Command counter to reset to zero"
  • "Activate one of six sort buffers" (six separate control lines)
  • "Tell the arithmetic logic device what operation to perform"
  • "For the test register, accept test bits from the ALU"
  • "Activate RD (read channel)"
  • "Activate WR (record channel)"

The command decoder receives data bits from the test register, the synchronization channel, and also from the command register. If we simplify the description of the instructions decoder tasks as much as possible, then we can say that it is this module that "prompts" the processor what needs to be done at the moment.

Microprocessor memory


Familiarity with computer memory and its hierarchy will help you better understand the contents of this section.

Above, we wrote about buses (address and data), as well as read (RD) and write (WR) channels. These buses and channels are connected to memory: random access memory (RAM, RAM) and read-only memory (ROM, ROM). In our example, we consider a microprocessor, each bus width of which is 8 bits. This means that it is capable of addressing 256 bytes (two to the eighth power). At one point in time, it can read or write 8 bits of data from memory. Suppose this simple microprocessor has 128 bytes of ROM (starting at address 0) or 128 bytes random access memory(starting from address 128).

A read-only memory module contains a predefined, fixed set of bytes. The address bus asks the ROM for a specific byte that should be transferred to the data bus. When the read channel (RD) changes its state, the ROM module provides the requested byte to the data bus. That is, in this case, only data reading is possible.

The processor can not only read information from the RAM, it can also write data to it. Depending on whether it is reading or writing, the signal comes either through the read channel (RD) or through the write channel (WR). Unfortunately, RAM is volatile. When the power is turned off, it loses all data stored in it. For this reason, the computer needs non-volatile read-only memory.

Moreover, theoretically, a computer can do without RAM at all. Many microcontrollers allow you to place the necessary data bytes directly into the processor chip. But it is impossible to do without ROM. In personal computers, ROM is called the basic input and output system (BSVV, BIOS, Basic Input / Output System). At startup, the microprocessor begins its work by executing the commands it finds in the BIOS.

BIOS commands test the hardware of the computer, and then they call hard disk and select the boot sector. This boot sector is a separate small program that the BIOS first reads from disk and then places in RAM. After that, the microprocessor starts executing commands located in the RAM boot sector. The boot sector program tells the microprocessor which data (intended for subsequent execution by the processor) should be additionally moved from hard disk into RAM. This is how the process of loading the operating system by the processor takes place.

Microprocessor instructions


Even the simplest microprocessor can handle a fairly large set of instructions. A set of instructions is a kind of template. Each of these instructions loaded into the instruction register has a different meaning. It is not easy for humans to memorize a sequence of bits, so each instruction is described as a short word, each of which represents a specific instruction. These words make up the processor's assembly language. The assembler translates these words into a processor-friendly binary code language.

Here is a list of assembly language instructions for a conditional simple processor, which we are considering as an example for our narrative:

  • LOADA mem - Load register A from some memory address
  • LOADB mem - Load register B from some memory address
  • CONB con - Load constant value into register B
  • SAVEB mem - Save (save) the value of register B in memory at a specific address
  • SAVEC mem - Save (save) the value of register C in memory at a specific address
  • ADD - Add (add) the values ​​of the registers A and B. Save the result of the action in the register C
  • SUB - Subtract (subtract) the value of register B from the value of register A. Save the result of the action in register C
  • MUL - Multiply (multiply) the values ​​of the registers A and B. Save the result of the action in the register C
  • DIV - Divide the value of register A by the value of register B. Save the result of the action in register C
  • COM - Compare (compare) the values ​​of the registers A and B. Transfer the result to the test register
  • JUMP addr - Jump to the specified address
  • JEQ addr - If the condition of equality of the values ​​of two registers is met, jump to the specified address
  • JNEQ addr - If the condition of equality of the values ​​of the two registers is not met, jump to the specified address
  • JG addr - If the value is greater, jump to the specified address
  • JGE addr - If value is greater than or equal, jump to the specified address
  • JL addr - If the value is less, jump to the specified address
  • JLE addr - If value is less than or equal, jump to the specified address
  • STOP - Stop (stop) execution

English words denoting the performed actions in brackets are given for a reason. So we can see that the assembly language (like many other programming languages) is based on English, that is, on the familiar means of communication of those people who created digital technologies.

The work of the microprocessor on the example of calculating the factorial


Let's consider the work of a microprocessor on a specific example of its execution of a simple program that calculates the factorial of the number "5". First, let's solve this problem "in a notebook":

factorial of 5 = 5! = 5 * 4 * 3 * 2 * 1 = 120

In the C programming language, this piece of code performing this calculation will look like this:

A = 1; f = 1; while (a

When this program finishes its work, the variable f will contain a factorial value of five.

The C compiler translates (i.e. translates) this code into a set of assembly language instructions. In the processor we are considering, the RAM starts at address 128, and the read-only memory (which contains the assembly language) starts at address 0. Therefore, in the language this processor this program will look like this:

// Suppose a is at address 128 // Suppose F at address 1290 CONB 1 // a = 1; 1 SAVEB 1282 CONB 1 // f = 1; 3 SAVEB 1294 LOADA 128 // if a> 5 the jump to 175 CONB 56 COM7 JG 178 LOADA 129 // f = f * a; 9 LOADB 12810 MUL11 SAVEC 12912 LOADA 128 // a = a + 1; 13 CONB 114 ADD15 SAVEC 12816 JUMP 4 // loop back to if17 STOP

Now the next question arises: how do all these commands look in permanent memory? Each of these instructions should be presented in the form binary number... To simplify understanding of the material, let's assume that each of the assembly language instructions of the processor we are considering has a unique number:

  • LOADA - 1
  • LOADB - 2
  • CONB - 3
  • SAVEB - 4
  • SAVEC mem - 5
  • ADD - 6
  • SUB - 7
  • MUL - 8
  • DIV - 9
  • COM - 10
  • JUMP addr - 11
  • JEQ addr - 12
  • JNEQ addr - 13
  • JG addr - 14
  • JGE addr - 15
  • JL addr - 16
  • JLE addr - 17
  • STOP - 18

// Suppose a at address 128 // Suppose F at address 129Addr machine instruction / value 0 3 // CONB 11 12 4 // SAVEB 1283 1284 3 // CONB 15 16 4 // SAVEB 1297 1298 1 // LOADA 1289 12810 3 // CONB 511 512 10 // COM13 14 // JG 1714 3115 1 // LOADA 12916 12917 2 // LOADB 12818 12819 8 // MUL20 5 // SAVEC 12921 12922 1 // LOADA 12823 12824 3 // CONB 125 126 6 // ADD27 5 // SAVEC 12828 12829 11 // JUMP 430 831 18 // STOP

As you can see, seven lines of C code have been converted to 18 lines of assembly language. They took 32 bytes in ROM.

Decoding


The conversation about decoding will have to start with a consideration of philological issues. Alas, not all computer terms have unambiguous matches in Russian. The translation of terminology was often spontaneous, and therefore one and the same English term can be translated into Russian in several ways. And so it happened with the most important component of the microprocessor logic "instruction decoder". Computer experts call it both an instruction decoder and an instruction decoder. None of these variants of the name can be called neither more nor less "correct" than the other.

An instruction decoder is needed to translate each machine code into a set of signals that drive the various components of the microprocessor. If we simplify the essence of his actions, then we can say that it is he who will coordinate “software” and “hardware”.

Let's consider the operation of the command decoder using the example of the ADD instruction performing the addition action:

  • During the first clock cycle of the processor, the instruction is loaded. At this stage, the command decoder needs to: activate the sort buffer for the command counter; activate the read channel (RD); activate the sort buffer latch to skip input data into the command register
  • During the second processor clock cycle, the ADD instruction is decoded. At this point, the arithmetic logic unit performs the addition and transfers the value to register C
  • During the third cycle of the processor clock frequency, the instruction counter increases its value by one (theoretically, this action intersects with what happened during the second cycle)

Each command can be represented as a set of sequential operations that manipulate the components of the microprocessor in a specific order. That is, the program instructions lead to quite physical changes: For example, changing the position of the latch. Some instructions may require two or three processor clock cycles to complete. Others may even need five or six cycles.

Microprocessors: Performance and Trends


The number of transistors in a processor is an important factor in its performance. As shown earlier, the 8088 required 15 clock cycles to execute a single instruction. And to perform one 16-bit operation, it took about 80 cycles altogether. This is how the ALU multiplier of this processor was arranged. The more transistors and the more powerful the ALU multiplier, the more the processor manages to do in one cycle.

Many transistors support pipelining technology. In the framework of a pipelined architecture, there is a partial overlap of executable instructions on top of each other. An instruction may require the same five cycles to execute, but if the processor simultaneously processes five instructions (at different stages of completion), then, on average, one instruction will take one cycle of the processor clock frequency to execute.

Many modern processors have more than one instruction decoder. And each of them supports pipelining. This allows more than one instruction to be executed per processor cycle. This technology requires an incredible array of transistors.

64-bit processors


Although 64-bit processors became widespread only a few years ago, they have been around for a relatively long time: since 1992. Both Intel and AMD currently offer such processors. A 64-bit processor can be considered a processor that has a 64-bit arithmetic logic unit (ALU), 64-bit registers and 64-bit buses.

The main reason why processors need 64-bit is because this architecture expands the address space. 32-bit processors can only access two or four gigabytes of RAM. Once these figures seemed gigantic, but the years have passed and today you will not surprise anyone with such a memory. A few years ago a memory ordinary computer was 256 or 512 megabytes. In those days, the 4GB limit only hindered servers and machines running large databases.

But very quickly it turned out that even ordinary users sometimes lack either two or even four gigabytes of RAM. This annoying limitation does not apply to 64-bit processors. The address space available to them these days seems infinite: two to the sixty-fourth power of bytes, that is, something like a billion gigabytes. In the foreseeable future, such a gigantic RAM is not expected.

The 64-bit address bus, as well as the wide and high-speed data buses of the corresponding motherboards, allow 64-bit computers to increase the speed of data input and output when interacting with devices such as HDD and a video card. These new capabilities significantly increase the performance of modern computing machines.

But not all users will experience the advantages of the 64-bit architecture. It is necessary, first of all, for those who are engaged in video and photo editing, as well as work with various large pictures. 64-bit computers are highly appreciated by connoisseurs computer games... But those users who, using a computer, simply communicate in social networks and roam the web and edit text files most likely, they simply will not feel any advantages of these processors.

Based on materials from computer.howstuffworks.com