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 GK24 Editorial Team· Published · 5 min read

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.
| Level | Example | Speed and size |
|---|---|---|
| Register | Accumulator, program counter | Fastest; a few bytes |
| Cache | L1, L2 and L3 cache | Very fast; kilobytes to megabytes |
| Main memory | DRAM module, ROM chip | Fast; gigabytes |
| Secondary | Hard disk, SSD, pen drive | Slower; gigabytes to terabytes |
| Tertiary | Magnetic tape | Slowest; 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 comparison | SRAM | DRAM |
|---|---|---|
| Storage element | Flip-flop of transistors | Capacitor |
| Refreshing | Not required | Required constantly |
| Speed and cost | Faster and costlier | Slower and cheaper |
| Normally used as | Cache memory | Main 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 memory | Register, inside the CPU |
|---|---|
| Cache memory is built from | Static RAM (SRAM) |
| Main memory is built from | Dynamic RAM (DRAM), which needs constant refreshing |
| Volatile memory | RAM; its contents are lost when the power goes off |
| EPROM erased by | Ultraviolet light through a quartz window |
| EEPROM erased by | An electrical signal, byte by byte, in circuit |
| Nibble and byte | 1 nibble = 4 bits; 1 byte = 8 bits |
| Step between units | 1,024, that is 2 raised to the power 10 |
| CD capacity | 700 MB |
| DVD capacity | 4.7 GB, single-sided single-layer |
| Blu-ray capacity | 25 GB per layer |
| 3.5-inch floppy disk | 1.44 MB |
| Sequential access device | Magnetic tape |
| Virtual memory area on disk | Swap space, also called the page file |
| Flash memory is a form of | EEPROM, erased in blocks |
Practice MCQs on this topic
Which of the following is the fastest memory in a computer system?
- A.Cache memory
- B.Register
- C.Main memory
- D.Hard disk
Show answer
Correct answer: B. Register
Explanation
The correct answer is B, register. A register is built into the CPU itself and holds the word the arithmetic and logic unit is operating on at that instant, so it is read and written in a single clock cycle. Nothing in the machine is closer to the processor, and nothing is faster.
Option A, cache memory, is the second fastest and is the right answer only when registers are missing from the options; it sits between the CPU and main memory and is built from static RAM. Option C, main memory, is the DRAM the processor addresses directly, which is fast but an order slower than cache because every cell has to be refreshed. Option D, the hard disk, is secondary storage with moving platters and heads, so its access time is measured in milliseconds against nanoseconds for the levels above it. The order to memorise is register, cache, main memory, secondary storage, magnetic tape.
How many bits make one nibble?
- A.2 bits
- B.4 bits
- C.8 bits
- D.16 bits
Show answer
Correct answer: B. 4 bits
Explanation
The correct answer is 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.
Option A, 2 bits, has no standard name in this ladder and is simply a distractor. Option C, 8 bits, is one byte, the space needed to store a single character in the ASCII scheme, and it is the most common wrong choice because candidates confuse the byte with the nibble. Option D, 16 bits, is two bytes, often called a half word on a 32-bit machine. Fix the small ladder in memory: 1 bit, 1 nibble of 4 bits, 1 byte of 8 bits, and then every higher unit multiplying by 1,024.
Which type of memory has to be refreshed thousands of times per second to retain its contents?
- A.SRAM
- B.DRAM
- C.ROM
- D.Flash memory
Show answer
Correct answer: B. DRAM
Explanation
The correct answer is B, DRAM. Dynamic RAM stores each bit as a charge on a very small capacitor, and that charge leaks away in a few milliseconds, so the memory controller has to read and rewrite every cell continuously. The word dynamic in the name refers to exactly this refresh cycle.
Option A, SRAM, stores a bit in a flip-flop of transistors that holds its state as long as power is supplied, so it needs no refreshing at all; that is what makes it fast enough for cache and too costly for main memory. Option C, ROM, is non-volatile and keeps its contents even without power, so refreshing does not apply. Option D, flash memory, is also non-volatile: it traps charge in a floating gate that holds for years, which is why pen drives and SSDs survive being unplugged. Only dynamic RAM is refreshed.
The contents of an EPROM chip are erased by exposing it to
- A.An electrical signal
- B.Ultraviolet light
- C.A magnetic field
- D.Infrared radiation
Show answer
Correct answer: B. Ultraviolet light
Explanation
The correct answer is 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.
Option A, an electrical signal, erases EEPROM, the electrically erasable version, and this is the single most common confusion in the chapter: EPROM needs light, EEPROM needs a voltage, and EEPROM can be erased one byte at a time without removing the chip. Option C, a magnetic field, erases magnetic media such as tape or a floppy disk, not a semiconductor ROM. Option D, infrared radiation, does not carry the energy needed to free the trapped electrons and is only a distractor. Remember also that MROM is written by the maker and PROM can be written once.
One terabyte is equal to how many gigabytes?
- A.100 GB
- B.512 GB
- C.1,024 GB
- D.2,048 GB
Show answer
Correct answer: C. 1,024 GB
Explanation
The correct answer is C, 1,024 GB. Every step in the ladder of storage units multiplies by 1,024, because 1,024 is 2 raised to the power 10 and memory is addressed in binary. So 1,024 bytes make a kilobyte, 1,024 kilobytes a megabyte, 1,024 megabytes a gigabyte and 1,024 gigabytes a terabyte.
Option A, 100 GB, would be right only if the units advanced in powers of ten, which is how disk makers advertise capacity but not how examiners count it. Option B, 512 GB, is a common drive size and a power of two, but it is half a binary terabyte, not a whole one. Option D, 2,048 GB, is two terabytes. Learn the chain beyond the terabyte as well, because it is asked: petabyte, exabyte, zettabyte and yottabyte, each again 1,024 times the one before it.
Which of the following is an example of volatile memory?
- A.ROM
- B.RAM
- C.Hard disk
- D.Pen drive
Show answer
Correct answer: B. RAM
Explanation
The correct answer is B, RAM. Random Access Memory holds a bit only while it is powered, whether the cell is a flip-flop in static RAM or a leaking capacitor in dynamic RAM. Cut the supply and everything in RAM is gone, which is why unsaved work is lost in a power failure.
Option A, ROM, is the standard non-volatile primary memory and keeps the bootstrap loader and the BIOS ready for the next start-up. Option C, the hard disk, stores data as permanent magnetic patterns on its platters, so it needs no power to remember. Option D, the pen drive, uses flash memory, which traps charge in a floating gate and holds it for years without a supply. In short, only RAM among the four is volatile; cache, being static RAM, is volatile too, and is the answer when RAM is not listed.
What is the storage capacity of a standard single-sided, single-layer DVD?
- A.700 MB
- B.1.44 MB
- C.4.7 GB
- D.25 GB
Show answer
Correct answer: C. 4.7 GB
Explanation
The correct answer is C, 4.7 GB. A Digital Versatile Disc uses a shorter wavelength laser and finer pits than a compact disc, so one side with one recording layer holds about 4.7 GB; a double-layer disc of the same size holds roughly 8.5 GB.
Option A, 700 MB, is the capacity of an ordinary compact disc, the figure most often mixed up with the DVD in the examination hall. Option B, 1.44 MB, is the capacity of the 3.5-inch floppy disk, a number still asked because it appears in old syllabuses. Option D, 25 GB, is one layer of a Blu-ray disc, which reads with a blue-violet laser of even shorter wavelength. Learn these four capacities together as a set, because a question often lists all of them and asks for one: 1.44 MB, 700 MB, 4.7 GB and 25 GB.
Cache memory is placed between which two units of a computer?
- A.The CPU and the main memory
- B.The main memory and the hard disk
- C.The keyboard and the CPU
- D.The CPU and the printer
Show answer
Correct answer: A. The CPU and the main memory
Explanation
The correct answer is A, the CPU and the main memory. Cache is a small block of static RAM that keeps the instructions and data most recently used by the processor. Because it answers in a fraction of the time DRAM takes, it hides the gap between a fast processor and slower main memory; a request satisfied from it is a cache hit and one that is not is a cache miss.
Option B describes a disk buffer or disk cache, a different arrangement and not what the term cache memory means in this chapter. Option C is wrong because input from a keyboard is handled by a controller and a small buffer, not by the CPU cache. Option D is wrong for the same reason on the output side, where a printer has its own buffer and the operating system uses spooling. Remember the levels as well: L1 lies inside each core, L2 next, and a larger L3 is shared between cores.
Which technique allows a computer to run programs larger than its physical RAM by using part of the hard disk as memory?
- A.Caching
- B.Virtual memory
- C.Spooling
- D.Defragmentation
Show answer
Correct answer: B. Virtual memory
Explanation
The correct answer is B, virtual memory. The operating system reserves an area of the hard disk, called the swap space or the page file, and moves pages a program is not actively using out to it. The program sees one large address space, so software bigger than the installed RAM still runs, though every swap costs time because a disk is far slower than memory.
Option A, caching, does the opposite: it keeps recently used data in a faster memory nearer the processor rather than extending memory onto a slower device. Option C, spooling, queues jobs such as documents waiting to be printed on the disk so the CPU need not wait for a slow peripheral. Option D, defragmentation, rearranges the scattered pieces of files on a disk so they lie in contiguous blocks and read faster; it does not add to memory at all.
A solid state drive stores data using
- A.Magnetic platters that rotate
- B.Flash memory chips
- C.Pits read by a laser
- D.Magnetic tape wound on reels
Show answer
Correct answer: B. Flash memory chips
Explanation
The correct answer is 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. Because there is no motor, no platter and no head, an SSD has no seek time, makes no noise and stands up to being knocked about, which is why it has replaced the hard disk in most new machines.
Option A describes the hard disk drive, where data is written magnetically on spinning platters along tracks, sectors and cylinders. Option C describes optical media, the CD, DVD and Blu-ray disc, where a laser burns and reads pits and lands on a reflective layer. Option D describes magnetic tape, the archival medium and the standard example of sequential access storage. All four are secondary storage: the SSD differs in technology, not in its place in the memory hierarchy.
The storage capacity of a standard 3.5-inch floppy disk is
- A.720 KB
- B.1.44 MB
- C.2.88 MB
- D.10 MB
Show answer
Correct answer: B. 1.44 MB
Explanation
The correct answer is B, 1.44 MB. The 3.5-inch high-density floppy disk, the square plastic diskette with a metal shutter, was formatted to 1.44 MB, and that figure is still asked in computer awareness papers because it anchors the small end of the capacity ladder.
Option A, 720 KB, was the capacity of the earlier double-density 3.5-inch disk, a real figure but not the standard one, and it is the distractor most often chosen. Option C, 2.88 MB, belonged to an extra-high-density format that never came into common use. Option D, 10 MB, was the size of early hard disks, not of any floppy. Keep the set in order and no version of this question can trouble you: 1.44 MB for the floppy, 700 MB for the CD, 4.7 GB for the single-layer DVD and 25 GB for a Blu-ray layer.
Which memory is non-volatile and can be erased and rewritten electrically, byte by byte, without removing the chip from the circuit?
- A.EPROM
- B.EEPROM
- C.PROM
- D.SRAM
Show answer
Correct answer: B. EEPROM
Explanation
The correct answer is 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 device.
Option A, EPROM, is also erasable and non-volatile but needs ultraviolet light through a quartz window, which erases the whole chip at once and usually means taking it out. Option C, PROM, can be programmed only once by the user and never erased, since programming burns its internal links permanently. Option D, SRAM, is not read only memory at all: it is a fast volatile memory used as cache and loses everything the moment power stops. Note also that flash memory is EEPROM erased in blocks rather than bytes.
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


