一個機器周期 計算機
機器周期 (Machine Cycle)
The cycle during which a machine language instruction is executed by the processor of the computer system is known as the machine cycle. If a program contains 10 machine language instruction, 10 separate machine cycles should be executed for running the program. As the machine cycle contains four phases namely fetching, decoding, executing and storing.
由計算機系統的處理器執行機器語言指令的周期稱為機器周期 。 如果程序包含10條機器語言指令,則應運行10個單獨的機器周期來運行該程序。 由于機器周期包含四個階段,即獲取,解碼,執行和存儲。
The four-phase of the machine cycle is usually grouped into two categories:
機器周期的四個階段通常分為兩類:
Instruction cycle
指令周期
Execution cycle
執行周期
1)指令周期 (1) Instruction cycle)
This concept describes the execution sequence of the program. Instruction cycle includes the first two phases, fetching and decoding.
這個概念描述了程序的執行順序。 指令周期包括前兩個階段,即獲取和解碼。
i)提取周期 (i) Fetch cycle)
In this cycle, the instructions related to binary sequence is transferred from the memory to CPU.
在該循環中,與二進制序列相關的指令從存儲器傳送到CPU。
CPU generates the memory request based on the program counter to read the instruction from the memory.
CPU根據程序計數器生成存儲器請求,以從存儲器中讀取指令。
Program Counter holds the starting instruction address and immediately points the next instruction address.
程序計數器保存起始指令地址,并立即指向下一個指令地址。
Here, the starting address is provided by the user and the next instruction address is calculated by incrementing.
此處,起始地址由用戶提供,下一條指令地址通過遞增來計算。
Step size is depending on the size or length of the instruction i.e. if the instruction size is n byte then the step size is n.
步長取決于指令的大小或長度,即,如果指令大小為n字節,則步長為n。
When the processor supports with fixed length instruction then the PC is incremented to affixed constant during the fetch cycle to points the next time instruction address.
當處理器支持固定長度的指令時,則PC在讀取周期內遞增到固定的常數,以指向下一個時間指令地址。
So during the fetch cycle only the OPCODE related byte to transfer to the CPU. Then PC will be incremented by 1. During the decoding process, the program counter is incremented the next instruction address.
因此,在獲取周期中,只有與OPCODE相關的字節才能傳輸到CPU。 然后PC將增加1。在解碼過程中,程序計數器將增加下一個指令地址。
The process of transfer the instruction related binary sequence from the memory to CPU is called an instruction fetch.
將指令相關的二進制序列從存儲器傳輸到CPU的過程稱為指令提取。
ii)解碼 (ii) Decoding)
This phase of instruction cycle is responsible for breaking down the instruction into different parts so that it can be easily understood before being processed by the CPU. The Instruction is usually decoded by the instruction decoder which is a vital component of the CPU. The decoding of an instruction is also known as interpreting. The instruction is interpreted to determine two keys attributes of an instruction the opcode and the operands. the type of operations to be performed is identified by the opcode and the data on which the operation is to be performed is identified by the operand. Data is transferred to the Data Register (DR).
指令周期的這個階段負責將指令分解為不同的部分,以便在被CPU處理之前可以很容易地理解它。 指令通常由指令解碼器解碼,而指令解碼器是CPU的重要組成部分。 指令的解碼也稱為解釋。 解釋該指令以確定操作碼和操作數的一條指令的兩個鍵屬性。 操作碼標識要執行的操作的類型,操作數標識要執行的數據。 數據被傳輸到數據寄存器(DR)。
2)執行周期 (2) Execution cycle)
Execution cycle includes two phase executing and storing. The execution cycle executes the instruction and stores the result back to the main memory or sends it to the output device of the computer system.
執行周期包括兩個階段的執行和存儲。 執行周期執行該指令并將結果存儲回主存儲器或將其發送到計算機系統的輸出設備。
i)執行 (i) Executing )
The objective of the execution cycle processes the currently fetched instructions.
執行周期的目標是處理當前獲取的指令。
To process the instruction there is a need for identifying the type of the operations associated with the instruction.
為了處理該指令,需要識別與該指令相關聯的操作的類型。
Opcode indicates the type of the operations.
操作碼指示操作的類型。
The opcode is present in the instruction but that information is defined by the instruction format.
指令中存在操作碼,但該信息由指令格式定義。
Instruction format gives the layout of an instruction that means is shown the internal structure of an instruction.
指令格式給出了指令的布局,即表示了指令的內部結構。
Instruction format is classified into five types based on the CPU organization.
指令格式根據CPU的組織分為五種類型。
CPU Organisation is classified into three types based on the availability of the ALU operand.
根據ALU操作數的可用性,CPU組織分為三種類型。
ii)存放 (ii) Storing)
In this phase the result computed in the execution phase is either sent to the memory or to an output device of the computer system. This PC of the CPU is also updated in this phase to point to the next instruction that is to be executed.
在此階段,在執行階段計算出的結果將發送到內存或計算機系統的輸出設備。 在此階段,CPU的此PC也將更新,以指向要執行的下一條指令。
翻譯自: https://www.includehelp.com/cso/machine-cycle.aspx
一個機器周期 計算機