一個機器周期 計算機_計算機科學組織| 機器周期

一個機器周期 計算機

機器周期 (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:

機器周期的四個階段通常分為兩類:

  1. Instruction cycle

    指令周期

  2. 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也將更新,以指向要執行的下一條指令。

Machine Cycle in Computer science organization

翻譯自: https://www.includehelp.com/cso/machine-cycle.aspx

一個機器周期 計算機

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/377594.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/377594.shtml
英文地址,請注明出處:http://en.pswp.cn/news/377594.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

四、Transforms

transform是torchvision下的一個.py文件,這個python文件中定義了很多的類和方法,主要實現對圖片進行一些變換操作 一、Transforms講解 from torchvision import transforms#按著Ctrl,點擊transforms進入到__init__.py文件中 from .transfo…

leetcode 134. 加油站 思考分析

目錄題目1、暴力法,雙層遍歷2、貪心題目 在一條環路上有 N 個加油站,其中第 i 個加油站有汽油 gas[i] 升。 你有一輛油箱容量無限的的汽車,從第 i 個加油站開往第 i1 個加油站需要消耗汽油 cost[i] 升。你從其中的一個加油站出發&#xff0…

單鏈線性表的實現

//函數結果狀態代碼#define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 //Status是函數的類型,其值是函數結果狀態代碼 typedef int Status; typedef int ElemType;…

時間模塊,帶Python示例

Python時間模塊 (Python time Module) The time module is a built-in module in Python and it has various functions that require to perform more operations on time. This is one of the best modules in Python that used to solve various real-life time-related pro…

五、torchvision

一、下載CIFAR-10數據集 CIFAR-10數據集官網 通過閱讀官網給的解釋可以大概了解到,一共6w張圖片,每張圖片大小為3232,5w張訓練圖像,1w張測試圖像,一共由十大類圖像。 CIFAR10官網使用文檔 torchvision.datasets.CIF…

leetcode 69. x 的平方根 思考分析

題目 實現 int sqrt(int x) 函數。 計算并返回 x 的平方根,其中 x 是非負整數。 由于返回類型是整數,結果只保留整數的部分,小數部分將被舍去。 示例 1: 輸入: 4 輸出: 2 示例 2: 輸入: 8 輸出: 2 說明: 8 的平方根是 2.82842…, 由于返回…

背包問題 小灰_小背包問題

背包問題 小灰Prerequisites: Algorithm for fractional knapsack problem 先決條件: 分數背包問題算法 Here, we are discussing the practical implementation of the fractional knapsack problem. It can be solved using the greedy approach and in fraction…

360瀏覽器兼容問題

360瀏覽器兼容問題 360瀏覽器又是一大奇葩,市場份額大,讓我們不得不也對他做些兼容性處理。 360瀏覽器提供了兩種瀏覽模式,極速模式和兼容模式,極速模式下是webkit內核的處理模式,兼容模式下是與IE內核相同的處理模式。…

轉 設計師也需要了解的一些前端知識

一、常見視覺效果是如何實現的 一些事 關于文字效果 互聯網的一些事 文字自身屬性相關的效果css中都是有相對應的樣式的,如字號、行高、加粗、傾斜、下劃線等,但是一些特殊的效果,主要表現為ps中圖層樣式中的效果,css是無能為力的…

六、DataLoader

一、DataLoader參數解析 DataLoader官網使用手冊 參數描述dataset說明數據集所在的位置、數據總數等batch_size每次取多少張圖片shuffleTrue亂序、False順序(默認)samplerbatch_samplernum_workers多進程,默認為0采用主進程加載數據collate_fnpin_memorydrop_las…

單調棧 leetcode整理(一)

目錄單調棧知識402. 移掉K位數字1673. 找出最具競爭力的子序列316. 去除重復字母(1081. 不同字符的最小子序列)321. 拼接最大數單調棧知識 單調棧就是一個內部元素有序的棧(大->小 or 小->大),但是只用到它的一…

數字簽名 那些密碼技術_密碼學中的數字簽名

數字簽名 那些密碼技術A signature is usually used to bind signatory to the message. The digital signature is thus a technique that binds a person or the entity to the digital data. This binding ensures that the person sending the data is solely responsible …

七、torch.nn

一、神經網絡模塊 進入到PyTorch的torch.nnAPI學習頁面 PyTorch提供了很多的神經網絡方面的模塊,NN就是Neural Networks的簡稱 二、Containers torch.nn下的Containers 一共有六個模塊,最常用的就是Module模塊,看解釋可以知道&#xff0c…

Java多線程初學者指南(8):從線程返回數據的兩種方法

本文介紹學習Java多線程中需要學習的從線程返回數據的兩種方法。從線程中返回數據和向線程傳遞數據類似。也可以通過類成員以及回調函數來返回數據。原文鏈接 從線程中返回數據和向線程傳遞數據類似。也可以通過類成員以及回調函數來返回數據。但類成員在返回數據和傳遞數據時有…

【C++進階】 遵循TDD原則,實現平面向量類(Vec2D)

目錄1、明確要實現的類的方法以及成員函數2、假設已經編寫Vec2D,根據要求,寫出測試代碼3、編寫平面向量類Vec2D,并進行測試4、完整代碼5、最終結果1、明確要實現的類的方法以及成員函數 考慮到效率問題,我們一般將函數的參數設置為引用類型。…

Keilc的中斷號計算方法

中斷號碼 (中斷向量-3)/8轉載于:https://www.cnblogs.com/yuqilihualuo/p/3423634.html

md5模式 簽名_MD的完整形式是什么?

md5模式 簽名醫師:醫學博士/常務董事 (MD: Doctor of Medicine / Managing Director) 1)醫學博士:醫學博士 (1) MD: Doctor of Medicine) MD is an abbreviation of a Doctor of Medicine degree. In the field of Medicine, it is the main academic de…

八、卷積層

一、Conv2d torch.nn.Conv2d官網文檔 torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride1, padding0, dilation1, groups1, biasTrue, padding_modezeros, deviceNone, dtypeNone) 參數解釋官網詳情說明in_channels輸入的通道數,如果是彩色照片通道…

HTMl5結構元素:header

頁眉header 頁眉將是頁面加載的第一個元素&#xff0c;包含了站點的標題、logo、網站導航等。<header> <div class"container_16"> <div class"logo"> <h1><a href"index.html"><strong>Real</st…

【C++grammar】左值、右值和將亡值

目錄C03的左值和右值C11的左值和右值將亡值在C03中就有相關的概念 C03的左值和右值 通俗的理解&#xff1a; (1) 能放在等號左邊的是lvalue (2) 只能放在等號右邊的是rvalue (3) lvalue可以作為rvalue使用 對于第三點可以舉個例子&#xff1a; int x ; x 6; //x是左值&#…