The term random in RAM refers to the fact that any piece of data can be returned in constant time, irrespective of its physical location, and whether it is related to the previous piece of data. RAM helps in accessing any byte of memory without touching preceding bytes.
On the other hand, read-only memory (ROM) refers to computer memory which is used to store programs that boot the computer and perform diagnostics. Most of the computers have a small amount of ROM―around a few thousand bytes.
Random access memory is volatile, i.e., it requires a steady flow of electricity to maintain its contents, and as soon as the power goes off, whatever data that was in the RAM is lost. It is commonly known as read/write memory, and is an integral part in computers and other devices like printers.
During 1949 to 1952, magnetic core memory was widely used as writable random access memory. It was subsequently used in most computers until the development of the static and dynamic integrated RAM circuits in the late 1960s and early 1970s.
Before RAM, computers used delay line memory, relays, and different kinds of vacuum tube arrangements to implement main memory functions, which were a few hundreds or thousands of bits. Latches built out of vacuum tube triodes and discrete transistors were used for smaller and faster memories such as registers and random access register banks.
Before integrated ROM circuits were developed, random access memory was constructed using semiconductor diode matrices which were driven by address decoders.
The capacitor holds the bit information as 0 or 1, and the transistor acts as a switch which allows the control circuitry on the memory chip to read the status of the capacitor or change its state.
The capacitor is like a small bucket that stores electrons. To store 1 in the memory cell, the bucket is filled with electrons, and to store 0 it is emptied. The problem with the capacitor's bucket is that it leaks and within few milliseconds the full bucket becomes empty.
Therefore, either the CPU or the memory controller has to recharge all capacitors holding 1 before they discharge. For this, the memory controller reads the memory and then writes it right back. This refresh operation occurs automatically nearly thousands of times per second.
Types of RAM
There are mainly two basic types of RAM:
- Dynamic RAM (DRAM): DRAM has to be constantly refreshed by the memory controller, as the capacitors that hold the information or data have a built-in leak, which can only be stopped by refreshing the information. This makes DRAM slower and cumbersome.
- Static RAM (SRAM): As compared to DRAM, the storage capacity of SRAM is greater, as it uses on-off switches instead of capacitors. Therefore, SRAM is more expensive, faster, and can hold more information.
Random Access Memory could be considered as an array of boxes, where each box holds a single byte of information. A computer having one megabyte of memory can hold up to one million bytes or characters of information. The speed of RAM is measured in nanoseconds (ns). Lesser the nanoseconds, faster the speed of the computer.