Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The relationship among CPU, MCU, PLC, DSP, SOC, FPGA, etc.

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The relationship between them

CPU is the most basic existence, for some reasons, some additional functions are packaged on the outside of CPU, together with CPU to form these chips such as MCU, DSP, SOC, etc., so they are all extended from CPU. The basic relationship can be understood as the following figure.

As for why MCU, DSP, SOC and other chips have built-in functional extensions on the basis of CPU, other functions naturally have their own purpose and reason, which will be explained for each chip later.

9.2 CPU chip

The full name of CPU is Central Processing Unit, literally translated as "central processing unit" or central processing unit, no matter what type of computer must include CPU, because the arithmetic unit and controller in CPU are the brain center of the whole computer.

9.2.1 under what circumstances is CPU a stand-alone chip

When we need extremely high performance CPU, we must make CPU into a single chip, because the number of gate circuits per unit area is limited, so if CPU and many other built-in extensions are integrated together, like MCU, DSP and SOC, when the chip size is about the same, the number of gate circuits contained in the single CPU chip must be higher than that in the built-in CPU of MCU, DSP and SOC. Therefore, the CPU will be integrated into a separate chip. And it will be more flexible to extend the function of independent CPU chips.

9.2.2 which computers use separate pieces of CPU

Nowadays, computers such as personal computers and servers require higher computing power, so at present, the CPU of personal computers and servers are independent chips. We all know that the chips of personal computers and servers use most of Intel's X86 (full name 80x86) series, so intel's CPU for personal computers and servers are basically independent chips.

9.2.3 using CPU independent chips will make the computer larger and not suitable for portable devices.

If CPU is an independent core chip, many of the extension functions of CPU need to be achieved by external extension, so this will lead to larger computers such as personal computers and servers. At present, there are more and more portable computer devices, such as mobile phones, digital cameras, tablets and so on. In order to be easy to carry, there are higher requirements for volume, so in order to reduce the volume, many external extensions of CPU, which originally occupy a lot of volume, are directly integrated with CPU into a very small chip, that is, MCU, PLC, DSP, SOC and other chips we mentioned earlier. But the price is that the computing power of the built-in CPU in the chip is reduced, but for many mobile computer devices, you don't need the same computing power as a PC or server, as long as you can make phone calls, watch video, listen to music, play mobile games (big games that can only be played by pc), and so on.

9.3 MCU chip

9.3.1 MCU nouns

The English full name of MCU is Microcontroller Unit, literally translated as "micro-control unit", also known as Single Chip Microcomputer, literally translated as "single-chip microcomputer", referred to as single-chip microcomputer, the simplest understanding is that a chip is a microcomputer.

9.3.1 the difference between CPU chip and MCU chip

From the picture above, you can roughly see the difference between CPU and MCU, but if you want to understand the details of MCU, such a simple comparison is not enough.

9.3.2 structure of PC

In order to understand the MCU, we need to start with the internal structure of the PC, and then draw out the MCU by comparison.

The main results are as follows: (1) for computers with high computing performance, such as PC, their components are separated, because the computing power of PC is very high, so the CPU processing capacity of PC is very strong, and it is an independent core, and the capacity of memory and memory is very large.

(2) No matter what kind of computer, it must contain CPU, three major buses (address / data / control), peripheral IO interface, memory and external memory, among which memory and external memory are the external devices that must be included, because there must be storage devices for storing programs and data.

(3) other external devices such as sound cards and speakers, graphics cards and monitors, network cards and network cables, etc., vary from computer to computer for different purposes.

9.3.3 MCU

(1) many electronic devices have low requirements for computing power, but high volume requirements.

In order to have higher computing power, the components of large computers such as PC are separated and constructed, which gains computing power but sacrifices volume. But for small electronic devices such as electric toys and home appliance controllers, they do not need any computing power and care more about volume, so there is the emergence of MCU (single chip microcomputer). MCU is a chip-level computer.

(2) similarities and differences between MCU and PC

