Introduction to Computer Systems

**计算机由硬件和软件组成。**
Software includes system software and application software.
System software, also known as system program, is used to manage the entire computer system, monitor services, and
reasonably . Including: standard program library, language processing program (assembler that translates assembly language into machine language;
compiler that translates high-level language into machine language), operating system (such as batch system, time-sharing system, real-time
system ), services Sexual programs (such as diagnostic programs, debugging programs, connection programs), database management systems, network software, etc.
Application software, also known as application program, is a variety of programs compiled by users according to the needs of tasks.
Each instruction in assembly language corresponds to a statement in machine language. Assembly language cannot get rid of the
instruction . Assembly language has no universality. Every machine must have an assembly language relative to it.

The compiler is to translate all the statements of the high-level language program written by the user into a machine language program at one time,
and then execute the machine language program.
The interpreter translates a statement into a statement corresponding to the machine language, and executes the statement immediately,
then translates the next statement of the source program, and executes it, and so on until all the translation tasks of the source program are completed.

**计算机系统层次结构**
Virtual machine M4 (high-level language machine) - translated into assembly language using a compiler
virtual machine M3 (assembly language machine) - translated into a machine language program using an assembler program
Virtual machine M2 (operating system machine) - interpreted operations in machine language System
Conventional Machine M1 (Machine Language Interpreted by Microprograms) - Machine Instructions Interpreted by Microprograms
Microprogrammed Machine M0 (Microinstructions Directly Executed by Hardware) - Microinstructions Directly Executed by Hardware

**计算机体系结构与计算机组成。**
Computer Architecture: The attributes of a computer system that can be seen by programmers, that is, conceptual structural and functional characteristics,
usually referring to programmers who program in machine language (also includes assembly language programmers and assembly programmers) Most of the attributes of traditional machines
seen , including instruction set, data type, memory addressing technology, and I/O mechanism, are
abstract attributes.
Since the computer system has a multi-machine hierarchical structure, programmers who program at different levels see different computer
attributes . For example, programmers who program in high-level languages ​​can regard IBM PC and RS6000
as two machines. It is a machine with the same attributes, but for programmers programming in assembly language, these are two completely different
machines , because the instruction sets, data types, addressing techniques, etc. Totally different.

Computer composition refers to how the properties embodied in a computer's architecture are implemented, and it contains many hardware details that are
transparent .
For example, the instruction system reflects the properties of the machine, which is a problem of computer structure. However, the implementation of instructions, how to
fetch instructions, analyze instructions, fetch operands, how to operate, how to send results, etc., all belong to the problem of computer composition.
Therefore, when two machines have the same instruction system, they can only be considered to have the same structure. As for how the two machines implement
their instructions, they can be completely different, so we think their composition is different.

**冯诺依曼提出,存储程序的概念,以此概念为基础的各类计算机,统称为冯诺依曼机。**
Features:
1. The computer consists of arithmetic unit, memory, controller, input device, and output device.
2. Instructions and data are stored in the memory at the same level, and can be searched by address
. 3. Instructions and data are represented by binary codes.
4. An instruction consists 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 in the memory
where the operand is located .
5. Instructions are stored in the memory in order. Usually, the instructions are executed sequentially. Under certain conditions, the execution order can be changed according to the
result or according to the set conditions
.

Calculator: completes arithmetic and logic operations, and temporarily stores the intermediate results of the operation in the calculator
Memory : used to store data and programs
Controller: used to control, command program and data input, run, and process calculation results
Input device : It is used to convert the familiar information form into the information form that the machine can recognize, such as keyboard and mouse
. Output device: Convert the machine operation result into the familiar information form, such as printer output and monitor output.

Because the logic relationship and circuit structure of the arithmetic unit and the controller are very closely related, these two large components are often fabricated
on the same chip, which is usually collectively referred to as the central processing unit, or CPU for short.
ALU: Arithmetic Logic Unit
CU: Control Unit
ALU and CU make up the CPU

Input devices and output devices are referred to as I/O devices.

Modern computers can be considered to be composed of three major parts: CPU, I/O devices and main memory MM. The CPU and MM together can also be
called host.

The main memory MM is a type of memory subsystem, used to store programs and data, and it can directly exchange information with the CPU.
The other type is called auxiliary memory, also known as auxiliary memory (external memory)

**运算器**: Includes three registers and an ALU. Where ACC is the accumulator, MQ is the multiplication quotient register, and X is the operand
register . When these three registers complete different operations, the types of operands stored are also different.

**主存储器**: Including memory banks, various logic components and control circuits, etc. The memory bank is composed of many memory cells, and each memory
cell contains several memory elements, and each memory element can register a binary code "0" or "1". It can be seen that a
storage unit can store a string of binary codes, and this string of binary codes is called a storage word. The number of stored words in this string is called the
storage word length. The storage word length can be 8 bits, 16 bits or 32 bits, etc. A storage word
can a string of characters. For example, the storage word is 0011011001111101, which can represent either 367DH in hexadecimal or a hexadecimal
binary number. This value corresponds to a decimal number of 13949. It can also represent two ASCII codes. A memory word can also represent an
instruction .
We can compare a storage volume to a building, then each storage unit can be
regarded as each room in the building, and each storage unit can be regarded as a bed in each room. Obviously each room needs to have a room number, so we give
each storage unit a number called the address number of the storage unit. The working mode of the main memory is to
realize . This access method is called access by address, that is, access memory by address.
In order to achieve access by address, two registers MAR and MDR must also be configured in the main memory. MAR is a memory address
register , which is used to access the address of the storage unit to be accessed, and its number of bits corresponds to the number of storage units (for example, if MAR is 10 bits, there
are 2^10=1024 storage units, denoted as 1K). MDR is a memory data register, which is used to store
the code fetched from a certain unit of the memory bank or the code to be stored in a sufficient storage unit, and its number of bits is equal to the length of the storage word.
With the development of hardware technology, the main memory is made into a chip that inherits the circuit on a large scale, and the MAR and MDR are made in the CPU chip.

**控制器**: The nerve center composed of computers. Specifically, it first instructs the memory to read out an instruction, which
is . Then analyze this instruction, point out what kind of operation the instruction is to complete, and specify the address of the
operand , which is called the analysis process. Finally, according to the address of the operand, take out the operand and complete some operation, which
is called the execution process. Completes three phases of an instruction operation: instruction fetch, analysis, and execution.
The controller consists of program counter PC, instruction register IR and control unit CU. The PC is used to store the address of the current
instruction , there is a direct path between it and the main memory MAR, and has the function of automatically incrementing by 1, that is,
the address of the next instruction is automatically formed. IR is used to store the current instruction, and the content of IR comes from the MDR of main memory.

**影响计算机性能:**
1. Machine word length
refers to the number of bits that the CPU can process data at a time, which is usually related to the number of register bits of the CPU. 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 the word length of the CPU is short and
the needs to be operated on, it needs to be completed after many operations.
2. Storage capacity The
storage capacity should include the main storage capacity and the auxiliary storage capacity. Main memory capacity refers to the total amount of binary code stored in main memory.
That is, storage capacity = number of storage units × storage word length

The number of bits of MAR reflects the number of storage units, and the number of bits of MDR reflects the length of the storage word. For example, if MAR is 16 bits, there
are 2^16 storage units, and MDR is 32 bits, which means that the storage capacity is 2^16×32=2^21 = 2M (1M=2^20) bits.
In modern computers, the number of bytes is often used to describe the size of the capacity, so the above capacity is 256KB (B is used to represent a byte)

3. Operation speed The operation speed of the
computer is related to many factors, such as the main frequency of the machine, what operation to perform, the speed of the main memory itself (
the main memory is fast, and the fetching of instructions and numbers is fast) and so on.
The computing speed of today's machines is generally measured by the average number of instructions executed per unit time, and MIPS is used as the unit of
measurement , that is, millions of instructions are executed per second. For example, a computer executes 2 million instructions per second, which is recorded as 2MIPS. It is also useful to use CPI
, that is, the number of clock cycles (reciprocal of the main frequency) required to execute an instruction, or FLOPS, that is, the number of floating-point operations per second to measure the
operation speed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325553503&siteId=291194637