Principles of Computer Composition - Chapter 1


The relevant notes on the principle of computer composition are based on what the teacher said in class and what I found after class.

An overview of computer systems

1. Definitions

A computer is a modern intelligent electronic device composed of hardware and software that can automatically and quickly perform a large number of numerical operations and various information processing according to pre-stored programs.
insert image description here
The hardware is visible and tangible, and the software is a virtual concept.
Note: The software does not only include those programs we wrote, but also documents . These documents may be documents for analysis before software development, and documents for maintenance after development, because software development is not a matter of one person, and it is also controlled by others. People see, if there is no documentation, if others simply look at the program, it is very likely that they will not know what you are doing.

2. Classification

1. Computers are divided into different ways of processing information
insert image description here
The main difference between digital computers and analog computers

Compare content digital computer analog computer
data representation 0 and 1 Voltage
Calculation Digital technology Voltage Combinations and Measurements
way to control Program control On-disk connection
accuracy high Low
data storage Big little
logical judgment ability powerful without

2. Computers are classified according to general differences

insert image description here
3. According to computer performance points
insert image description here

3. The level of abstraction of computer systems

1. From the perspective of programming language
, machine language -> assembly language -> high-level language
insert image description here

2. Abstraction of language virtual machine
insert image description here
3. From the perspective of software and hardware function conversion
insert image description here
4. Logical equivalence of computer hardware

Many functions in a computer can be implemented directly by specialized hardware or by software under the support of basic hardware, which is functionally equivalent to the user
: take the switch of an electric fan as an example, we can use a button , the current can be controlled by the button to control the switch of the fan, or it can be a program to control the switch of the fan, which is equivalent to the user, because the effect they see is the same, that is, the fan is turned on or off
The performance of a computer depends on the sum of the functions of the "soft" and "hard" hardware

Development of software technology, software-based hardware functions—reduce cost
Development of integrated circuit technology, hardware-based software functions—improve performance

The composition of the computer system

In the following example, main memory and memory are the same
insert image description here
insert image description here

1. The hardware composition of the computer system

insert image description here

1.1 Von Neumann computer (emphasis)

The world's first computer was ENIAC, and von Neumann was a consultant at the time

shortcoming:

ENIAC: What command to execute in each step of the operation requires the programmer to manually wire to tell the computer. The operation speed of ENIAC is offset by the time-consuming manual operation.

In 1945, the American mathematician von Neumann proposed the concept of "stored program" , which could well solve the problems that appeared at that time. The computer developed on this basis was called the von Neumann machine.

Stored program: Input the instruction into the main memory (memory) of the computer in advance in the form of binary code, and then execute the first instruction of the program according to its first address in the memory, and then execute other instructions in the order specified by the program until the program. execution ends

The first computer with von Neumann structure, the EDVAC
insert image description here
computer, was used to process data, so we should have an input device to input data into the computer, where the data contains the data we want to process, and also contains instructions.

The controller coordinates other devices to work with each other through electrical signals, and the controller is also used to parse the program instructions stored in the memory. For example, the controller reads the addition instruction from the memory, then it can control the arithmetic unit to perform the corresponding addition operation.

Von Neumann computer features:

ps: Everyone knows that this is very important when you see such a big word. The von Neumann structure is also called the Princeton structure because he is a professor at Princeton.

1. A computer consists of five parts

2. Instructions and data exist in the memory in the same position and can be accessed according to the address

3. Instructions and data are represented in binary. It is convenient to use 0 and 1 to represent the two states of the electrical signal, which are stored in the memory at the same level and accessed by address.

4. Instructions are composed of opcodes and address codes, stored in order in memory, and executed in default order

Opcode: Indicates what operation to perform, such as addition, subtraction, multiplication and division.

Address code: where the data we want to operate is stored in.

5. Stored Programs

6. Operator-centric – data transfer between input devices and output devices and memory is done through operators, which will affect the efficiency of the computer

1.2 Modern computer architecture

insert image description here
The memory is divided into the main memory (memory) and the auxiliary memory (external memory). The system is centered on the main memory
. The arithmetic unit and the controller are combined to form the central processing unit CPU. The CPU and the main memory form the host
input devices and output devices. Complexity and complexity, collectively referred to as external devices or I/O devices

insert image description here
The main memory and the CPU are collectively referred to as the host.
The main memory is the main memory, which is also the memory we are all familiar with. The
auxiliary memory is the auxiliary memory, which is the mechanical hard disk in the computer
. , the relevant data in the app will be read into the main memory, and the auxiliary memory should be regarded as an IO device
insert image description here
. The running memory refers to the main memory, and the
body storage is the auxiliary memory .
insert image description here

1.3 Harvard Structure

