Link to this headingMemory

What every programmer should know about memory, Part 1

Link to this headingRAM (Random Access Memory)

It is also called as read write memory.
It is volatile memory as the information is destroyed when power is turned off.

Link to this headingDRAM

  • Constructed of tiny capacitors the leak electricity
  • Requires recharge every few ms to retain the data
  • Cheap
  • Slower than SRAM
  • Can store may bits per chip
  • Uses less power
  • Generates less heat
  • Used for main memory

SDRAM (synchronous DRAM):

  • DRAM that is synchronized with the clock speed that the microprocessor.
  • Increase the number of instructions that the processor can perform in a given time.
  • Speed is measured in MHz rather than in nanoseconds (ns).
  • Converting between MHz and ns can be done by dividing by 1 billion. (Example 83 MHz: 1/(83*1000000)*1000000000 = 12 ns)

Link to this headingSRAM

  • Constructed from circuits similar to D-flip-flops.
  • Holds contents as long as power is available
  • Expencive
  • Faster than DRAM
  • Can not store may bits per chip
  • Uses more power
  • Generates more heat
  • Used for [CPU Cache](/Exploitation/CPU Attacks/CPU Cache.md)

Link to this headingROM (Read Only Memory)

Non-Volitile memory. Does not need electricity to keep information.
Always retains its data.

Used in embedded systems or where the programming needs no change.

PROM (Programmable read-only memory):
It can be programmed by user. Once programmed, the data and instructions in it cannot be changed.

EPROM (Erasable Programmable read only memory):
It can be reprogrammed. To erase data from it, expose it to ultra violet light. To reprogram it, erase all the previous data.

Link to this headingHybrid Memory

NVRAM:

EEPROM (Electrically erasable programmable read only memory):
The data can be erased by applying electric field, no need of ultra violet light. We can erase only portions of the chip.

Link to this headingFlash Memory

NAND Flash:

  • Without its own memory controller
  • Cheaper

NOR Flash:

  • More durable and performant
  • Costs more than NAND

eMMC Flash:

  • Soddered Memory
  • Integrated Memory controller
  • Needs minimum Command, Clock, and 1 data wire.
    • Can have more than 1 data wire to go faster

UFS: