The CPU consists of:
First, the CPU core
Structurally, the CPU core is divided into two parts: arithmetic unit and controller.
(1) Arithmetic unit
1, Arithmetic and Logic Unit (ALU)
ALU mainly performs fixed-point arithmetic operations (addition, subtraction, multiplication and division), logical operations (and or not xOR) and shift operations on binary data. In some cpus there are also shifters specifically designed to handle shift operations.
Normally, an ALU consists of two inputs and one output. Integer units are sometimes called IEU (Integer Execution Unit). When we say that the CPU is XX bits, we are referring to the number of bits of data that the ALU can process.
2. Floating Point Unit (FPU)
FPU is mainly responsible for floating point arithmetic and high precision integer arithmetic. Some Fpus also have vector computing capabilities, while others have specialized vector processing units.
3. General purpose register group
The universal register set is the fastest set of memory used to hold the operands and intermediate results of the operation.
To counter the x86 instruction set's disadvantage of only supporting eight general-purpose registers, Intel's latest cpus use a technique called register renaming, which allows the x86CPU to break the limit of eight registers to 32 or more.
4. Special register
Special registers are usually state registers that cannot be changed programmatically and are controlled by the CPU itself, indicating a certain state.
(2) Controller
The computer can only perform calculations, while the controller is used to control the work of the entire CPU.
1. Command controller
Instruction controller is a very important part of the controller. It needs to complete the operation of taking instruction and analyzing instruction, and then hand it to the execution unit (ALU or FPU) to execute, and form the address of the next instruction.
2. Timing controller
The function of the timing controller is to provide control signals for each instruction in chronological order. The timing controller includes a clock generator and a frequency doubling definition unit. The clock generator sends a very stable pulse signal from a quartz crystal oscillator, which is the main frequency of the CPU. The frequency doubling definition unit defines the CPU frequency as several times the memory frequency (bus frequency).
3. Bus controller
Bus controller is mainly used to control the internal and external bus of CPU, including address bus, data bus, control bus and so on.
Interrupt the controller
Interrupt controller is used to control all kinds of interrupt requests, and queue up the interrupt requests according to their priorities, and hand them to CPU one by one.