A computer system is a complex of hardware and software, which can be regarded as a multi-level hierarchical structure divided by functions.
1. Composition of computer hardware
Hardware usually refers to all visible, tangible equipment entities. The original Von Neumann computer, which was arithmetic-centric in structure, has now moved to memory-centric. Figure 1-1 shows the basic block diagram of a computer.
(1) Controller
The controller is the analysis and execution of instructions of the parts, but also unified command and control of the computer parts to coordinate the central parts of the work, according to the machine instructions. The components of the controller are as follows.
-
Program counter PC: the address where the next instruction to be executed is stored;
-
Instruction register IR: Stores instructions to be executed;
-
Instruction decoder ID: analyze and explain the opcode field in the instruction;
-
Timing components: provide timing control signals;
-
Address register AR: used to store the address of the memory unit accessed by the current CPU;
(2) Arithmetic unit
Arithmetic Unit is also called Arithmetic and Logic Unit (ALU), whose main function is to complete various Arithmetic and Logic operations under the control of the controller. The arithmetic unit consists of the following.
-
ALU: Arithmetic and logical operations of data;
-
AC: General purpose register, which provides a workspace for the ALU and is used for temporary data storage;
-
Data buffer register DR: temporary storage of instructions or data when writing memory;
-
State condition register PSW: storage state and control flags (controversial point: it is also classified as the controller).
(3) Main memory
Main memory is also called internal memory (often referred to simply as “main memory” or “memory”). Stores information about field operations and intermediate results, including machine instructions and data.
(4) Auxiliary memory
Auxiliary storage is also called external storage and is often referred to simply as external storage or auxiliary storage. Store information that needs to be stored for a long time.
(5) Input equipment
The task of an input device is to send programs and raw data to a computer and convert them into information that can be recognized and accepted inside the computer. According to the form of input information can be divided into characters (including Chinese characters) input, graphics input, image input and voice input. At present, the common input devices are keyboard, mouse, scanner and so on.
(6) Output equipment
The task of an output device is to send the computer’s processing results in a form that can be accepted by humans or other devices. At present, the most common output devices are printers and monitors. Some devices can be both input devices and output devices
For example, auxiliary memory, digital to analog conversion devices used in automatic control and detection systems, etc.
2. Classification of computer system structure
The development of computer has gone through the age of electron tube and transistor, integrated circuit (small and medium scale, large scale, very large scale, very large scale). At present, the number of components on the world’s highest level of integrated circuit chip has reached more than 8 billion.
(1) The concept of stored programs
The concept of “stored program” was first put forward by Von Neumann et al in June 1946. It can be briefly summarized as follows:
-
A computer (referring to hardware) should be composed of five basic parts: arithmetic unit, memory, controller, input device and output device.
-
Inside the computer, instructions and data are represented in binary.
-
The programmed program and original data are stored in memory in advance, and then the computer is started. That’s the basic idea of a stored program.
(2) Flynn classification
In 1966, Michael.J.Flynn proposed to classify computer systems according to the polyploidy characteristics of instruction flow and data flow (usually called Flynn classification), and the relevant definitions are as follows.
-
Instruction stream: a sequence of instructions executed by a machine;
-
Data stream: A sequence of data invoked by an instruction stream, including input data and intermediate results, but not output data.
Flynn classifies computer systems into four categories, based on different instruction flow-data flow organizations.
-
Single Instruction stream and Single Data stream (SISD) : SISD is a traditional sequential single-processor computer whose Instruction parts decode one Instruction ata time and assign Data to only one operating part.
-
Single Instruction stream and Multiple Data stream (SIMD) : SIMD is represented by the parallel processor (matrix processor), which includes multiple repeated processing units controlled by a single instruction unit and distributes different data to them according to the requirements of the same instruction flow.
-
Multiple Instruction stream and Single Data stream (MISD) : MISD has N processing units, which can process the same Data stream and its intermediate results differently according to the requirements of N different instructions. The output of one processing unit is in turn the input of another. Such systems are rarely seen in practice. Some literatures regard pipeline as multiple instruction parts and call pipeline computer MISD.
-
Multiple Instruction stream and Multiple Data stream (MIMD) : MIMD refers to a multi-machine system that can realize the complete parallelism of operation, task, Instruction and other levels. For example, multi-core processor and multi-processor belong to MIMD.
3. Complex instruction set system and simplified instruction set system
In the process of the development of computer system structure, the optimization design of instruction system has two completely opposite directions. One is to enhance the function of instruction, set some instructions with complex functions, and convert some common functions originally realized by software to hardware instruction system. This Computer system is called Complex Instruction Set Computer (CISC). Reduced Instruction Set Computer (RISC) A Reduced Instruction Set Computer (RISC) consists of a Reduced Instruction Set Computer (RISC) and a Reduced Instruction Set Computer (RISC).
(1) Characteristics of CISC instruction system
-
The instructions are numerous. An instruction system has a large number of instructions, usually 100 to 250.
-
Instruction frequencies vary greatly. The most commonly used are simpler instructions, which account for only 20% of the total number of instructions, but occur 80% of the time in the program. Most complex instructions are rarely used.
-
Many addressing modes are supported. Generally, 5 to 20 addressing modes are supported.
-
Variable length instruction. Instruction length is not fixed. Variable instruction length increases the complexity of instruction decoding circuit.
-
Instructions can directly process data in the main memory unit. A typical CISC typically has instructions that process data directly from the main memory unit and are slow to execute.
-
Mainly controlled by microprogram. CISC’s instruction system is complex, making it difficult to implement controllers with hardwired logic (combinational logic) circuits, which are usually microprogrammed.
(2) Characteristics of RISC instruction system
RISC requires the instruction system to be simplified, the operation to be completed in a single cycle, the instruction format to be consistent, the addressing method to be reduced as much as possible, and improve the efficiency of compilation, and finally achieve the purpose of speeding up machine processing speed. The main features of RISC instruction system are as follows.
- Low number of instructions. Select some simple instructions and some common instructions that are used most frequently in preference to avoid using complex instructions. Only LOAD (reading from memory) and STORE (writing data to memory) instructions are provided to operate on memory; all other operations are performed between the CPU’s registers.
- The instruction has few addressing modes. Generally, only register, immediate, and relative addressing are supported.
- The instruction length is fixed and the instruction format is few. Due to the small number of RISC instructions, few formats and relatively simple, its instruction length is fixed, the division of each field between instructions is relatively consistent, and decoding is relatively easy.
- Hardwiring logic control is the main. To speed up the execution of operations, controllers are usually built with hardwired logic (combinatorial logic).
- Single cycle instruction execution, using pipeline technology. Because the instruction system is simplified, it is easy to use pipelining technology, so that most instructions can be completed in a single machine cycle. A few instructions may require multiple cycles, such as LOAD/STORE instructions that take longer to execute because they need to access storage.
- Optimized compiler: RISC’s compact instruction set makes compiling easier. Because the instructions are fixed in length, few in format, and few in addressing, compile-time does not have to choose between many instructions with similar functions or bother with addressing choices, and it is easy to optimize, resulting in machine code that executes efficiently.
- The number of general purpose registers in CPU is large, generally more than 32, and some can reach thousands.
Most RISCS use the Cache scheme, which improves the speed of fetching instructions. Also, some RISCs use two separate caches to improve performance. One is called the instruction Cache and the other is called the data Cache. In this way, instruction and data fetching can be carried out simultaneously without interference.
4, bus
A bus is a set of common information transmission lines that can be shared by multiple components in a time-sharing manner. Sharing means that multiple components can be connected to the bus, and the information exchanged between each component can be transmitted through this group of public lines. Time-sharing means that only one component is allowed to send information to the bus at the same time. If two or more components send information to the bus at the same time, signal conflicts are bound to occur. Of course, multiple parts are allowed to receive the same information from the bus at the same time.
The bus can be divided into internal bus and external bus according to the position of the bus relative to the CPU or other chips. Inside the CPU, the bus used to transfer data between registers and between arithmetic logic unit ALU and control unit is called the internal bus; An external bus is the path through which the CPU communicates with the RAM, ROM, and input/output device interfaces. As CPU through the bus to achieve program instruction, memory/peripheral data exchange, in the CASE of CPU and peripherals given, bus speed is the biggest factor restricting the overall performance of the computer.
According to the bus function to divide, and can be divided into address bus, data bus, control bus three types, people usually say the bus includes these three components, address bus is used to transmit address information, data bus is used to transmit data information, control bus is used to transmit various control signals.