Principles of computer composition: 1. Introduction to computer systems

Better reading experience\huge{\color{red}{better reading experience}}better reading experience


1.1 Introduction to Computer System


1.1.1 Concept of computer software and hardware


A computer system consists of two parts: hardware and software :

  • Hardware: refers to the physical part of the computer, which is composed of various electronic components that can be seen and touched, and various optical, electrical, and mechanical equipment, such as hosts and external equipment.

  • Software: It is composed of programs with various special functions compiled by people in advance, and is usually stored in the main memory or auxiliary memory of the computer.

    The performance of a computer depends on the sum of its software and hardware functions.

    Computer software can usually be divided into two categories: system software and application software:

  • System software, also known as system program, is mainly used to manage the entire computer system and monitor services, so that system resources can be reasonably scheduled and run efficiently. It includes: standard program library, language processing program, operating system, service program, database management system, network software, etc.

  • Application software, also known as application program, is a variety of programs compiled by users according to the needs of tasks, such as scientific computing programs, data processing programs, process control programs, transaction management programs, etc.


1.1.2 Computer Hierarchy


Modern computers have a multi-level hierarchy:

insert image description here

From the perspective of the multi-level hierarchical structure of the computer system, the main object of hardware research can be attributed to the traditional machine M 1 M_1M1, and the microprogrammed machine M 0 M_0M0. The research object of the software is mainly all levels of virtual machines above the operating system level.


1.1.3 Computer composition and computer architecture


Computer architecture: Refers to those attributes of a computer system that can be seen by programmers, that is, conceptual structure and functional characteristics.

Computer composition: Refers to how to implement the properties embodied by the computer architecture, which contains many hardware details that are transparent to the programmer.

Example: For a computer, it has functions such as multiplication calculation and division calculation, which are part of its structure, but the way to realize the multiplication calculation instruction and division calculation instruction is a problem of computer composition.


1.2 Basic components of a computer


1.2.1 Features of von Neumann computers


1945The mathematician von Neumann was working on EDVAC \text{EDVAC}The concept of stored programwas proposed in EDVAC machine . Various types of computers based on this concept are known as von Neumann machines. Its characteristics can be summarized as follows:

  • A computer consists of five components: arithmetic unit, memory, controller, input device, and output device.
  • Instructions and data are stored in the memory at the same position and can be accessed by address.
  • Instructions and data are represented by binary numbers.
  • An instruction is composed of an operation code and an address code. The operation code is used to indicate the nature of the operation, and the address code is used to indicate the location of the operand in the memory.
  • Instructions are stored sequentially in memory. Usually, instructions are executed sequentially. Under certain conditions, the execution order can be changed according to the operation result or according to the set conditions.
  • The machine is centered on the arithmetic unit, and the data transmission between the input and output devices and the memory is completed through the arithmetic unit.

1.2.2 Computer hardware block diagram


A typical von Neumann computer is operator-centric:

insert image description here

Modern computers have turned memory-centric:

insert image description here

The functions of each component in the figure are as follows:

  • Calculator: complete arithmetic and logic operations, and temporarily store the intermediate results of the operation in the calculator.

  • Memory: stores data and programs. ·The controller is used to control and direct the input, operation and operation of programs and data, and to process the calculation results.

  • Input device: converts the familiar information form into the information form that the machine can recognize, common ones are keyboard, mouse and so on.

  • Output devices: convert the results of machine operations into familiar information forms, such as printer output, monitor output, etc.

    Since the arithmetic unit and the controller are closely related in terms of logic relationship and circuit structure, they are usually collectively referred to as a central processing unit (Central Processing Unit, CPU). The input device and the output device are referred to as I/Othe equipment (Input/Output Equipment). In this way, the modern computer can be considered to be composed of three major parts: CPU, I/Oequipment and main memory (Main Memory, MM); CPUcombined with the main memory, it can also be called the host, I/OA device may also be called a peripheral.

insert image description here

