Skip to content
GK24
GK NotesComputer AwarenessMemory and Storage

Memory and Storage: RAM, ROM, Cache and Units

Computer memory and storage for competitive exams: the memory hierarchy, SRAM and DRAM, the ROM family, cache, virtual memory, disc capacities and storage units.

By · Published · 5 min read

Memory and Storage: RAM, ROM, Cache and Units — GK24 title card
Memory and Storage: RAM, ROM, Cache and Units — GK24 title card

Every piece of data a computer works with has to be kept somewhere, and the chain of places it can be kept — from a register inside the processor to a magnetic tape in a vault — is called the memory hierarchy. Paper setters return to this chapter every year because the hierarchy is a ladder on which four properties always move together: the closer a memory sits to the processor, the faster, the smaller, the costlier per byte and the more volatile it is; the further away it sits, the slower, the larger, the cheaper and the more permanent it becomes. Learn the ladder once and most questions answer themselves.

The memory hierarchy, level by level

A register is the fastest storage in the machine. It sits inside the CPU itself, holds the single word of data that the arithmetic and logic unit is working on at that instant, and is measured in bytes. Cache memory comes next: a small, very fast store built from static RAM that keeps the instructions and data the processor has used most recently, so the CPU need not wait for the slower main memory. Primary or main memory is the RAM and ROM on the motherboard, which the processor can address directly. Secondary storage — hard disks, solid state drives, pen drives and discs — keeps programs and files permanently, but the processor cannot read it directly; its contents must first be copied into RAM. Tertiary or offline storage, such as magnetic tape, is meant for backup and archiving.

LevelExampleSpeed and size
RegisterAccumulator, program counterFastest; a few bytes
CacheL1, L2 and L3 cacheVery fast; kilobytes to megabytes
Main memoryDRAM module, ROM chipFast; gigabytes
SecondaryHard disk, SSD, pen driveSlower; gigabytes to terabytes
TertiaryMagnetic tapeSlowest; archives and backups

RAM, the volatile working memory

Random Access Memory is read-write memory: the processor can both fetch from it and write into it, and every location takes the same time to reach, which is exactly what random access means. RAM is volatile, so switching the power off wipes it clean. It comes in two families. Static RAM stores each bit in a flip-flop made of transistors, needs no refreshing, is very fast and very costly, and is therefore used as cache. Dynamic RAM stores each bit as a charge on a tiny capacitor that leaks away, so the circuit must refresh every cell thousands of times a second; it is slower but far denser and cheaper, which is why the main memory of every computer is DRAM. SDRAM and the DDR, DDR2, DDR3 and DDR4 modules are successive generations of synchronous DRAM.

Point of comparisonSRAMDRAM
Storage elementFlip-flop of transistorsCapacitor
RefreshingNot requiredRequired constantly
Speed and costFaster and costlierSlower and cheaper
Normally used asCache memoryMain memory

ROM and its family

Read Only Memory is non-volatile: it keeps its contents without power and is not written to in ordinary use. It holds what the machine needs the moment the switch is thrown, the bootstrap loader and the BIOS, which is why the contents of ROM are called firmware. Four members of the family are asked in pairs. MROM is masked ROM, written permanently by the manufacturer. PROM can be programmed once by the user with a PROM burner and never again. EPROM is erased by exposing its quartz window to ultraviolet light, after which it can be rewritten. EEPROM is erased and rewritten electrically, byte by byte, without taking the chip out of the circuit; flash memory is a fast, block-erasable form of EEPROM, and pen drives, memory cards and solid state drives are all built from it.

Cache hits and virtual memory

When the processor asks for a word and finds it in cache the event is a cache hit; when it does not, it is a cache miss and the word must be fetched from main memory. Processors use several levels: L1 inside each core and smallest, then L2, then a larger L3 shared between cores. Virtual memory works the other way round. When RAM runs short the operating system moves inactive pages to a reserved area of the hard disk, the swap space or page file, so that programs larger than the physical RAM can still run. It makes the machine behave as though it had more RAM than it does, at the cost of speed.

Secondary storage and its three technologies

Secondary storage is grouped by the physics it uses. Magnetic devices magnetise a coating: the hard disk with its rotating platters, read-write heads, tracks, sectors and cylinders, the old floppy disk, and magnetic tape, the one common device with sequential access. Optical devices burn and read pits with a laser: the compact disc at 700 MB, the DVD at 4.7 GB for a single-sided single-layer disc, and the Blu-ray disc at 25 GB a layer. Flash or solid state devices have no moving parts at all and trap charge in floating-gate cells: pen drives, SD cards and SSDs, which are faster, silent and far more resistant to shock than a hard disk.

Units of storage

A bit is one binary digit, 0 or 1. Four bits make a nibble and eight bits a byte, the space one character needs. Above the byte each step multiplies by 1,024, which is 2 raised to the power 10: 1,024 bytes make a kilobyte, 1,024 KB a megabyte, 1,024 MB a gigabyte, 1,024 GB a terabyte, and the ladder runs on through petabyte, exabyte, zettabyte and yottabyte. The word length is the number of bits a processor handles at one time, 32 or 64 bits in current machines.

Exam Point of View

