分享

计算机五大部件的协同与一个指令序列的自动执行

 大隆龙 2017-10-07

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 运算器

包括有算术逻辑单元、累加器、状态寄存器、通用寄存器等四个部分。其中的算术逻辑单元可以提供加、减、乘、除的算术运算和与、或、非等逻辑运算。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多