What does the CPU perform to complete a basic operation or judgment?
Cpu completes one step of basic operation or judgment by executing an instruction. The CPU mainly consists of two parts, namely the controller and the arithmetic unit; the controller uses instructions to direct the machine to work. Usually an instruction includes two aspects, namely operation code and operand; the operation code determines the operation to be completed, and the operand refers to the data participating in the operation and the unit address where it is located.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
cpu completes one step of basic operation or judgment by executing an instruction.
In the CPU, the execution of an instruction includes three steps: instruction fetching, analysis and execution. Therefore, executing an instruction will complete one basic operation or judgment.
CPU introduction
Central processing unit (CPU) is one of the main devices of electronic computers and a core accessory in computers. Its function is mainly to interpret computer instructions and process data in computer software. The CPU is the core component of the computer that reads instructions, decodes them, and executes them.
The central processing unit mainly consists of two parts, namely the controller and the arithmetic unit, which also include cache memory and the data and control bus that realize the connection between them. The three core components of an electronic computer are the CPU, internal memory, and input/output devices. The main functions of the central processing unit are to process instructions, perform operations, control time, and process data.
In the computer architecture, the CPU is the core hardware unit that controls and allocates all hardware resources of the computer (such as memory, input and output units) and performs general operations. The CPU is the computing and control core of the computer. The operations of all software layers in the computer system will eventually be mapped to CPU operations through the instruction set.
Instructions
In computers, instructions are instructions and commands that direct the machine to work. A program is a series of instructions arranged in a certain order. The process of executing a program is the working process of the computer.
The controller relies on instructions to direct the machine to work. People use instructions to express their intentions and give them to the controller for execution. The total set of different instructions that a computer can execute is called the computer's instruction system. Each computer has its own specific instruction system, and its instruction content and format are different.
Usually an instruction includes two aspects: operation code and operands
The operation code determines the operation to be completed
The operand refers to the data participating in the operation and the unit address where it is located
In computers, operation requirements and operand addresses are represented by binary numbers, which are called operation codes and address codes respectively. , the entire instruction is stored in the memory in the form of binary encoding.
The type and number of instructions are related to the specific machine model and will not be described in detail here. Please refer to the specific machine data manual.
Instruction execution process
-
#The first step is to fetch and analyze the instruction.
According to the order specified by the program, the currently executed instructions are fetched from the internal memory and sent to the instruction register of the controller. The fetched instructions are analyzed, that is, based on the operation code in the instruction, the computer determines what should be done. What operation.
-
The second step is to execute the instructions.
According to the instruction analysis results, the controller sends out a series of control potentials required to complete the operation in order to direct the relevant computer components to complete the operation, and at the same time, prepare for fetching the next instruction.
(Learning video sharing: Programming video)
The above is the detailed content of What does the CPU perform to complete a basic operation or judgment?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.