1) similarities: all must contain core things such as CPU, three major buses (address / data / control), IO interface, memory and memory.

1) differences

(a) the single-chip computer integrates CPU, three main buses (address / data / control), IO interface, memory and external memory together, and PC is separate.

(B) for its own special purpose, MCU will also integrate external devices such as serial port, timer, AD/DA and so on.

Serial port, SPI, 12C these three kinds of peripherals are the three common serial communication modes of MCU. If you are interested in serial port, SPI, I2C, follow-up MCU courses.

(3) characteristics of MCU

The main results are as follows: 1) the single-chip microcomputer chip can not work directly, so we must design the external circuit (at least the power supply circuit) and burn the program before it can work.

2) advantages and disadvantages of MCU

(a) advantages: small size, low price, a single chip is a tiny computer, easy to use

(B) disadvantages: because of its small size, the CPU, memory and memory of MCU must be much worse than those of PC, sacrificing computing power for volume advantage.

3) Application

For many simple applications, such as toys, household appliances (rice cookers) and other minicomputer devices that require very low computing power, the computing function of MCU is enough, the key is cheap, and the price is prominent for products that are sensitive to cost control.

(4) MCU summary

So MCU is a chip that integrates CPU, three buses (address / data / control), IO, memory, external memory, and some special peripherals. This is MCU, one chip per machine.

(5) Why is MCU used so much now?

Because after you get the cpu, although the computing power of the CPU alone is very strong, you still have to design a large number of external devices for CPU, and the development difficulty goes up to a level directly, which is not suitable for many occasions where you do not need too much computing power. CPU, which uses independent chips with strong computing power, is simply killing a chicken. The key is that after you get it, you still need to design complex circuits for it. In order to expand many of the minimum peripherals (memory, etc.), the design cost is very high.

But the MCU chip integrates all the basic things needed for calculation at one time, and the difficulty of development drops sharply after you get it, so for the occasions where the functional requirements are not high and the cost control is strict, it is obvious that the use of single-chip microcomputer development is an inevitable choice.

(6) Classification of MCU

1) low and middle section

Low-end single-chip microcomputer such as 8051, middle-end single-chip microcomputer such as stm32, low-end mainly used for home appliances, toys and other low-cost, computing power requirements are not high electronic devices.

2) High-end

The chips of Series A (Cortex-A8,Cortex-A89, etc.) in ARM are typically high-end MCU, which are mainly used in consumer electronics, such as mobile phones, tablets and digital cameras.

(7) now commonly mentioned single-chip microcomputer, the default refers to the low-and middle-end single-chip microcomputer.

Generally speaking, when we say single-chip microcomputer, the default refers to the low-and middle-end MCU, generally do not call high-end MCU as single-chip microcomputer, but directly use their model names, such as ARM Cortex-A7, Cortex-A8, Cortex-A9,Cortex-A15 and so on.

(8) embedded development and MCU

Embedded development involves computer chips such as MCU, from low-end to high-end, and there are many kinds of MCU. I will not repeat them here, because they will be discussed in detail in the following single-chip microcomputer courses.

For real embedded developers, they must have the ability to use low, middle and high-end MCU. For those who want to learn embedded technology, please see the following technical courses.

9.4 PLC

PLC, English for Programmable Logic Controller, literally translated as "programmable logic controller", straightforward understanding is a programmable control device, is specially used in the industrial environment of electronic control equipment, from the word "electronic control device" can be seen, in fact, PLC is not a chip, but a device.

So how did PLC come into being? We need to start with the shortcomings of using MCU to design industrial control equipment.

9.4.1 disadvantages of using MCU directly to design industrial control equipment

As I said earlier when talking about MCU, we can use MCU to design industrial control equipment. After purchasing MCU chip, we can design industrial control equipment with a certain function from beginning to end, but it is very difficult to do so. These problems lead to high cost and high risk.

(1) problem 1: long cycle

From beginning to end, you have to design circuit schematics, draw PCB boards, solder components, write and debug programs, and there is a test cycle after product release, so companies that do industrial control equipment directly use MCU to design from scratch, and the development cycle is really too long.

(2) problem 2: the design is difficult and the stability is not high.

Many industrial control R & D companies are not professional MCU development companies, so MCU development technology is not mature, coupled with the complex operating environment of industrial equipment, such as high voltage, high dust, high vibration, high radiation, etc., the demand for equipment stability is very high, MCU development experience is inexperienced companies, it is difficult to develop high stability industrial control equipment.

(3) question 3: high cost

For the first and second reasons, if you directly use MCU to develop from scratch, the cost is very high, and the key is that you can't develop good equipment yet.

9.4.2 appearance of PLC

(1) how does PLC solve the above problems?

Experienced and professional MCU designers who are very familiar with industrial control equipment have come forward and designed a semi-finished MCU industrial control equipment with high stability, graphical programming and basic functions. after others get this stable and mature semi-finished equipment, they can easily expand their own unique industrial control equipment.

(2) the advantages of PLC, a semi-finished industrial control equipment.

As mentioned earlier, PLC is not a chip. PLC is just a semi-finished electronic industrial control device designed with MCU chip. The key is that you can use this device to expand its function. The way to expand is to plug in various power lines. The physical picture of PLC is as follows.

Mitsubishi PLC equipment in Japan

Using PLC to design industrial control has the following advantages:

1) there is no need to develop from scratch: that is to say, others have done all the core equipment hardware to help you implement the most difficult and complex parts.

2) the hardware expansion is simple and easy: the hardware expansion is very easy, and it can be expanded by connecting the external control device directly through the "function expansion wiring screw".

3) programming is easy: at the time of design, PLC has transformed the program code of various functions at the bottom into a variety of intuitive graphic symbols (ladder diagrams), which can be programmed directly through the drawing of these ladder diagrams, and there will be corresponding software to transform the ladder diagram into MCU computer instructions that need to be executed finally.

Ladder diagram

4) High degree of stability: because it is specially designed for industrial control, it has strong stability and is enough to cope with all kinds of complex situations in industry.

9.5 Soc chip

In fact, many people's understanding of the SOC chip is wrong, so it is also through this section of the explanation, I hope you can figure out what is SOC.

The English full name of SoC is System-on-a-chip, literally translated as "system on a chip". It is difficult to understand what SoC is directly from the name, but it is also difficult to explain what a SOC chip is.

In fact, SOC and MCU have a great relationship, so if we can not explain the relationship between the two, we can not understand the SOC, we need to start with MCU.

9.5.1 Let's start with MCU

(1) in fact, MCU chip is a general purpose computer chip.

The so-called "universal" is to meet the application of many directions, not only for home appliances, but also for industry, transportation and many other directions.

(2) how to meet the general development requirements of MCU

In order to meet the development needs of different companies and different application directions, which two points must MCU meet:

1) the program is written independently by the development company

Because the company has its own unique needs, so it wants to be able to develop its own unique programs, so the MCU program is written by the development company.

2) all kinds of common peripherals will be integrated in the MCU chip.

In order to meet the development needs of various companies in different directions, for example, some companies need to use timers, some companies need to use serial ports, some companies need to use network cards, and the requirements are different. MCU in order to meet everyone's needs, MCU will integrate all kinds of common peripherals (timer, serial port, SPI, I2C, network card) into the chip, and users will choose to use the peripherals they need after taking them away. You don't need it. You don't need it.

(3) problems in using MCU

1) the price of MCU is relatively expensive.

It is relatively expensive, if compared with using independent CPU chips for development, MCU is undoubtedly very cheap, as far as people are concerned, the desire is endless, cheaper and hope to be cheaper.

People think that in some special cases, the cost of MCU still has a lot of room to fall, and this is indeed the case, which is why the cheaper SoC chip was born out of the general MCU.

2) Why do we say that there is still room for cost reduction in MCU?

When it is found that many products are specifically for a certain purpose, there are two characteristics

