CPU internal architecture and how it works (Turn, pretty good)

Source: Internet
Author: User

All the time, I always thought that the CPU is really the combination of various logic gate devices as described in the book on the principle of computer composition in the past year. When you see nanotechnology, do you really think that you can make those devices so small? Until we saw the Intel CPU production process and AMD chip production process of the introduction can not help feeling, the original technology is so developed.

In this paper, we take Intel as an example of the principle of the CPU to do a brief introduction, just a brief introduction, then amd,arm,mips even PowerPC you should be comprehend by analogy.

Remember that is July 18, 1968, Bob-North and Gordon-Moore's new company in the United States, California, the beautiful San Francisco Bay, Mount Villoux City, Mei Multi-toll street, No. 365 opened. and spent $15000 shortly after its founding, buying the right to use Intel's name from a company called Intelco. Intel, the semiconductor giant, began his legendary history in the IT industry.
On November 15, 1971, this day was written as a milestone in the global IT world, and it has been used in many computer-science textbooks. Intel's engineer, Tede Hoff, invented the world's first microprocessor-4004, a 4-bit microprocessor that only has 45 instructions and can execute only 50,000 instructions per second. Not even the world's first computer ENIAC, developed by the U.S. Army, the University of Pennsylvania, in 1946. But its integration is much higher, a 4004 of the weight of less than a cup of the company. He invented the microprocessor and was called "one of the most influential scientists since the Second World War" by the British economist magazine. Intel's CPU development process is shown in the following table:


And the back of Pentium and 4, then to the core, Core 2, here is no longer listed. Intel started with 8086 and entered what we call the x86 era. The birth of 80386 marks the time when Intel is entering a 32-bit microprocessor. From 80386 to Pentium 4 The CPU of this age is the legendary IA-32 era.

We all know that the fundamental task of the CPU is to execute the instruction, and ultimately a sequence of "0" and "1" for the computer. The CPU can be logically divided into 3 modules, namely the control unit, the arithmetic unit and the storage unit, which are connected by the CPU internal bus. As shown below:

Control Unit : control unit is the entire CPU command and control center, by the Instruction register IR (instruction register), the instruction decoder ID (instruction Decoder) and the Operation Controller OC (operation Controller) and so on, is very important to coordinate the whole computer's orderly work. It is based on the user pre-programmed program, sequentially remove the instructions from the memory, placed in the instruction register IR, through instruction decoding (analysis) to determine what should be done, and then through the operation of the controller OC, according to the determined timing, to the corresponding parts issued micro-operation control signal. Operation Controller OC mainly includes the Beat pulse generator, control matrix, clock pulse generator, reset circuit and the control logic such as start-up and power-off road.

The arithmetic unit : is the core of the arithmetic device. You can perform arithmetic operations (including basic operations such as add and subtract multipliers and their additional operations) and logical operations (including shift, logic test, or two value comparisons). In the case of the control unit, the operator accepts the command of the control unit, that is, all operations performed by the unit are directed by the control signal emitted by the control unit, so it is an executing part.

storage Unit : includes the CPU on-chip cache and register group, is the place where the CPU temporarily holds the data, which holds the data that waits to be processed, or the data that has been processed, the CPU accesses the register to spend more time than accesses the memory time. The use of registers can reduce the number of times the CPU accesses memory, thereby improving the CPU's working speed. However, because of the chip area and integration constraints, the capacity of the Register group is not very large. Register groups can be divided into dedicated registers and general-purpose registers. The function of the special register is fixed, and the corresponding data is stored separately. General-purpose registers are widely used and can be prescribed by programmers, and the number of universal registers varies by microprocessor. This is our future to introduce this point, here first mention.

We will refine it, and we can draw a summary of how the CPU works as follows:

Generally speaking, the CPU takes out the instruction and the corresponding data from the memory, and according to the instruction opcode, the data is processed until the execution of the program is complete.
I did not draw the bus, just a logical way to render it. Reasons earlier Intel's microprocessors, such as 8085,8086/8088CPU, generally adopted address bus and data bus multiplexing, and some (or all) of the address bus with the data bus are being shared with some of the CPU's pins. For example 8086 the external address bus has 20, and the data bus multiplexed the first 16 pins of the address bus. The Multiplexed data bus and address bus can reduce the number of pins on the CPU, but introduce the complexity of the control logic and operation sequence. So, since 80286, Intel's CPUs have been using separate address buses and data buses.
Whether it is multiplexing or separate, we understand the operating principle of the CPU has no impact, did not draw the purpose of the bus is to fear that some people too much pursuit of detail, a tie down, can't float up, can not despise the enemy from the macro.
OK, sum up, the principle of the CPU is : The control unit in the action of the timing pulse, the instruction counter point to the instruction address ( This address is in memory) to the address bus up, and then the CPU read the instructions in this address to the instruction register for decoding. For the data to be used in the execution of the instruction, the data address is also sent to the address bus, and the CPU reads the data to the internal storage unit of the CPU ( that is, the internal register) . Finally, the operation unit is ordered to process the data. The cycle, has been so carried out, the everlasting, the sea litter rotten, until the blackout.
If you feel more dizzy about the passage, look at what our teacher says:
1. take command: the controller of the CPU reads an instruction from memory and puts it into the instruction register . The format of the instruction is usually this way:

Operation code is the MOV,ADD,JMP in assembly language. The operand address indicates where the operand of the instruction is located, in memory or in the CPU In the internal register.
2. Instruction decoding: instructions in the instruction register are decoded to determine what action the instruction should take ( is the operation code in the instruction) , where the operand ( the address of the operand).
3.   executes the instruction in two stages "take operand" and "perform operation".
4.   Modify the instruction counter to determine the address of the next instruction.

About the CPU we from the macro grasp to this extent OK, we will step into the micro stage, followed by introducing 80x86 register and its use, NASM assembly and the difference between the T, and C code embedded in the assembly language. The reason for the introduction of assembly language is not to say that the assembly to write code, it is quite unrealistic, unless you are a hardware driver engineer. A slightly higher-level developer knows something low, and it's good for them to understand the architecture and principles of the system.
Not finished, to be continued ...

CPU internal architecture and how it works (Turn, pretty good)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.