2024 PubMed 408-Computer Composition Principles Chapter 1-Computer System Overview Study Notes

Article Directory

foreword

Currently preparing for the 24 postgraduate entrance examination, the knowledge points learned and sorted out in 24 computer 408 are now summarized.

Blogger blog article directory index: blog directory index (continuously updated)


Getting Started: Getting to Know Computers

Transmission of data through electrical signals in computers: the principle of computer recognition of binary data

image-20230520204944172

Familiar with hardware:

image-20230520205155304

  • How the printed circuit on the motherboard transmits data: You can see that there are multiple circuits, which are the channels for transmitting circuits between various components.

1. History of computer development

1.1. What is a computer system

image-20230520205454696

Classification of software:

image-20230520205603541

In the design group, we mainly explore the hardware part!


1.2. The development of computer hardware

1.2.1 Overview of the four generations of development

It mainly uses circuits to perform calculations. The following are the development stages of each era:

image-20230520211514201


1.2.2 Detailed introduction to the development of the fourth generation

The First Generation: The Tube Era

In this generation, programmers use machine language to program

image-20230520210107286

image-20230520210355990

The second generation: the era of transistors, replacing electronic tubes

The volume is reduced, the power consumption is reduced, and the calculation speed has also achieved a qualitative leap. At this time, a process-oriented language: FORTRAN appears, and the prototype of the operating system is formed.

image-20230520210746924

The third generation: the era of small and medium-scale integrated circuits, integrated circuits

Computers have become smaller and smaller, power consumption has become lower, and integrated circuits are more reliable than manually soldered transistors. At this time, high-level languages ​​are developing rapidly, and there are time-sharing operating systems at this time.

  • In fact, transistors and capacitor components are stored on the circuit board at a high density.

At this stage, it is mainly used for scientific computing, and has not yet entered personal life:

image-20230520211054607

Fourth Generation: Large-Scale, VLSI

With the improvement of integrated circuits, the fourth generation appeared. At this time, microprocessors, that is, CPUs, such as Apple's A13, began to appear.

The advancement of chip technology led to the birth of microprocessors, and also led to the birth of microcomputers. After that, microcomputers began to gradually enter everyone's life.

image-20230520211456581

Take a look at the development of Intel's processors:

image-20230520211726696

  • For example, if an 8080 8-bit CPU is used to process a 16-bit word length, it needs to be processed twice, while the 8086 only needs to be processed once.

1.2.3, the development history of computer hardware

image-20230520212102141


1.2.4 Introduction to Moore's Law

Moore's Law was proposed by Moore of Fairchild:

image-20230520212244305


1.3. Development of computer software

1.3.1. Software development

image-20230520212637853


1.3.2, the current development trend

image-20230520213003858


Knowledge review and important test points

image-20230520213221616


Two, the computer hierarchy

2.1, the basic composition of computer hardware

image-20230521084610532

2.1.1, Von Neumann's basic ideas and characteristics (centered on the arithmetic unit, including five major components)

Early von Neumann machines :

The original manual wiring requires the programmer or operator to manually operate the wiring first, and then the operation can be performed after the operation is completed.

And von Neumann proposed the concept of stored program, which can input binary code into the main memory of the computer in advance, and then execute the first instruction of the program according to the first address of the memory, and then execute other instructions until the end.

image-20230521085201475

image-20230521085723038

  • memory->transmission line in the controller : the controller reads a stream of instructions from the memory

The same function can be realized by software or by hardware.

  • Software implementation is less expensive and less efficient.
  • Hardware implementations are more costly and more efficient.

Von Neumann computer features :

image-20230521093542902

Taking the calculator as the center means that all data must pass through the calculator, which will lead to a decrease in efficiency. For this problem, modern computers have been optimized. Examples of actual processing plants :

image-20230521093942804

image-20230521145049932

  • Some computer instructions can execute multiple address codes. For example, one instruction contains two addresses. This instruction is called a two-address instruction.
  • Stored program: Before the program runs, instructions and data are stored in memory in advance.

2.1.2. Structure of modern computer (memory-centric)

Before optimizing the architecture of von Neumann with the arithmetic unit as the core, the mechanism of the modern computer is with the memory as the core, as shown in the following figure:

image-20230521094617794

The data of the input device is directly put into the storage device. When the computing unit finishes processing, the output device will also take out the data directly from the storage. At this time, more time can be freed up for the computing unit, allowing the computing unit to perform more calculations.

Note: Due to the close logical relationship between the arithmetic unit and the controller, after the emergence of large-scale integrated circuit technology, these two components are usually integrated into the same component, and the integration of the two components is the current CPU. .

