We generally worship the CPU. A small chip can execute programs that look so complicated and intelligent. Is there something amazing about the CPU?
Actually no. We know that electronic technology is developing very fast. From the past 8086 to the present, the performance of the core is unknown, but its instruction set has not changed much, this has a lot to do with the design of its functions. The core function of the CPU is to control the data interaction and calculation between various devices in the computer.
So how is the CPU designed? The CPU is designed to automatically retrieve commands from memory and parse and execute the commands. Commands are divided into three parts. One part controls data transmission, namely, Implementing Data Interaction Between the CPU and each device on the bus, which is composed of bus interface units. Some operations are performed, including arithmetic operations and logical operations, which are completed by the calculator. Of course, another part is to implement complex program logic, including branches and loops. This is implemented by the instruction registers, status word registers, and jump commands, which are the simplest. Program commands are placed in the memory, and the first instruction address is put in the instruction register of the CPU in advance. The CPU obtains the instruction address from the instruction register and obtains the instruction data through the bus interface unit, finally, the command execution is parsed, and the value of the command register will automatically point to the next command address in sequence. The CPU also provides the jump command (conditional jump and unconditional jump) to implement Branch Control of the program, loop control.
In the past, the CPU seemed so simple. In addition to computing, it is basically only responsible for interacting with other components (main storage interface and IO Interface). What is the meaning of the data beyond the I/O interface, whether it is storage, control, printing, or display, it depends on how the specific peripherals are made. These should be out of the control of CPU commands, and thus out of the control of the program. If we write a program, isn't it just to design certain algorithms so that data can be transmitted in various components? We can do arithmetic and logical operations at most. We are not afraid of this.
The CPU looks like a market. It constantly extracts commands from the memory and then translates the commands, these commands are nothing more than reading data from some devices connected to the bus for some column operations, and then sending data to the devices on the bus.
The most amazing thing about computer is that he can develop such a huge IT industry with such a simple design. He has developed such a complicated software industry with such a simple design. The CPU never fails because of its simplicity.
Everything is data. In the end, computers process data. what humans need is information processing or data. Therefore, we need to understand that what we write is not a program. We are laying roads for data and making them unobstructed.