Digital Electronics / Memories
Memories
Learn how digital systems store information, how address lines select memory locations, and how RAM, ROM, SRAM, DRAM, PROM, EPROM, and EEPROM differ in structure and use.
Introduction
Memory is the part of a digital system that stores binary information. It may store data, instructions, configuration bits, lookup tables, or intermediate results.
A memory device is organized as many storage locations. Each location has an address, and each address stores a fixed number of bits called a word.
Why This Topic Matters
- Industry relevance: processors, microcontrollers, phones, routers, SSDs, display systems, and embedded devices all depend on memory hierarchy.
- Design relevance: address width, word size, access time, volatility, and cost decide system architecture.
- Exam relevance: GATE and PSU questions often test memory capacity, address lines, RAM/ROM differences, SRAM vs DRAM, and ROM types.
- Interview relevance: memory questions reveal whether you understand storage organization, not just definitions.
Prerequisites
- Binary numbers and bit positions
- Registers and flip-flop storage
- Address and data bus concept
- Read and write control signals
- Basic MOS capacitor and transistor switching idea
- Volatile vs non-volatile storage idea
Basic Intuition
Memory is like a huge set of numbered lockers. The address tells which locker to open. The data bus carries what is read from or written into that locker.
Address selects where. Data tells what. Control decides read or write.
Core Theory Explanation
1. Memory Organization
A memory is usually described as number of locations multiplied by word size. For example, 1024 x 8 memory has 1024 addressable locations, and each location stores 8 bits.
2. RAM
RAM means Random Access Memory. Any location can be read or written using its address. RAM is usually volatile, meaning data is lost when power is removed.
3. SRAM and DRAM
SRAM stores data using flip-flop-like latch cells. It is fast but uses more transistors per bit. DRAM stores data as charge on a capacitor. It is dense and cheaper per bit but needs periodic refresh.
4. ROM
ROM means Read Only Memory. It stores permanent or semi-permanent information such as firmware, boot code, and lookup tables. PROM, EPROM, and EEPROM differ in how they are programmed and erased.
Step-by-Step Mathematical Derivation
1. Address Lines and Locations
If memory has $$ n $$ address lines, each address line can be 0 or 1.
$$ \text{Number of locations}=2^n $$
Physical meaning: every additional address pin doubles the number of uniquely selectable memory locations.
2. Memory Capacity
If each location stores $$ m $$ bits:
$$ \text{Capacity}=2^n \times m\text{ bits} $$
This means capacity depends on both how many locations exist and how wide each stored word is.
3. Bytes
Since $$ 1\text{ byte}=8\text{ bits} $$, total bytes are:
$$ \text{Capacity in bytes}=\frac{2^n \times m}{8} $$
Working Principle
- Processor places address on the address bus.
- Address decoder selects one memory row or location.
- Control lines choose read or write operation.
- For read, selected cell drives data onto the data bus.
- For write, data bus value is stored into the selected cell.
- Timing parameters decide when data becomes valid and when it must be stable.
Diagram Explanation
Important Formulas
Addressable locations
$$ 2^n $$
Memory capacity
$$ C=2^n \times m\text{ bits} $$
Byte conversion
$$ 1\text{ byte}=8\text{ bits} $$
DRAM refresh idea
$$ Q=CV $$
Real-World Applications
- Program storage in microcontrollers
- RAM in computers and phones
- Cache memory in processors
- Firmware storage using EEPROM or flash
- Lookup tables in DSP and control systems
- Frame buffers in display systems
- Configuration memory in FPGAs
- Data logging in embedded instruments
Solved Examples
Beginner Example
How many locations are addressed by 10 address lines?
$$ 2^{10}=1024 $$ locations.
Intermediate Numerical
Find capacity of memory with 12 address lines and 8-bit word size.
Locations $$ =2^{12}=4096 $$.
Capacity $$ =4096\times8=32768 $$ bits $$ =4096 $$ bytes $$ =4KB $$.
Advanced Problem
A memory is organized as $$ 16K \times 16 $$. Find address lines and capacity in bytes.
$$ 16K=16\times1024=16384=2^{14} $$, so 14 address lines are needed.
Capacity $$ =16K\times16 $$ bits $$ =32KB $$.
Common Mistakes
- Confusing address lines with data lines.
- Forgetting to multiply number of locations by word size.
- Mixing bits and bytes during capacity calculation.
- Assuming all RAM is DRAM or all ROM is permanently unchangeable.
- Forgetting that DRAM needs refresh but SRAM does not.
- Ignoring access time in high-speed memory questions.
Comparison Tables
| Memory | Volatile? | Speed | Typical Use |
|---|---|---|---|
| SRAM | Yes | Very fast | Cache |
| DRAM | Yes | Moderate | Main memory |
| ROM | No | Read-focused | Firmware |
| EEPROM | No | Slower write | Configuration data |
Interview Questions
- What is the difference between RAM and ROM?
- Why does DRAM need refresh?
- Why is SRAM faster than DRAM?
- What is the role of address lines?
- What is word size in memory organization?
- How do you calculate memory capacity?
- Where is EEPROM used?
Exam-Oriented Notes
- Address lines decide number of locations, not word size.
- Data lines usually match word size.
- SRAM uses more area but is faster; DRAM is denser but needs refresh.
- ROM is non-volatile; RAM is generally volatile.
- Always convert bits to bytes carefully by dividing by 8.
Revision Summary
- Memory stores binary information at addressable locations.
- Address bus selects location; data bus carries information.
- RAM is read/write and usually volatile.
- ROM is non-volatile and stores permanent or semi-permanent data.
- Key formulas: locations $$ =2^n $$ and capacity $$ =2^n\times m $$ bits.
Practice Questions
Conceptual
- Explain address bus and data bus using a memory example.
- Compare SRAM and DRAM physically.
- Why is ROM used for boot code?
Numerical
- Find locations for 15 address lines.
- Find capacity of $$ 8K\times8 $$ memory in bytes.
- How many address lines are required for 64K locations?
MCQs
- Which memory needs refresh: SRAM or DRAM?
- Which bus selects memory location?
- How many bits are in one byte?