Arithmetic Logic Unit (ALU): Arithmetic logic unit for short, used to complete arithmetic and logic operations.

Control Unit (CU): It is used to interpret the instructions in the memory and issue various operation commands to execute the instructions.

ALUand CUare CPUcore components of . I/OThe equipment is also CUcontrolled to complete the corresponding input and output operations.


1.2.3 Computer working steps


In many practical problems of science and technology, many complex mathematical equations are often encountered, and digital computers usually can only perform four arithmetic operations of addition, subtraction, multiplication, and division. Complete some necessary preparations.

These tasks can be roughly summarized as:

  • Establish a mathematical model: find a series of mathematical equations that reflect the changing law of the research object.

  • Determine the calculation method: for the mathematical model, there is a computer-feasible calculation method.

  • Compiling problem-solving programs: writing corresponding calculation programs so that the results can be obtained through computer operation.

    Specific to the computer hardware part:

  • The main memory stores the calculation program and all the data required and generated by the calculation;

  • The arithmetic unit reads the data in the main memory for calculation, and stores the intermediate results in the main memory;

  • The controller analyzes these instructions to control the operation of storage and calculation;

  • I/OThe device finally outputs these results.


1.3 Main technical indicators of computer hardware


Measuring the performance of a computer is determined comprehensively based on a number of technical indicators. Among them, it includes not only various performance indicators of hardware, but also various functions of software. Here we mainly discuss the technical indicators of the hardware.


1.3.1 Machine word size


The machine word length refers to CPUthe number of bits that can process data at one time, usually CPUrelated to the number of register bits. The longer the word length, the larger the representation range of the number and the higher the precision. The word length of the machine also affects the computing speed of the machine. If CPUthe word length is short and the data with a large number of digits needs to be calculated, it needs two or more calculations to complete, which will inevitably affect the calculation speed of the machine.

The word length of the machine also has a greater impact on the cost of the hardware. It will directly affect the adder (or ALU), the data bus, and the number of bits to store the word size. Therefore, the determination of the machine word length cannot be considered solely from the accuracy and the range of representation of the number.


1.3.2 Storage capacity


The storage capacity should include main storage capacity and auxiliary storage capacity.

The main memory capacity refers to the total number of bits stored in the binary code in the main memory. That is: storage capacity 2 storage unit number × storage word length \text{storage capacity 2 storage unit number} \times \text{storage word length}Storage capacity 2 Number of storage units×Store word length .

In modern computers, the number of bytes is often used to describe the size of the capacity. Because a byte has been defined as a 8binary code, the number of bytes can reflect the capacity of the main memory. Auxiliary storage capacity is usually expressed in bytes.


1.3.3 Operation speed


The computing speed of a computer is related to many factors, such as the main frequency of the machine, what kind of operation is performed, and the speed of the main memory itself.

In the early days, it was obviously unreasonable to use the time required to complete an addition or multiplication to measure the speed of operation, that is, the common method. Later, the Gibson method is adopted, which comprehensively considers the execution time of each instruction and their percentage in all operations, namely:
TM = ∑ i = 1 nfiti T_{\text{M}} = \sum^ {n}_{i = 1}{f_i t_i}TM=i=1nfiti
where, TM T_{\text{M}}TMis the running speed of the machine; fi f_ififor secondThe percentage of i instructions in all operations; ti t_itifor secondThe execution time of the i instruction.

Now the computing speed of the machine is generally measured by the average number of instructions executed per unit time, and MIPS(Million Instruction Per Second, million instructions per second) is used as the unit of measurement. For example, if a machine can execute 20010,000 instructions per second, it is recorded as 2 MIPS. You can also use CPI(Cycle Per Instruction), which is the clock cycle required to execute an instruction (the reciprocal of the main frequency of the machine), or use FLOPS(Floating Point Operation Per Second, the number of floating-point operations per second) to measure the operation speed.

Guess you like

Origin blog.csdn.net/LYS00Q/article/details/129015536
Recommended