1.注册:
寄存器是处理器本身内置的最小的数据保存元素。这些是处理器可直接访问的内存位置。它可以保存一条指令,一个存储地址或任何种类的数据,例如位序列或各个字符。例如,一条指令可以指定将两个定义的寄存器的内容相乘在一起,然后放入一个特定的寄存器中。
示例:累加器寄存器,程序计数器,指令寄存器,地址寄存器等
2.内存:
内存是用于存储计算机程序,指令和数据的硬件设备。处理器内部的内存是主内存(RAM),处理器外部的内存是辅助内存(硬盘)。存储器也可以基于易失性和非易失性存储器进行分类。易失性内存是指当计算机或硬件设备断电时会丢失其内容的内存。 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. |