There's also a lot more complexity involved just in figuring out what hardware to talk to with RAM because there's so much more of it. Reading from a register looks like:
- Extract the relevant bits from the instruction.
- Put those bits onto the register file's read lines.
- Read the result.
Reading from RAM looks like:
- Get the pointer to the data being loaded. (Said pointer is probably in a register. This already encompasses all of the work done above!)
- Send that pointer off to the MMU.
- The MMU translates the virtual address in the pointer to a physical address.
- Send the physical address to the memory controller.
- Memory controller figures out what bank of RAM the data is in and asks the RAM.
- The RAM figures out particular chunk the data is in, and asks that chunk.
- Step 6 may repeat a couple of more times before narrowing it down to a single array of cells.
- Load the data from the array.
- Send it back to the memory controller.
- Send it back to the CPU.
- Use it!
寄存器:触发器原理移植
RAM:
静态存储单元(SRAM)
●存储原理:由
触发器存储数据
●单元结构:六管NMOS或OS构成
●优点:速度快、使用简单、不需刷新、静态功耗极低;常用作Cache
●缺点:
元件数多、集成度低、运行功耗大
●常用的SRAM集成芯片:6116(2K×8位),
6264(8K×8位),
62256(32K×8位),2114(1K×4位)
动态存储单元(DRAM)
●存贮原理:利用MOS管栅极电容可以存储
电荷的原理,需刷新(早期:三管基本单元;之后:单管基本单元)
●刷新(再生):为及时补充漏掉的
电荷以避免存储的信息丢失,必须定时给栅极电容补充电荷的操作
●刷新时间:定期进行刷新操作的时间。该时间必须小于栅极电容自然保持信息的时间(小于2
ms)。
●优点: 集成度远高于SRAM、功耗低,价格也低
●缺点:因需刷新而使外围电路复杂;刷新也使存取速度较SRAM慢,所以在计算机中,DRAM常用于作
主存储器。
尽管如此,由于DRAM
存储单元的结构简单,所用元件少,集成度高,功耗低,所以已成为大容量RAM的主流产品。