📜  寄存器和内存的区别

📅  最后修改于: 2021-09-12 11:28:39             🧑  作者: Mango

1.注册:
寄存器是内置于处理器本身的最小数据保存元素。这些是处理器可直接访问的内存位置。它可以保存一条指令、一个存储地址或任何类型的数据,例如位序列或单个字符。例如,一条指令可以指定将两个定义的寄存器的内容相乘,然后放置在特定的寄存器中。

示例:累加器寄存器、程序计数器、指令寄存器、地址寄存器等。

2. 内存:
存储器是用于存储计算机程序、指令和数据的硬件设备。处理器内部的存储器是主存储器 (RAM),处理器外部的存储器是辅助存储器 (Hard Drive)。存储器也可以根据易失性和非易失性存储器进行分类。易失性内存是指当计算机或硬件设备断电时会丢失其内容的内存。 RAM(随机存取存储器)是易失性存储器的一个例子。非易失性存储器是即使断电也能保留其内容的存储器。 EPROM 是非易失性存储器的一个例子。

例如:RAM、EPROM 等。

寄存器和内存的区别:

S.NO. Register Memory
1. Registers hold the operands or instruction that CPU is currently processing. Memory holds the instructions and the data that the currently executing program in CPU requires.
2. Register holds the small amount of data around 32-bits to 64-bits. Memory of the computer can range from some GB to TB.
3. CPU can operate on register contents at the rate of more than one operation in one clock cycle. CPU accesses memory at the slower rate than register.
4. Types are Accumulator register, Program counter, Instruction register, Address register, etc. Type of memory are RAM,etc.
5. Registers can be control i.e. you can store and retrieve information from them. Memory is almost not controllable.
6. Registers are faster than memory. RAM is much slower than registers.