您的位置 首页 > 数码极客

【memory什么意思】深入了解存储程序结构的冯诺依曼计算机的五个主要组件

-1-存储程序和自动执行程序是冯诺依曼计算机操作的基本原理。

20世纪50年代冯诺依曼提出了由输入设备、内存、控制器、运算符、输出设备组成的五大部件和存储程序概念。命令和数据可以一起存储在内存中,程序按顺序自动运行。

CPU由运算符、控制器和寄存器以及实施数据、控制和状态的总线组成。几乎所有CPU的工作原理都可以分为四个阶段:提取(Fetch)、解码(Decode)、执行(Execute)和重写(Writeback)。CPU从内存或高速缓冲内存中删除命令,插入命令寄存器,解码命令,然后执行命令。所谓计算机的编程性,主要是指CPU的编程。

指令是规定机器做什么工作的一系列二进制数。指令分为操作码和操作数两部分。操作码描述要执行的操作,操作数指示要处理的数据的存储地址所在的位置。处理器有80条指令,称为指令集。机器语言可以看作是用处理器和寄存器操作内存的约定形式。

1.1储存程式:透过输入装置将程式载入记忆体,暂时储存。

获取1.2命令:从控制器在内存中放置程序的位置(地址)取出程序命令,并将其插入命令寄存器中。

1.3语法分析说明:控制器分析和解释收到的程序说明,确定说明的含义和具体的任务任务,然后生成与该任务相对应的控制信息,并发送到相应的部件。例如,如果任务进行两个数字的加法,则发送控制信息命令算法,从内存中取出参与的两个数字进行加法。

1.4指令执行:控制器根据指令的性质,向计算机组件发出适当的控制信号,按顺序控制每个组件的规定操作。例如,运算符接收加法控制命令和参与运算的两个数字,执行加法,运算产生的结果数据临时存储在内存中。

每次收到1.5命令时,控制器的命令计数器都会增加1,以确定下一个命令的地址,控制器按顺序接收下一个程序命令,解析命令,每个部件执行命令。这样循环将持续到程序结束。

-2-控制器

控制器的主要任务是根据从内存中获取的指令解析命令,并向该部件发送控制信号,以控制计算机组件的调整,完成必要的任务。

控制器由以下三部分组成:

2.1指令寄存器IR(Instruction Register):本质上是存储部件,寄存器是临时存储介质。计算机将当前正在运行或要执行的命令存储在寄存器中。

2.2程序计数器PC(Program Counter):保留下一步执行命令的位置,因此通过注册器存储的地址,可以轻松地从内部取出下一步要执行的命令,并将其放入命令注册器中。

2.3操作控制器操作控制器(OC):可控制命令解码、生成适当的控制信号以及其他部件的有序操作。计算机只能读取“0”和“1”组成的语言,因此必须将命令转换为机器语言,这个寄存器实现了这个功能。

controller uses an instruction pointer to keep track of The sequence of instruction that is supposed to be The pointer as a guide,The control unit

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 instant

-3-运算符

运算符的基本操作包括加、减、乘、四个运算、和、或、非、民或其他逻辑操作、移动、比较和传输等操作。也可以执行地址运算和转换。也称为算术逻辑零件(ALU)。能够执行固定点或浮点算术运算、移动操作和逻辑操作的运算逻辑部件。

3.1接收寄存器:接收并存储操作数。

3.2累积寄存器:保证

存另一个操作数和运算结果。

3.3 状态寄存器:用来记录算术、逻辑运算或测试操作的结果状态。程序设计中,这些状态通常用作条件转换指令的判断条件,所以又称为条件码寄存器。

3.4 通用寄存器:为了减少对存储器的访问,主要用来保存参加运算的操作数和运算的结果。

3.5 执行部件:包括一个加法器和各种类型的输入输出门电路。

3.6 控制电路:按照一定的时间顺序发出不同的控制信号,使数据经过相应的门电路进入寄存器或加法器,完成规定的操作。

-4- 寄存器

寄存器是CPU内部用来存放数据的一些小型存储区域,用来暂时存放参与运算的数据和运算结果。其实寄存器就是一种常用的时序逻辑电路,但这种时序逻辑电路只包含存储电路。寄存器的存储电路是由锁存器或触发器构成的,因为一个锁存器或触发器能存储1位二进制数,所以由N个锁存器或触发器可以构成N位寄存器。寄存器是中央处理器内的组成部份。寄存器是有限存贮容量的高速存贮部件,它们可用来暂存指令、数据和位址。在中央处理器的控制部件中,包含的寄存器有指令寄存器(IR)和程序计数器(PC)。在中央处理器的算术及逻辑部件中,包含的寄存器有累加器(ACC)。

