;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Notes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;
1: CPU components: Register, Alu, Cu, clock.
Clock is used to synchronize internal CPU operations and other system components.
The order of steps in which the control unit coordinates execution and its instructions.
Arithmetic logic unit performs addition, weight loss, and other arithmetic operations. And logical operations such as and, or, and not.
2: instruction execution cycle
The execution of a single command can be divided into a series of independent operations, which constitute a cycle of Command Execution
Before the program starts execution, it must first load the memory. The instruction pointer contains the address of the next instruction to be executed, and the instruction queue is stored in several instructions to be executed.
3. Three steps are required for executing machine commands.
Command fetch: the Control Unit obtains the command from the command queue. please increase the value of the command pointer (IP ).
Decoding: the control unit decodes the command to determine the operation to be performed by the command. The input operand of the control unit is passed to ALU, and a signal is sent to ALU to specify the operation to be performed.
Operands: If the input operands used by the instruction are in the memory, the Control Unit obtains the operands through the read operation and copies them to the internal registers, which are invisible to the user program.
Execute: Alu execution command,
Storage output operations: If the output operations are in the memory, the control unit stores the data to the memory through write operations.
You can use the following pseudo code:
Cycle start
Take the next instruction
Forward instruction pointer (IP)
If the memory operand is used, it is read from the memory.
Execute commands
If the result is a memory operand, the data is written to the memory.
Continue Loop
4: multi-level Assembly Line
Each step in the instruction execution cycle occupies at least one system clock tick, but this does not mean that the processor must wait for all steps to finish before starting to execute the next instruction. The processor can execute its steps in parallel, this is the pipeline technology. The intel 486 processor has a six-level assembly line and their execution components are as follows:
1. Bus Interface Unit: access register and provide input/output.
2. Code prefetch unit: receives machine commands from Biu and inserts them into a storage area called a command queue.
3. instruction decode unit: decodes the commands in the prefetch queue and translates them into micro-code.
4. Execution Unit: The microcode generated by the execution command decoding unit.
5. segment unit: converts a logical address to a linear address and performs protection checks.
6. Paging unit: converts a linear address to a physical address, performs page protection checks, and retains a list of recent accessors.
For processors that are divided into k stages of execution, it takes N * k clock cycles to execute n commands.
For k-level processors and single-pipeline processors, processing n commands requires K + n-1 clock cycles.
For k-level processors and dual-pipeline, processing n commands requires K + N clock cycles.
5: multi-task
A process has its own memory and may contain multiple threads. All threads in a process share the memory space of the process. The scheduler allocates a small amount of CPU time (time slice) for each task. In a time slice, the CPU executes a series of commands and stops the execution at the end of the time slice.
The multitasking operating system runs on a processor that supports task switching.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Check question ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;
Question 1: What other basic components does the CPU contain besides registers?
A: it also contains ALU, Cu, and clock.
Question 2: Which three types of bus are used by the CPU to connect to the rest of the computer?
Answer: Data Bus, address bus, and control bus.
Question 3: Why does access to memory consume more machine cycles than access registers?
A: In general, the external CPU has a slow speed to respond to access requests in parallel. The registers are directly connected to other components in the CPU, so the access speed is faster.
Question 4: What are the three steps in the instruction execution cycle?
Answer: obtain, decode, and execute commands.
Question 5: What are the additional steps required for the instruction execution cycle when the memory operand is used?
Answer: deoperands and storage output operands (written to memory ).
Question 6: at which stage of the instruction execution cycle will the program counter value increase?
Answer: Obtain the command.
Question 7: what is the definition of pipeline execution?
A: It is possible to execute machine commands alternately at various stages of the parallel execution processor.
Question 8: How many clock cycles are required to execute two commands in a 5-level non-pipeline processor?
Answer: 5*2 = 10 clock cycles are required.
Question 9: In a 5-Level Single-pipeline processor, how many clock cycles are required to execute 8 commands?
Answer: 5 + 8-1 = 12
Question 10: What is an excessive processor?
A: It is a processor that contains more than two execution pipelines.
Question 11: How many clock cycles does a 5-level dual-pipeline processor require for one stage of execution?
Answer: 5 + 10 = 15
Question 12: when the program runs, what information does the operating system read from the disk's file directory?
Answer: The file name, file size, and file location on the physical disk. And the last modification date and time.
Question 13: How do I start executing a program after it is loaded into the memory?
Answer: set the pointer value so that the question points to the correct address. Then, the operating system executes a branch transfer command, so that the CPU starts to execute the First Command of the program.
Question 14: How can I define multiple tasks?
A: The CPU enables fast task switching between multiple programs, giving a processor the illusion of Running multiple tasks at the same time.
Question 15: What are the functions of the scheduling program in the operating system?
A: assign a certain period of time to each task and switch between tasks.
Question 16: When a processor switches from one task to another, what values must be kept in the status of the first task?
Answer: The value of the Processor register, the program counter, the status mark, and the memory used by the task.
Question 17: How long does a single clock cycle of a 3 GHz processor take?
Answer: T = 1/f --> 1/3 GHz --> 1/3*10 ^ (-9) S