The relationship and difference between CPU and SOC

1: What is soc

SOC is called system-on-chip, also known as chip-on-chip, which is a product of a proprietary integrated circuit, which includes a complete system and has all the contents of embedded software. At present, SOC has more integrated processors (including CPU, GPU, DSP), memory, baseband, various interface control modules, various interconnection buses, etc., which are typically represented by mobile phone chips.

2: What is a CPU

The CPU (central processing unit) is a large-scale integrated circuit, which is the computing core and control core (calculator + controller) of a computer. Its function is mainly to interpret computer instructions and process data in computer software.

The CPU mainly includes an arithmetic unit (ALU), a cache register and a bus that implements data, control and status between them. It is known as the three core components of an electronic computer together with internal memory and input/output (i/o) devices

What ARM produces is CPU, it sells its own CPU design to other companies, and other companies add various peripheral controllers they need according to the CPU provided by ARM, which is SOC.

The controllers used by different companies are not necessarily the same, because different companies need different performances, so they will want to customize the controllers they need from semiconductor companies.
In daily work and life, the so-called CPU refers to the SoC, just like the memory has NandFlash and ordinary memory.
Our learning of bare metal programs is to learn the interoperation between the CPU and various peripheral controllers.

It can be simply understood that the SOC includes the CPU, and the development of the chip is from the CPU to the SOC.

3: The main function of the CPU

Processing instructions

English Processing instructions; this refers to the execution order of the instructions in the control program. There is a strict sequence between the instructions in the program, and must be executed in strict accordance with the sequence specified in the program to ensure the correctness of the computer system.

perform action

English Perform an action; the function of an instruction is often realized by a series of operations performed by components in the computer. The CPU needs to generate corresponding operation control signals according to the functions of the instructions and send them to the corresponding components, so as to control these components to act according to the requirements of the instructions .

control time

English Control time; time control is to implement time timing for various operations. During the execution of an instruction , what operations are performed at what time should be strictly controlled. Only then can the computer work in an orderly manner.

Data processing

That is to perform arithmetic and logical operations on data , or perform other information processing .

Its function is mainly to interpret computer instructions , process data in computer software , and execute instructions. Also known as microprocessor in microcomputer, all operations of the computer are controlled by the CPU, and the performance index of the CPU directly determines the performance index of the microcomputer system . The CPU has the following four basic functions: data communication , resource sharing, distributed processing, and providing system reliability. The operating principle can be basically divided into four stages: Fetch, Decode, Execute and Writeback.


4: The working process of the CPU

The CPU fetches instructions from memory or cache, places them in the instruction register , and decodes . It decomposes the instruction into a series of micro- operations , and then issues various control commands to execute the series of micro-operations to complete the execution of an instruction. Instructions are the basic commands for the computer to specify the type of operation and the operands . An instruction consists of one byte or more bytes, including an opcode field, one or more fields related to the address of the operand, and some status words and feature codes . Some instructions also contain the operand itself directly.

extract

The first stage, fetch, retrieves an instruction (as a value or a series of values) from memory or cache . The memory location is specified by the Program Counter . ( The program counter holds values ​​that identify the location of the program. In other words, the program counter keeps track of the CPU's traces in the program.)

decoding

The CPU decides its execution behavior according to the instructions fetched from memory . During the decoding phase, instructions are disassembled into meaningful pieces. Numerical values ​​are interpreted into instructions according to the CPU's Instruction Set Architecture (ISA) definition. A portion of the instruction value is an opcode, which indicates which operations are to be performed. Other values ​​usually provide the necessary information for the instruction, such as the target of an addition operation.
PU according toThe instruction fetched from memory determines its execution behavior. During the decoding phase, instructions are disassembled into meaningful pieces. Numerical values ​​are interpreted into instructions according to the CPU's Instruction Set Architecture (ISA) definition. A portion of the instruction value is an opcode, which indicates which operations are to be performed. Other values ​​usually provide the necessary information for the instruction, such as the target of an addition operation.

implement

Following the extraction and decoding stage, the execution stage follows. In this stage, it is connected to various CPU components capable of performing the required operations.
For example, to request an addition operation, the Arithmetic Logic Unit (ALU, Arithmetic Logic Unit) will be connected to a set of inputs and a set of outputs. The input provides the values ​​to add, and the output will contain the summed result. The ALU contains circuitry that facilitates simple common and logical operations (such as addition and bitwise operations) at the output. If an addition operation produces a result that is too large for the CPU to process, the Arithmetic Overflow flag may be set in the flags register.

write back

最终阶段,写回,以一定格式将执行阶段的结果简单的写回。运算结果经常被写进CPU内部的 暂存器,以供随后指令快速存取。在其它案例中,运算结果可能写进速度较慢,但容量较大且较便宜的主 记忆体中。某些类型的指令会操作 程序计数器,而不直接产生结果。这些一般称作“跳转”(Jumps),并在程式中带来循环行为、条件性执行(透过条件跳转)和函式。许多指令会改变标志暂存器的状态位元。这些标志可用来影响程式行为,缘由于它们时常显出各种运算结果。例如,以一个“比较”指令判断两个值大小,根据比较结果在标志暂存器上设置一个数值。这个标志可藉由随后跳转指令来决定程式动向。在执行指令并写回结果之后, 程序计数器值会递增,反覆整个过程,下一个 指令周期正常的提取下一个顺序

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324682350&siteId=291194637