Current location - Recipe Complete Network - Take-out food franchise - What is the working principle of computers?

Many people can use computers, so you know, I have summarized some information for your reference!

The basic principle of computer is stored pro

What is the working principle of computers?

Many people can use computers, so you know, I have summarized some information for your reference!

The basic principle of computer is stored pro

What is the working principle of computers?

Many people can use computers, so you know, I have summarized some information for your reference!

The basic principle of computer is stored program and program control.

In advance, the instruction sequence indicating how the computer operates is called a program, and the original data is sent to the computer memory through an input device. Each instruction clearly specifies the steps, such as which address the computer should get the data from, what to do, and then which address to send the data to.

When a computer executes, it first takes out the first instruction from the memory, and after it is decoded by the controller, it takes out the data from the memory for the specified operation and logical operation, and then sends the result to the memory according to the address. Next, take out the second instruction and complete the specified operation under the command of the controller. Go on like this until you meet a stop order.

O programs are stored like data. It is the most basic working principle of the computer to take out the instructions step by step according to the programming order and automatically complete the operations specified by the instructions. This principle was first put forward by the Hungarian-born American mathematician von Neumann in 1945, so it is called the von Neumann principle.

What is the working principle of computers?

1, the composition of the computer system

Microcomputer consists of hardware system and software system.

Hardware system: refers to the physical equipment such as electronic circuits, electronic components and mechanical devices that make up the computer, including the host computer and external equipment.

Software system: refers to the program and technical documents related to the program. Including system software, various application programs and user files required by the computer itself. Software is the program and data used to direct the specific work of the computer, and it is the soul of the whole computer.

The computer hardware system mainly consists of five parts: arithmetic unit, controller, memory, input device and output device.

2, the working principle of the computer

1 feng? Neumann principle

The principle of "stored program control" is that Hungarian mathematician Feng Zai 1946? Neumann proposed it, so it is also called "Feng? Neumann principle ". This principle establishes the basic working mode of modern computers. Until now, the design and manufacture of computers are still along the "Feng? Neumann "architecture.

2. The basic content of the principle of "stored program control"

① Data and instructions are expressed in binary form.

(2) Pre-store program data and instruction sequences in the main memory for program storage, so that the computer can automatically fetch instructions from the memory at high speed and execute program control when working.

③ The computer hardware architecture consists of five basic components: arithmetic unit, controller, memory, input device and output device.

3 computer working process

Step 1: Send programs and data into memory through input devices.

Step 2: After execution, the computer takes out the program instructions from the memory and sends them to the controller to identify and analyze what the instructions should do.

Step 3: The controller sends corresponding commands such as addition and subtraction according to the meaning of the instruction, takes out the operation data stored in the storage unit and sends it to the operation unit for operation, and then sends the operation result back to the unit designated by the storage unit.

Step 4: When the operation task is completed, the result can be output through the output device according to the instruction.

instruction

An instruction is a binary bit string used to specify the operation performed by the computer and the storage location of the operation object.

instruction format

An instruction consists of an operation code and an address code. For example, the format of a double address instruction is as follows: opcode address code 1 address code 2 opcode: a binary code used to indicate what the computer should do. Specifies the nature or function of an instruction, and each instruction has only one operation code. Such as addition, subtraction, multiplication, division, access, storage and other basic operations have their own corresponding operation codes. Address code: indicates the address of the storage unit, and the object operated by the instruction is called operand here. Include the source of the operand, the destination of the result or the address of the next instruction, and the number of address codes in different instructions may be different.

instruction repertoire

The * * that defines all the instructions that a computer can recognize and execute is called the instruction system of a computer. There are hundreds of different instructions in the instruction system.

Classification of descriptions:

1, data transfer instruction: used to copy operands in a memory or register to a specified memory location or register.

For example: MOV CL, 05H.

Description: 05H is stored in the register CL.

2. Arithmetic operation instruction: used to complete various arithmetic operations such as addition, subtraction, multiplication and division of two operands.

For example: CX=0029H, SI=04EDH. Add SI and CX after executing the instruction.

Add the number 04EDH stored in the register SI and the number 0029H stored in the register CX,

And stores the result in the register SI.

The inspection process is as follows:

0029H

+ 04EDH

05 16H

Results Si = 0.516h.

3. Logical operation instruction: used to complete various logical operations such as logical addition, logical multiplication and bitwise addition of two operands.

For example: bitwise negation instruction

BL=FBH, after executing the instruction NOT BL,

BL = 1 1 1 1 10 1 12

BL=00000 1002=04H and then reversed.

4. Shift operation instruction: used to complete various types of shift operations of specified operands.

5. Bit and bit string operation: More and more attention is paid to the operation of non-numerical data in computers, including the loading, storage, transmission and comparison, and repeated execution of bits and bit strings. And bit string insertion and type access.

6. Control and transfer instructions: Usually, most instructions in a program are executed in sequence, but according to the result of instruction execution, you can jump to other instructions or other program segments for execution. What has this function is various branch instructions.

7. Input/output instructions: In a microcomputer, the registers in the input/output devices that can exchange data with the host are usually called I/O ports. At the same time, all I/O ports are addressed in a unified way. With input/output commands, I/O ports of various external devices can be accessed to realize data input/output.

8. Other instructions: including various processor control instructions, which are usually used exclusively by the operating system.

Compatibility problem

Each CPU has its own unique instruction system, so it is difficult to execute programs written in the machine language of one type of computer on other types of computers. This problem is called instruction incompatibility. Backwards compatibility: For example, 586 machine language is backward compatible with 486 machine language programs.

Instruction simplification problem simplifies instruction system computer RISC.

-

formula

A series of instructions designed to solve problems are called programs. Programs and related data are stored in memory, and the job of calculation is to execute the programs stored in memory. The process of computer executing programs is the process of executing instructions one by one.

The execution of the program automatically controls all the operations of the whole computer. This is the idea of program storage and program control put forward by American mathematician von Neumann 50 years ago. This is also the basic working mode of computers at present.

Execution of instructions

The execution process of an instruction is roughly as follows:

1 The instruction prefetch unit extracts an instruction from the instruction cache, and if there is no instruction in the cache, it sends a request to the bus interface unit to access the memory and obtain the instruction;

2. When the bus is idle, the bus interface unit takes out an instruction from the memory through the bus and puts it into the cache and instruction prefetch unit;

3. The instruction decoding unit obtains the instruction from the instruction prefetching unit and translates it into microcode for control;

4. The address translation and management unit is responsible for calculating the effective physical address of the operands used in the instruction, and requesting the bus interface unit to obtain the operands from the memory through the bus if necessary;

5. The execution unit completes the specified operation processing on the operands according to the requirements of the instruction operation code, and modifies or sets some state flags of the processor according to the operation results;

6. Modify the instruction address in the address translation management unit and provide it to the instruction prefetch unit to prefetch instructions.

Pipeline processing in Pentium processor

Because Pentium has two integer ALUs, two pipelines can be executed at the same time. This structure is called superscalar structure.