(a) only two of the peripherals are used for that purpose

For example, only use the network card, or serial port, other peripherals are superfluous, but since the purchase is General MCU, even if some peripherals you do not use, but you also have to pay, in fact, these unused peripherals can be removed to save costs.

(B) the programs developed are mostly the same

Many companies produce products for this purpose, and when buying MCU development, each company has to develop virtually the same program, and each company is spending the same money to develop programs with the same function. Anyway, the programs are all the same. As long as one person develops the program well, other companies don't have to sign for the development program.

9.5.2 SOC solves the problems faced above

(1) how does SoC save money?

After discovering the situation described above, MCU chip manufacturers came up with ways to save costs for MCU chip users.

(a) cut off the external equipment that is not needed in the MCU, for example, I only need the network card, then I will only leave the network card, which saves the cost for the company that buys MCU.

(B) the MCU manufacturer solidifies the program directly in the chip, so that the company that buys the MCU does not have to write its own program and saves costs.

Through the above two steps made specifically for a certain purpose of the unique MCU chip, this unique MCU is the SOC chip.

(2) conditions for chip manufacturers to produce SOC chips

1) the chip manufacturer designed the SOC chip to save money, did the chip manufacturer lose money soon?

Chip manufacturers naturally will not do business at a loss. The premise of producing SOC is that the amount of SOC used specifically for a certain purpose is very large.

With SOC, users can save costs, and SOC chip manufacturers themselves do not lose money. There are two reasons why they do not lose money.

(a) SoC can save costs, so it is naturally very popular with users, and users become more dependent on SOC, which helps to build deeper relationships.

(B) the use of SoC must be large quantities, small profits and quick turnover, for chip manufacturers, not only do not lose money because of reducing the cost of SoC, but make money instead.

2) the prerequisite for chip manufacturers to produce SOC chips is to require a large amount of use.

Only when the number of products specifically for a certain purpose is very large, chip manufacturers will produce SOC chips for them. With the support of huge quantities, chip manufacturers and chip users will be able to win-win. Without quantitative support, it is impossible to produce SOC chips for them.

For small products, companies can only honestly buy MCU chips to develop, because manufacturers can not make SOC chips that let others save costs at a loss.

(3) Summary: what is SoC?

1) understand SOC in one sentence

Soc is equivalent to a special MCU that has a specific purpose, solidifies the code at the factory, integrates only dedicated peripherals and uses a lot of money to save money.

2) how to understand the name SoC

System-on-a-chip, literal translation of "system on a chip", is often called a system only if it has a certain degree of completeness.

The hardware of the SoC chip is specially designed according to the requirements, and solidifies the code for it, so relatively speaking, SOC can be regarded as a complete system with both hardware and software, so it is called system-on-chip, that is, a chip can be regarded as a relatively complete system.

Of course, after getting the SOC chip, we must design the external circuit for it.

(4) Soc chip example 1) example 1:WIFI chip

ESP8266 Serial Port WIFI Chip of Lexin Company

ESP8266 is a SoC chip specially used for WIFI wireless communication. Using this chip, many wireless WIFI communication modules can be designed. For example, many single-chip computers cannot access the Internet wirelessly by WIFI.

But by connecting the wireless WFIF communication module with the SOC chip, you can access the Internet with wireless WIFI, because the chip is in great demand, so Lexin made it into a SOC.

2) example 2: graphics card, sound card chip

In fact, the computer graphics card chip, sound card chip is a typical soc chip, video card chip for video codec, sound card for audio codec, the purpose is very specific, because the use of this kind of chip is very large, so in order to save costs, it is also made into a SoC, codec program is directly solidified in the chip.

9.6 DSP chip

The English full name of DSP is Digital Signal Process, that is, digital signal processing. DSP chip refers to the chip that can realize digital signal processing. It is difficult to understand if you look at the name directly. To find out why DSP chip is needed, it is necessary to start with CPU processing multiplication and division of a large number of floating-point numbers.