Five question families cover this chapter. The first asks which memory is fastest, where the answer is the register unless registers are absent from the options, in which case it is cache. The second asks for a volatile or non-volatile classification, so keep RAM on one side and ROM, flash, disk and disc on the other. The third is arithmetic on units: bits in a nibble or a byte, kilobytes in a megabyte, gigabytes in a terabyte. The fourth is the ROM family, and the trap is to swap EPROM with EEPROM: ultraviolet light erases EPROM, an electrical signal erases EEPROM. The fifth asks for a capacity, so memorise 1.44 MB, 700 MB, 4.7 GB and 25 GB as a set. A sixth, rarer type asks which storage is sequential, and the answer is magnetic tape.

Important Facts

Fastest memoryRegister, inside the CPU
Cache memory is built fromStatic RAM (SRAM)
Main memory is built fromDynamic RAM (DRAM), which needs constant refreshing
Volatile memoryRAM; its contents are lost when the power goes off
EPROM erased byUltraviolet light through a quartz window
EEPROM erased byAn electrical signal, byte by byte, in circuit
Nibble and byte1 nibble = 4 bits; 1 byte = 8 bits
Step between units1,024, that is 2 raised to the power 10
CD capacity700 MB
DVD capacity4.7 GB, single-sided single-layer
Blu-ray capacity25 GB per layer
3.5-inch floppy disk1.44 MB
Sequential access deviceMagnetic tape
Virtual memory area on diskSwap space, also called the page file
Flash memory is a form ofEEPROM, erased in blocks

Practice MCQs on this topic

Q2.Computer AwarenessEasy

How many bits make one nibble?

  1. A.2 bits
  2. B.4 bits
  3. C.8 bits
  4. D.16 bits
Show answer
Correct answer: B. 4 bits

A nibble is half a byte, that is four binary digits, and it matters because one nibble is written as exactly one hexadecimal digit, from 0 to F. That is why memory addresses in hexadecimal are read four bits at a time.

Q4.Computer AwarenessMedium

The contents of an EPROM chip are erased by exposing it to

  1. A.An electrical signal
  2. B.Ultraviolet light
  3. C.A magnetic field
  4. D.Infrared radiation
Show answer
Correct answer: B. Ultraviolet light

An Erasable Programmable Read Only Memory chip carries a small quartz window over the silicon; ultraviolet light shone through that window releases the trapped charge from every cell at once and returns the chip to its blank state, after which it can be programmed again.

Q10.Computer AwarenessMedium

A solid state drive stores data using

  1. A.Magnetic platters that rotate
  2. B.Flash memory chips
  3. C.Pits read by a laser
  4. D.Magnetic tape wound on reels
Show answer
Correct answer: B. Flash memory chips

An SSD is built from flash memory, itself a block-erasable form of EEPROM, which traps charge in floating-gate cells.

Q12.Computer AwarenessHard

Which memory is non-volatile and can be erased and rewritten electrically, byte by byte, without removing the chip from the circuit?

  1. A.EPROM
  2. B.EEPROM
  3. C.PROM
  4. D.SRAM
Show answer
Correct answer: B. EEPROM

Electrically Erasable Programmable Read Only Memory is erased by applying a voltage, one byte at a time, while the chip stays soldered in place, which is why it is used for settings that must survive a power cut and yet be changed occasionally, such as the configuration data of a…

Frequently Asked Questions

Which is the fastest memory in a computer?

The register, because it lies inside the CPU itself and is read in a single clock cycle. If registers are not offered as an option, cache memory is the fastest of the remaining choices, then main memory, then secondary storage such as a hard disk, and last of all magnetic tape. Speed falls at every step away from the processor while capacity rises.

What is the difference between primary and secondary memory?

Primary memory, the RAM and ROM on the motherboard, can be addressed by the processor directly and is measured in gigabytes; the RAM part of it is volatile. Secondary storage, such as a hard disk, an SSD or a pen drive, holds data permanently and is far larger, but the processor cannot work on it directly, so its contents must first be loaded into RAM.

Why is RAM called volatile memory?

Because RAM holds a bit only as long as it is powered: a static RAM cell needs current to keep its flip-flop set, and a dynamic RAM cell needs a refresh signal to top up a leaking capacitor. The moment the supply is cut both lose their contents, which is why unsaved work disappears in a power failure while files on the disk survive.

How much is 1 GB in megabytes and 1 TB in gigabytes?

One gigabyte is 1,024 megabytes and one terabyte is 1,024 gigabytes, because every step in the ladder of storage units multiplies by 1,024, which is 2 raised to the power 10. The full order is bit, nibble of 4 bits, byte of 8 bits, kilobyte, megabyte, gigabyte, terabyte, petabyte, exabyte, zettabyte and yottabyte.

What is virtual memory?

Virtual memory is a reserved area of the hard disk, called the swap space or page file, that the operating system uses as an extension of RAM. Pages that a program is not actively using are moved out to it, so software needing more space than the physical RAM can still run. Because a disk is far slower than RAM, heavy use of virtual memory slows the machine down.

Is a solid state drive a primary or a secondary storage device?

It is secondary storage. An SSD is non-volatile, keeps files after the power goes off and cannot be addressed directly by the processor. It differs from a hard disk only in technology: an SSD stores charge in flash memory cells with no moving parts, so it is faster, silent and shock-resistant, while a hard disk writes magnetically on spinning platters.

Sources

  • Computer Science, Class XI, Chapter on Computer Systems and Memory — NCERT
  • Informatics Practices, Class XI, Chapter on Computer System — NCERT
  • Course on Computer Concepts syllabus, Memory and Storage Devices — NIELIT, Ministry of Electronics and Information Technology
View all