Take a look at the components of the hardware and the scope of the host and IO devices :

image-20230521094905203


Review of knowledge points and important test points

image-20230521095012634


2.2, the working principle of each hardware

Registers also store binary data, MAR stores binary data related to addresses, and MDR stores actual data

2.2.1, the basic composition of the main memory

On the left is the structure of the main memory, and on the right is the actual application to illustrate the main memory:

image-20230521105124995

Next, understand the role of MAR and MDR :

For the memory, the CPU can specify which location to write to (put into MAR), which data to write (put to MDR), and finally the CPU will tell the main memory through the control bus that the operation to be performed this time is Write operation, then the main memory can write the data that the CPU wants to write to the corresponding position according to the three information sent by the CPU.

image-20230521105214928

Next, let's understand the memory bank : a memory bank contains multiple storage units, and a memory unit corresponds to an address

image-20230521110232597

  • The size of a word depends on how the computer hardware of the main memory is designed, there are 8, 16, and 32 bits. Don't confuse it with 1 byte, there are 1B, 1b.

Additional extension: For example, the conversion of 100Mbps broadband corresponds to Thunder download B, then there is an 8-fold relationship in the middle, and the actual download is 10MB/s.

image-20230521110017491


2.2.2, the basic composition of the arithmetic unit

There are mainly three indispensable registers and a core component.

The ALU has the highest manufacturing cost in the arithmetic unit, and the others basically store operands.

image-20230521110856466


2.2.3, the basic composition of the controller

In the controller, CU is the real core. In many cases, PC and IR are collectively referred to as the instruction fetching stage, and CU is represented as the execution stage:

image-20230521111123178


2.2.4, the working process of the computer

High-level language examples and analysis of instruction execution

Let's execute a program, let's see how it works in the computer hardware part:

image-20230521145155073

Next, let's take a look at the running process of a y=a*b+c instruction in the hardware instruction :

image-20230521133707528


①The first instruction: Execute the fetch instruction

Execute an instruction flow of main memory address 0 : it is a fetch instruction, including the following multiple hardware execution steps

Preliminary: PC(0): Fetch the instruction whose address is 0 and execute it.

#1: (PC)->MAR: It will cause (MAR)=0, the controller indicates to the main memory that the string of data at address 0 is to be accessed next, and the controller will tell the main memory through the control bus This time, the read operation is to be performed. Next, the main memory will find the binary data corresponding to address 0 in the memory according to the address recorded by the MAR, and put the binary data into the MDR.

  • (MAR) has brackets, indicating the content inside.

#3 M(MAR)->MDR: Indicates that the data in the MAR address in the main memory is put into the MDR.

  • M(MAR): Indicates the MAR in the main memory

#4 (MDR)->IR: The data in the current MDR will be put into the IR register.

#5 OP(IR)->CU: The first 6 bits of IR will be sent to CU, and CU recognizes 6-bit binary as a fetch instruction.

#6 Ad(IR)->MAR: At this time, the address code in IR will be sent to MAR, resulting in (MAR)=5

#8 M(MAR)->MDR: Indicates that the data in the MAR address in the main memory is put into the MDR.

Finally, under the operation of the control unit, the data of the MDR will be transmitted to the ACC.

#9 (MDR)->ACC: Transfer the value in MDR to the ACC accumulator.

The multiple steps above can actually be divided into fetching instructions, analyzing instructions, and executing instructions:

image-20230521134441988

At this time, when an instruction is executed, the PC will be automatically +1, that is to say, the instruction whose main memory address is 1 will be executed.


②The second instruction: Execute the multiplication instruction

Then execute the second instruction : Obviously, the intermediate process is to let the CU process the recognition operation code 000100, which is the multiplication instruction, and the corresponding address code specifies the main memory address as 6.

image-20230521141334902

The steps to complete the execution of the second instruction are shown in the figure below:

image-20230521142602925

Note that at this stage, the data in MDR will be transferred to MQ, and b=3 at this time.

Then the corresponding multiplicand 2, that is, (ACC)->x, will put the value in ACC into x, so that (x)=2.

Finally, the multiplication operation is performed by the ALU, (MQ)*(x)->ACC, and the number obtained by the multiplication is placed in the ACC.

Note : The process of fetching instructions and analyzing instructions is consistent with executing instructions, and the steps for executing xx instructions are not similar.


③The third instruction: Execute the addition instruction

After the second instruction above is executed, the PC will also be incremented by 1. At this time, the PC instruction whose main memory address is 2 starts to be executed:

image-20230521143333212

When performing addition, the summand is stored in X, and the addend is stored in ACC.


④The fourth instruction: execute storage operation

After the execution of the third instruction is completed, the instruction whose main memory address is 3 is executed: actually, the previous instruction is stored y=a*b+c=2*3+1=7in the specified address space of 0000000000000111

image-20230521143955752

The fifth instruction: Execute the shutdown instruction

image-20230521144052288


Review and summary of knowledge points

image-20230521144458868


2.3. Hierarchical structure of computer system

2.3.1, the hierarchical structure of the computer

The multiple commands that execute one of the multiple instructions during the working process of the computer above are actually microinstructions:

image-20230521152107649

The hierarchical structure here (somewhat different from the operating system) is more considered from the perspective of programmers and hardware designers.


2.3.2, three levels of language (machine, assembly and high-level language, assembly, compiler and interpreter)

image-20230521151222481

Some languages ​​are not directly compiled into machine language by compiling the program step by step, but are translated into an equivalent machine language program by interpreting the program.

The difference between a compiler and an interpreter :

  • The compiled program can be compiled into an .exe file for final execution. (Only need to translate once)
  • The interpretation program is to translate a sentence and execute it immediately, and it must be translated every time it is executed. (translated once per execution)

Knowledge review and important test points

image-20230521152305109


2.4, computer architecture vs computer composition principle

image-20230521152738919

The difference between the two :

  • Computer architecture: how to design the instruction system discussed, what kind of instructions the computer I designed needs to provide to the upper-level programmers, whether there are multiplication instructions, if there is no multiplication instruction, then programmers who want to realize the multiplication function, then The final result can only be obtained by performing multiple additions.
  • Computer composition principle: If I want to provide multiplication instructions to the upper layer, how can I implement the multiplication instructions in hardware.

3. Computer performance indicators

3.1, memory performance indicators

It mainly includes MAR and MDR:

image-20230521154057314

Note the following points of attention :

Point 1: The number of digits in MAR can directly represent the actual capacity, that is, it can be calculated according to the maximum value.

  • Because in reality, not all capacity is full, the test can be calculated directly according to the maximum.

Point 2: Regarding the number of bits in MAR, why can you directly use 2 32 to calculate it?

image-20230521154235968


3.2, CPU performance indicators

Indicators: CPU clock frequency, CPU main frequency, CPI

image-20230521155250952

The higher the main frequency, the faster the speed, which largely reflects the performance of the CPU. Not only the main frequency will affect the CPU operation, but also some indicators such as CPI.

CPI: Different instructions, CPI may also be different, even the same instruction, there will be changes.

  • Generally speaking, we are going to calculate the average time-consuming of an instruction:一条指令的耗时 = CPI x CPU的时钟周期

At this point we can do an example question :

image-20230521155450533

  • Among them, 3* (1 / 1000) is the time-consuming of one instruction, then the time-consuming of 100 instructions can get the above formula.

Metrics: IPS, FLOPS

image-20230521164522934

  • For example: 2MIPS means 2 million instructions per second. 2GIPS means two billion instructions per second.
  • 3TFLOPS: Indicates 3 trillion floating-point operations, split into 3, T, and FLOPS.

3.3. Overall performance indicators of the system

image-20230521165110495


3.4. Benchmark program (overall performance index, dynamic test)

image-20230521165413024

In essence, a large piece of program code is designed for you. This code contains various instructions. The frequency of occurrence of various instructions is different. Time to evaluate and score.


Is the performance of a computer machine only determined by the main frequency, CPI or benchmark test program scores?

Conclusion: The speed of executing instructions is related to the main frequency, CPI (the execution time of an instruction), and the instruction system (different instruction systems have different instructions, for example, if there is no multiplication instruction, multiple addition instructions need to be executed)

**Question 1: A CPU with a high frequency must be faster than a CPU with a low frequency? **No, if the CPI is fast, the instructions that the latter may execute are also very fast!

image-20230521165859244

Question 2: If the CPI in question 1 is the same, is the CPU with high frequency still faster ?

image-20230521170027112

Question 3: The better the running score of the benchmark program, the better the performance of the computer machine ?

image-20230521170057234

The higher the score is not necessarily the better, it should be tested according to your actual use, for example, your computer is very good at computing, but you are using it for the graphics card test, obviously you will not get a high score.


Review of knowledge points and important test points

image-20230521170216363


Finisher: Long Road Time: 2023.5.20-21

Guess you like

Origin blog.csdn.net/cl939974883/article/details/130920912