[深度文系列] Introduction and analysis of x86 architecture and arm architecture, CISC and RISC

 

As Apple introduced the latest chips based on the ARM architecture, more and more people began to ask what is the difference between the ARM architecture and Intel's x86 architecture. This article will introduce ARM and x86 and explain the differences between the two.

x86 architecture

 


(Source: kknews.cc)

 

x86 is built as a complex instruction set computer (CISC). In the early days, in order to save the programmer’s working time, a single instruction containing complex operation code was developed to simplify the number of program lines required to design a program. At that time, almost all The CPUs are all CISC architecture.

 

Advantage:

The feature of CISC is that it can save engineers a lot of time when developing software, and it can also allow the new system to use a set of instructions that includes the old system, so that the software of the old system can be used on the new system. In short, it is time-saving and easy for engineers who develop software to use the CISC framework.

 

Shortcoming:

In order to pack more instructions into a small CPU, more complex transistors need to be designed on the chip, and more powerful functions mean more complex designs, which will lead to power consumption. , High heat generation, and because of the x86's own design, the decoder will first use the decoder to turn the complex instructions into RISC-like instructions, and then execute them to the core. As a result, the overall execution efficiency will become relatively poor, and the processing data speed will also be slower.

 

ARM architecture


(Source: Apple)

 

ARM is built as a reduced instruction set computer (RISC) architecture. Compared with CISC, the RISC architecture only contains simple and basic instructions. These basic instructions are combined into complex instructions. The most widely used application is on mobile phone chips. The early mobile phone chips Because the function is relatively simple and the volume cannot be too large, a RISC architecture chip that only contains simple basic instructions is more suitable as a computing chip for a mobile phone than a complex CISC architecture chip.

 

Advantage:

Because compared to the x86 architecture, the RISC architecture of ARM does not require complex chip design, so the execution speed of RISC under the same chip conditions is 2-4 times that of CISC. And it can reduce the size of the chip, reduce power consumption, save costs, and improve efficiency, and it can also apply more advanced technologies than CISC to develop next-generation chips. 

 

Shortcoming:

Because ARM is a RISC architecture, there are only basic and simple instructions on the chip, so when engineers write code to perform the same task, the RISC architecture needs to write more programs than the CISC architecture. For example, now we have to write a program to perform the task of "throwing eggs": Under the CISC framework, engineers only need to write a simple instruction like "pick up the egg> throw out the egg" Under the RISC architecture, the engineer needs to decompose the action into multiple steps, which should be written as "stretch the arm toward the egg> grab the egg with the hand> extend the arm back> raise the arm> swing the arm in the direction of the target> hand Let go of the egg". Therefore, engineers will need to spend more time editing the code, and the software development time will increase, and the software capacity will also increase.

 


(Source: macw.com)

 

Summary:

The speed increase brought by the complex instructions used by the X86 architecture has long been offset or even slowed down by the time spent on decoding. In addition, because the chip design of the x86 architecture is more complex, the x86 architecture chip will be made more than the ARM architecture. Wafers are even more difficult to produce. In addition, x86 architecture chips will consume more energy and generate more heat. Therefore, in addition to personal computers currently using x86 because the x86 platform has a large number of compatible software ecosystems, ARM and other RISC architecture instruction sets have become today’s The most popular chip architecture. For example, mobile phones, tablets and the current popular Internet of Things all use the instruction set of the RISC architecture. But then again, although CISC and RISC seem to have two different architectures, with the development of the two, CISC will need to overcome the problems of energy consumption and computing speed; and the design of RISC is also becoming complicated (not Towards the direction of CISC), the boundary between the two will become more and more blurred as the generations change. Perhaps one day in the future, the two will be difficult to distinguish, but it is certain that with the development and collision of the two, faster and more energy-efficient chips will eventually be brought to mankind.