您的位置:首頁>正文

電腦五大部件的協同與一個指令序列的自動執行

1 表格說五大部件之功能與聯繫

要實現解決一個具體問題全部步驟(指令)執行的自動, 需要五大部件的密切配合才能完成。

功能具體功能具體部件部件具體功能運算器邏輯和算數運算
加法器
控制器1 按規定的操作去執行1.1 取出指令指令寄存器儲存取出的一個指令
1.2 指令解碼指令解碼器對指令寄存器中的指令進行解碼, 產生相應的控制信號, 加到控制門上;
1.3 執行指令
2 自動執行自動訪問下一條指令程式計數器PC能直接定址下一條指令
3 按次序執行通過時間表路控制一條指令的執行時間脈衝和節拍發生器
時鐘
記憶體存儲指令和資料能夠隨機訪問存儲單元時序(迴圈)電路
輸入輸出資料登錄輸出完成與使用者的交互介面提供統一的介面標準連線功能模組連接
位址匯流排
資料匯流排
控制匯流排

備註:指令分為兩部分:操作碼和運算元。

操作碼說明要做什麼操作, 運算元指明要處理的資料的存放位址在什麼地方。 處理器裡有百兒八十條指令, 稱為指令集;

2 每執行一條指令控制器要做幾件事

2.1 取指令:即根據地址從記憶體取出指令, 並放到指令寄存器中;

2.2 分析指令:“算”出這條指令要做什麼;

2.3 執行指令:發出操作控制信號;

2.4 程式計數器的內容加1, 確定下一條指令的位址, 為執行下一條指令做好準備。

The fetched instruction is loaded into a register in the cpu known as the instruction register.The instruction is in the form of a binary code that specifies what action the cpu is to take.The cpu interprets the instruction and performs the required action.In general these actions fall into four categoies:

I cpu-memory:Data may be transferred from the cpu to memory or from memory to cpu;

II cpu-I/O:Data may be transferred to or from the outside world by transferred between the cpu and an I/O module.

III Data processing:the cpu may perform some arithmetic or logic operation on data;

IV contrl.

A computer contains a system clock that emits pluses to establish the timing for system operations.The time to complete an instruction cycle is measured in megahertz(mHz) or millions of cycles per second.

3 控制器執行全部指令的流程

3.1 按照程式所排的指令序列, 先從記憶體中取出一條指令放到控制器的指令寄存器中;

3.2 由指令解碼器對該指令的操作碼進行分析判別;

3.3 根據指令的性質, 向電腦各部件發出相應的控制信號(包括取數和對資料的具體操作),

有序地控制各部件完成規定的操作;

3.4 從記憶體中取出下一條指令, 再執行, 依次類推;

3.5 每取一條指令, 控制器中的指令計數器就加1, 為取下一條指令做準備;

取指週期:取指令的一段時間;

執行週期:執行指令的一段時間;

4 控制器組成

主要包括三個部分:

4.1 指令寄存器IR Instruction Register:其本質是存儲部件, 寄存器是一個臨時存儲介質。 電腦將當前執行或者即將執行的指令存儲在該寄存器中;

4.2 程式計數器PC Program counter:是用來保存下一步將要執行指令的位置, 所以通過該寄存器保存的位址就可以方便地將下一步要執行的指令從內在中取出, 放到指令寄存器中;

4.3 操作控制器OC Operation Controller:負責將指令進行解碼, 產生相應的控制信號, 控制其他部件有序地運行。

因為電腦只能看懂“0”、“1”組成的語言, 需要將指令轉換為機器語言, 而這個寄存器就實現該功能。

The control unit of CPU:It uses an instruction pointer to keep track of the sequence of instruction that is supposed to be processed.Using the pointer as a guide,the control unit retrieves each instruction in sequence from RAM and places it in a special instruction register.The control unit interprets the instruction to find out what needs to be done.According to its interpretation,the control unit sends signals to the data bus to fetch data from RAM,and to the ALU to perform a process.

Data are brought into the ALU by the control unit and the ALU performs whatever arithmetic or logical operations are required to help carry out the instructions.

CPU的控制單元:控制器通過一個指令指標來追蹤即將需要處理的指令序列。 通過指針指引, 從保存在隨機記憶體(RAM)的指令序列中取出一條指令並將其保存至指令寄存器。 控制器解釋這個具體的指令以確定需要完成的操作, 並根據這個解釋, 發出信號到資料匯流排, 從RAM中獲取資料, 然後由運算器(ALU)完成資料處理(邏輯或算術操作)。

5 運算器

包括有算數邏輯單位、累加器、狀態寄存器、通用寄存器等四個部分。 其中的算數邏輯單位可以提供加、減、乘、除的算數運算和與、或、非等邏輯運算。

同類文章
Next Article
喜欢就按个赞吧!!!
点击关闭提示