Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Computer structure

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

7.1 von Neumann structure

7.1.1 components of the von Neumann structure

(1) input and output equipment

1) input device: input data to a computer, such as

Convert image / sound into binary data to the computer through camera and MIC

Input data from the network card to the computer, etc.

Other

2) output device: output data from a computer, such as

Through monitors and speakers, the translation of binary data is called picture / video / sound, etc., which can be recognized by people.

Or output data to other computers through the network card.

Other

(2) memory: storing programs and data

(3) arithmetic unit: performing arithmetic and logic operations

(4) Controller: interprets program instructions and converts program instructions into corresponding microinstructions, which control the work of components such as the arithmetic unit, such as

Arithmetic and logical operation of data

Data transfer, such as moving from CPU registers to memory, or from one location of memory to another location of memory.

Wait a minute.

7.1.2 structure diagram

7.2 Harvard structure

Corresponding to the von Neumann structure is the Harvard structure. Later, we will explain in detail the similarities and differences, advantages and disadvantages between the two structures. In order to facilitate the explanation, we will take the classical von Neumann structure as an example to introduce the computer composition structure.

7.3 detailed structure

7.3.1 detailed structure Diagram (PC)

7.3.2 brief introduction of each part

On the whole, the detailed composition of the computer can be divided into three parts, CPU, bus and interface, external devices, the core part is mainly cpu/ bus, external devices are generally divided into input devices and output devices, and the core part is connected with external devices through interfaces.

(1) cpu

1) arithmetic unit

(a) function: to perform arithmetic and logic operations on binary data of digital electrical signals according to instruction requirements

(B) composition of arithmetic units

ALU:Arithmetic Logic Unit, arithmetic operation unit, performing arithmetic operation and logic operation

(general) register bank: used to store some intermediate values and result values involved in the arithmetic / logic operation of ALU.

Multiplier register: specially used to store the intermediate value and result value of multiplication and division.

CVZS: flag bits to be used in various ALU operations

C: carry, borrow marks, if there is a carry or borrow, Category 1, otherwise Cumber0.

C application example: please write assembly code to calculate the added value of 13208 + 34535.

A: in order to make it easier to understand when programming, let's first convert these two binary numbers to hexadecimal, or OX3398+0X86E7.

The rough steps of compiling to achieve the addition of these two numbers are shown in the following figure.

Conclusion: it can be seen from this example that the function of C carry / borrowing mark is the same as that of borrowing, so we will not repeat it any more. If you want to know more, we will also talk about it later in the embedded technology course when we talk about compilation. Of course, we are emphasizing here that we are not learning to compile for

Use change to develop, but to understand how computers work through assembly.

Some students said that if I write code in high-level languages such as C language, will these flag bits also be used? when compiling together for a hundred years, C language will be translated into assembly, and after translation into assembly, when doing arithmetic operations of addition, C forward / borrowing bits will also be used in the same way.

Z: whether the result of the operation is a zero flag, if the result is 0 _ zero _ 1, otherwise zero _ zero.

Application example: compare whether two numbers are equal, such as axiom 3, determine whether two numbers are equal, if written as an assembler, it is actually subtracting two numbers (arithmetic operation)

If Zip1 means that the values of an and b are equal, otherwise they are not equal.

V: overflow flag, there is overflow, Vumb1Jing Vroom0

(1) what is spillover

For example, a 32-bit register has only 32 bits, and the maximum number of binary numbers that can be installed is 32 1s, that is, 11111111 11111111 11111111. If you add another 1 to it, it will enter 1 to 33, but the register is only 32, and there is no 33, which 1 does not exist. The 32 bit in the register are all 0, that is, 0000000000000000000000000000000, so there is a huge sudden change in the overflow value. In real computers, overflow will lead to errors in the value of the data, resulting in great problems with the calculation results.

(2) Why check for overflow

From the above description, it is not difficult to see that the overflow check is very meaningful. Through the check of the underlying flag V, we can know whether the data has overflow or not. If there is no overflow to prove that there is no problem with the data, otherwise, there may be a problem with the value of the data. Need to be dealt with accordingly.

When a high-level language, such as C, implements two very large calculations, if the result of the data computer overflows because it is too large, there will be an overflow reminder when you use the overflowed data. this overflow reminder is obtained through the compiled assembler of the C language program to check the V overflow flag bit, and we will talk about the overflow when we talk about the C language later.

S: sometimes N is used. When two signed numbers are operated, Signor1 indicates that the result of the operation is negative, and Signor0 indicates that the result of the operation is positive or zero.

Application example: compare the size of two numbers an and b, and write a program, we will let the two numbers subtract and subtract. If Signor1 is a negative number, it means that a

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report