9.6.1 CPU faces problems when dealing with multiplication and division of large quantities of floating-point numbers

(1) it consumes the computing resources of CPU

There are three reasons for consuming cpu computing resources.

1) large amount of data: if the data is so large, it will naturally take more time to process.

2) floating point numbers: compared with integers, floating point numbers (decimals) have a complex data structure and are more laborious to process.

3) multiplication and division: adders take longer to perform multiplication and division operations than addition and subtraction.

(2) CPU will be pestered because of the consumption of CPU budget resources

Such as the encoding and decoding of audio and video data, or the 3D rendering of large games, typically involves multiplication and division of large quantities of floating-point numbers, so

1) large amount of data

2) there are many multiplication and division operations

3) floating point numbers are very large

If you have to let CPU deal with it, cpu will spend all the time on processing these data. CPU doesn't have time to deal with other things about your computer, such as finding that your computer is very stuck. When the keystroke data is not reflected, it is because CPu is not busy yet and has no time to deal with keyboard input for the time being.

(3) CPU has the ability to handle a large number of floating-point multiplication and division operations, but CPU has more important work.

Because cpu, as the main control center of the whole computer, needs to be responsible for the normal operation of various components and programs of the whole computer, it is not only the work of doing a large number of data operations, so it is certainly impossible for cpu to be entangled by a large amount of data operations all the time.

9.6.2 DSP, appearing as a collaborator of CPU

(1) DSP function: a chip specializing in a large number of data operations

DSP as the assistant chip of cpu, DSP is specially used to deal with a large number of floating-point operations involving multiplication and division. Once cpu detects multiplication and division of a large amount of data, it will leave these annoying work to DSP,DSP to handle. After cpu gets away, it will throw itself into the work of directing the whole computer.

(2) CPU and DSP

1) understand the relationship between CPU and DSP through metaphor.

For example, for a leader, there are many things a leader can do, including handling copywriting naturally. It doesn't matter if there is little copywriting work. Leaders can do it part-time. Of course, if leaders specialize in copywriting work, they are also experts at copywriting. But the problem is, the most important job for leaders is not to handle copywriting, but to direct the overall situation. When copywriting work is piled up, If the leader still spends a lot of energy on copywriting, no one will be in charge of the overall situation. at this time, it is necessary to arrange a secretary for the leader to handle the copywriting, and the secretary will take over the complicated copywriting work of the leader. so that leaders can devote themselves to the overall arrangement of the overall situation.

In this example, CPU is the leader and DSP is the secretary.

2) the data processed by CPU and DSP chips, their respective characteristics

(a) data processed by CPU

The data processed by cpu is basically control data, and the so-called control data is the command data that tells here on and off, etc., the characteristic of these data is

The amount of data is small.

Less division and multiplication

Less floating point number to deal with

(B) data processed by DSP

The amount of data processed is very large.

And there are many division and multiplication operations.

Basically dealing with floating-point numbers.

So DSP is specially used to deal with multiplication and division of a large number of floating-point numbers, mainly to liberate CPU.

3) the way DSP and CPU cooperate with each other

(a) Master-slave relationship

The CPU chip, or the chip integrated with CPU, is the master chip, and the DSP is the slave chip, that is to say, DSP obeys the command of CPU, and CPU divides DSP into tasks to carry out large amounts of data operations.

(B) CPU and DSP can be integrated together or independently.

At present, in many cases, DSP and CPU are integrated together, and webcams use such processing chips. Among the companies that specialize in providing such chips, Huawei Haisi, Amba and TI are the best three.

9.7 FPGA chip

Through the picture we learned earlier, we know that all kinds of chips (CPU, MCU, DSP, SOC) are composed of various gate circuits, and the FPGA chip is no exception.

9.7.1 General computer chips (CPU, MCU, DSP)

You can represent a general computer chip (such as CPU) as follows

Traditional computer chips, or general computer chips, such as CPU, MCU, SOC, DSP, etc. when these chips leave the factory, the connection between the internal circuits is already fixed, especially their own advantages and disadvantages.