寄存器部件,包括通用寄存器、专用寄存器和控制寄存器。

A register is a storage location inside the in the control unit are used to keep track of the overall status of the program that is running.Control unit registers store information such as the current instruction,the location of the next instruction to be executed,and the operands of the in the ALU,registers store data items that are added,substracted,multiplied,divided,and com registers store the results of arithmetic and logical operations.

-5- 总线:五大部件的连接

为了读出程序、处理数据等,必须要在CPU与内存之间进行数据的传送。数据是利用称为数据总线(data bus)的传输途径进行交换的。所谓总线(bus),就是计算机主板上的某种传输线路。总线的宽度(即传输线的条数),会因CPU而各异。比如,对于32位总线而言,每次可以交换32位的数据。但需要注意的是,总线位数并不是CPU的位数,而是指传输数据时的位数。例如,英特尔公司的奔腾系列为32位的CPU,其数据总线的宽度为64位。总线是与从CPU芯片里面引出来的,一根一根针(pin)脚相对应的。如果能对照CPU芯片或计算机主板的实物,找到称为总线的传输线路,对总线的概念,就会有感觉了。

此外,为了从内在读出数据,或者将数据写入内存,就必须要指定读出的位置和写入的位置。因此,内存中的每个字节(Byte)都被分配了相应的编号(当然不一定都要以字节为单位,也有采用别的单位进行编号的),这种编号就称为地址(address)。当要访问内存时,就需要从CPU传送出指定地址的电信号。这种信号也是通过总线进行传送的,但它与传送数据所用的总线(数据总线)不同,是由地址总线的位数所决定的。

比如,若地址总线只有16条(即16位总线),其所能存取访问的地址是,从0000 0000 0000 0000地址到1111 1111 1111 1111地址为止,只有65636个单元。现在市场上的奔腾系列CPU,其地址总线有32根。它可以直接访问的内在单元为232=4GB(约40亿个字节)。

主存与CPU的硬连接有三组连线:地址总线(AB)、数据总线(DB)和控制总线(CB)。把主存看作一个黑盒子,存储器地址寄存器(MAR)和存储器数据寄存器(MDR)是主存和CPU之间的接口。MAR可以接收由程序计数器(PC)的指令地址或来自运算器的操作数的地址,以确定要访问的单元。MDR是向主存写入数据或从主存读出数据的缓冲部件。MAR和MDR从功能上看属于主存,但通常放在CPU内。

Physically,a bus is a set of wires.The components of the computer are connected to the bu send information from one component to another,the source component outputs data onto the bus.The destination component then inputs this data from the bus.As the complexity of a computer system increases,it becomes more efficient(in terms of minimizing connections) at using buses rather than direct connections between every pair of devices.Buses use less space on a circuit board and require less power than a large number of direct connec also require few pins on the chip or chips that comprise the CPU.

When the cpu reads data or instruction from or writes data to memory,it must specify the address of the memory location it wishes to acce outputs this address to the address bus;memory inputs this address from the address bus and use it to access the proper memory loca I/O devices,usch as a keyboard,monitor,or disk device,has a unique address as well,when accessing an I/O device,the cpu places address of the device on the address bus.Each bus can read the address off the bus and determine whether it is the device being access by the c the other buses,the address bus always receives data form the cpu,the cpu never reads the address bus.

Data is transfered via the data bus.When the cpu fetches data from memory,it first outputs the memory address on its address bus.Then memory outputs the data onto the data bus,the cpu can then read the data from the data bus.When writing data to memory,the cpu first outputs the address onto the address bus,then outputs the data onto the data bus.The memory then reads and stores the data at proper loca processes for reading data from and writing data to the I/O devices are similar.

The control bus is different from the other two bu address bus consists of a lines,which combine to transmit one -bit address value.Similarly,the lines of the data bus work together to transmit a single multi-bit value.In contrast,the control bus is a collection of individual control signals indicate whether data is to be read into or written out of the cpu,whether the cpu is accessing memory or an I/O devices or memory is ready to transfer da control bus is really a collection of (mostly) undirectional of these signals are output from the memory and I/O subsystems,although a few are output by these subsystems to the cpu.

A system may have a hierarchy of bu example,it may use its address,data and control buses to access memory,and an I/O con I/O controller,in turn,may access all I/O devices using a second bus,often called an I/O bus or a local bus.

-End-

关于作者: luda

无忧经验小编鲁达,内容侵删请Email至wohenlihai#qq.com(#改为@)

热门推荐