A memory-parallel structure that stores instructions and data separately
Features
1) Two independent memories are used to store instructions and data respectively
2) Two sets of independent buses are used as dedicated communication lines between the CPU and each memory
Application - widely used in embedded system design

1.4 Function of each component

insert image description here

2. The working process of the computer system

1. Basic computer system model

insert image description here

Address bus: The storage location of the transmission data in the main memory
At present, this picture is still very confusing, you can wait and study it later.

2. Working process

Before understanding the working process, you must first know what
insert image description here
the instruction is and the execution process of the instruction

The controller sends a certain storage address to the memory, and retrieves the instruction from the corresponding storage unit. The controller issues the corresponding operation command according to the meaning of the instruction content, and each component performs the corresponding operation according to the operation command to complete the function corresponding to the instruction.

Let’s review the related content of the controller and memory. The
controller can coordinate the operation
of each device. The memory stores data and programs.

In my own understanding:

If an instruction wants to run, we should store it first, so the first step is to send the storage address to the memory - the equivalent of storing data
. To perform an operation, you must issue a command, for example, at home, your mother said, Everyone's working, and it's time to clean up. So to fetch the instruction.
After we have the instructions, do we have to tell the specific parts what to do, or take home cleaning as an example. If there is no division of labor, but only work is said, the division of labor will be unclear. Of course, we humans can do the corresponding things. But it should be noted that what the computer needs is a clear instruction operation, that is to say, what to do at each step must be clear, not vague, because the computer is not as smart as us,
if there are no specific and clear requirements, All the parts are circled in an instant, they don't know what they are going to do

After learning the relevant content later, I will understand it more thoroughly. The above is just my personal understanding.

The stage division of the instruction execution process The
following divisions can be in different situations, not fixed. Just like the division of language into natural segments, everyone will have a different understanding, and the divisions will be different.
Two stages - instruction fetch, execution
Three stages - instruction fetch, analysis, and
execution back

3. Example of instruction execution process

ADD R1, (R2)
realizes the addition calculation of 10+18=28. Suppose 10 is stored in the general-purpose register R1, 18 is stored in the memory, its storage address 2n-1 is stored in the general-purpose register R2, and the calculation result is stored in the general-purpose register R1

18 is stored in the memory, there is a storage location, that is, its address, we store the stored address in the general register R2, and the number itself is stored in the main memory

General-purpose registers can be used to transfer and temporarily store data, and can also participate in arithmetic and logic operations, and save the operation results
insert image description here
insert image description here

Third, the performance indicators of computer hardware

1. Word length

Definition: The number of bits of binary numbers that can be processed at one time
Classification: According to the different objects, it is divided into machine word length, storage word length, instruction word length, and data word length.
insert image description here
Next, I will talk about my storage word length. My own understanding, other concepts are similar.
insert image description here

The word length directly reflects the calculation accuracy of the computer, and also affects the calculation speed and hardware cost
. In order to coordinate the constraints between the calculation accuracy and the hardware cost, many computers adopt variable word length designs.
Various word lengths may be different, but they must be in bytes. integer multiple of

2. Storage capacity

  1. Definition: The total amount of information that can be stored in a computer's memory

    Divided into main memory capacity and auxiliary memory capacity

  2. Unit
    Bit (bit) - the smallest unit, 1 0 or 1 occupies 1b
    Byte (Byte) - basic unit, 1B = 8b

  3. Representation of
    main memory capacity Main memory capacity = number of storage units × storage word length
    insert image description here

insert image description here

insert image description here

3. Operation speed

period T and frequency f

The computer system clock is a typical pulse signal generator with fairly accurate and stable frequency

Why is there a system clock in the computer?
When the computer is working, each device must cooperate with each other, but each device has its own working speed (working clock). Each device is synchronized, and the working clock of each device is generated based on the system clock.

insert image description here
CPU main frequency and clock cycle
Clock - pulse signal sent out continuously according to certain voltage amplitude and time interval
insert image description here

insert image description here

official

Performance describe Calculation formula
CPU execution time Indicates the CPU time occupied by the CPU to execute a general program CPU execution time = CPU clock cycles × CPU clock cycles
CPI Average number of clock cycles required to execute an instruction CPI = the number of CPU clock cycles required to execute a certain program ➗ the number of instructions contained in the program
MIPS Indicates how many million fixed-point instructions are executed per second on average MIPS=Number of instructions➗(Program execution time×10^6)
FLOPS The average number of floating-point operations performed per second, used to measure the performance of machine floating-point operations FLOPS=Number of floating point operations in the program➗Program execution time (s)

4. Computer performance evaluation method

insert image description here

Fourth, the development of computer

insert image description here

Guess you like

Origin blog.csdn.net/qq_52797170/article/details/123719200