(a) advantages

The computer chips of all devices are the same, and the functional flexibility is very high, because as long as the computer chips are implemented by different programs, the computer chips can reflect different functions (working logic). Therefore, almost all computers adopt this traditional, departmental circuit connection has been designed when it leaves the factory.

(B) shortcomings

After using the chip to make a product, there must be corresponding program instructions to direct its work, and the steps of the work must come one instruction at a time, for example, there are five instructions, which can only be executed by the hardware step by step. Cannot be executed by the hardware at the same time. Many students here are about to say that there is not a multi-core CPU, even if it is a multi-core CPU, concurrency is limited. If you have hardware to execute all 30 instructions at once, it is very difficult for you to run all 30 instructions at once, because you are not going to have 30 cores.

9.7.2 appearance of FPGA

(1) FPGA name understanding

Due to the defects in the concurrent operation of the above traditional computer chips, people later came up with something called FPGA. The English full name of FPGA is Field-Programmable Gate Array, which is literally translated as "field programmable gate array". How to understand this word? this word contains the following meanings, as long as we understand these layers of meaning, we will understand what is meant by "field programmable gate array".

1) Gate array

The chip contains a large number of logic gates (and gates, non-gates, etc.), these logic gates together to form an array, so it is called gate array.

2) Programmable

These "logic gates" are not permanently connected when they leave the factory, and the chips are semi-finished products. According to their own needs, they can be connected according to their own unique needs through hardware programming languages, and they can be assembled as if they were building blocks.

Because programming modifies the gate circuit combination relationship in the chip, that is, the hardware combination relationship, so FPGA programming is also called hardware programming.

3) on-site

The circuit structure of the department on the chip can be reassembled at any time according to the demand.

(2) the advantages of FPGA

1) advantages 1

You can design the function of the chip according to your own needs, and completely perform many functions on the hardware at the same time, so the execution time is shortened, so the efficiency is very high.

For example, the traditional computer chip needs to execute five instructions, that is, it takes five sequential steps to complete. But on the FPGA side, after reassembling the gate circuit according to the demand, when the five instructions are executed at the same time, it is not called instruction but function in FPGA, and these five functions can be executed by five functional areas at the same time, so it really achieves the concurrency on the hardware.

2) advantages 2

After the door circuit combination is arranged by the hardware language program, the hardware function is fixed and can be run when powered on, and there is no need for assembler or c language to write the command program.

(3) the shortcomings of FPGA.

1) FPGA is expensive

2) relatively speaking, it is difficult to develop

(4) the difference between FPGA hardware programming and ordinary programming.

1) FPGA

The hardware programming language of FPGA is called HDL (Very-High-Speed Integrated Circuit Hardware Description Language), which is referred to as hardware description language. The program written by this language can directly modify the structure of the gate circuit inside the FPGA chip, that is, modify the internal hardware structure, so the language is called hardware programming language.

2) ordinary programming: such as assembler, c, C++, java, etc., programs written in this language only tell the hardware to follow a certain step, but the internal structure of the hardware is fixed.

(5) FPGA applications

For the very high efficiency requirements, especially in the high-frequency signal processing (signal generator), to the extent that ordinary computer chips can not meet, it is necessary to use FPGA when it needs to perform various functions concurrently on hardware.

9.8 Why to know the difference between CPU, MCU, PLC, DSP, SOC and FPGA

(1) know the choice of the scheme

If the difference between these chips is not clear, you will be at a loss in the choice of project solutions, because different project requirements vary in product development cycle, difficulty, cost requirements, and degree of stability. therefore, you need to choose chips with different characteristics to achieve project development, so you need to know something about these chips.

(2) deepen understanding through comparison.

It is hoped that through the comparative introduction of the internal structure of these chips, we can deepen our understanding of each chip.

Author: Jiajie Studio

51CTO free video address: http://edu.51cto.com/lecturer/12941022.html

Course progress consultation QQ group: 528495268

Please state the source address for reprint.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report