1. Computer overview and technology, computer overview Technology
1. The main ideas of von loiman:
(1) use binary code to represent programs and data;
(2) computers use storage programs;
(3) computer hardware consists of five components: memory, memory, controller, input device, and output device.
2. Definition of computer performance
(1) Response Time)
The time from request submission to execution.
(2) Throughput (Throughput)
Work done per unit time.
(3) How does one increase the corresponding time and throughput?
Use a faster processor.
Use more processors.
3. Performance
(1) CPU time
CPU usage of a task.
Does not include the time to wait for I/O or run other programs.
(2) clock cycle
The time of a computer's clock cycle, usually a processor clock, usually a constant.
CPU time = number of CPU clock periods * Clock periods
Methods to Improve performance:
Reduce the number of clock cycles.
Increase the clock frequency.
Example:
Answer:
4. Command Performance
(1) CPI (Clock cycle per instruction)
Indicates the average number of clock cycles required to execute each command. It is the average number of clock cycles used by all commands of a program.
Number of CPU clock cycles = number of program commands x CPI
CPU time = number of program commands x CPI x clock cycle
Example 1:
CPU time A <CPU time B so A is fast.
Example 2: Comparison of code segments
Answer:
5. Performance Comparison
When comparing the performance of two computers, three factors should be taken into account:
Number of commands, CPI, and clock frequency
6. Amdahl's Law
Simplify common events and speed up.
The system performance improvement obtained after a faster execution mode is related to the usage frequency of the execution mode or the proportion of the total execution time.
Amdahl's law can be elaborated as follows: a part of the system improves the performance of the system after a faster execution mode, which is related to the usage frequency of the execution mode or the proportion of the total execution time.
Amdahl's law defines the acceleration ratio achieved by a computer system using some improvement measures.
Example 1:
Tips:
Small test: