Types of memory
What is Memory?
According to Wikipedia, memory is the faculty by which data or information is encoded, stored, and retrieved when needed. Similarly, in computers, memory—initially termed “store”—plays a similar role. Everything, from images and audio files to text files and instructions for key presses, is encoded as bits in the computer memory.
Each memory cell holds either 0 or 1, and millions of these bits are processed by the CPU, the brain of the computer.
Why Not a Single Large Memory Unit?
While it may seem logical to have a single large memory unit, this approach isn’t practical. As memory size increases, access time also increases, which creates a bottleneck for the processor.
To illustrate, consider a 2 GHz processor:
- Frequency = 2 GHz → Time per task = 12×109\frac{1}{2 \times 10^9} seconds
- Time per task ≈ 0.5 nanoseconds
Thus, the CPU is incredibly fast. If the memory cannot match this speed, the CPU remains idle, making the system inefficient.
Types of Memory
To overcome these challenges, we use different types of memory to balance speed, size, and cost.
1. Primary Memory (Volatile Memory)
Primary memory, also known as main memory or internal memory, is the component of computers that holds data, programs, and instructions that are currently in use. It is the segment of computer memory that can be accessed directly by the computer processor.
Primary memory mainly consists of two types: RAM and ROM.
RAM (Random Access Memory):
- RAM allows both read and write operations.
- It is also called volatile memory because the data stored in RAM is lost in case of a power failure.
- There are two types of RAM:
- SRAM (Static Random Access Memory):
- SRAM uses transistors to store information.
- It does not require periodic refreshing of data.
- DRAM (Dynamic Random Access Memory):
- DRAM uses capacitors to store data.
- It needs to be refreshed periodically to retain data.
- SRAM (Static Random Access Memory):
ROM (Read-Only Memory):
- In ROM, only read operations are possible.
- It is non-volatile, meaning the data in ROM remains intact even when the power is turned off.
- There are three categories of ROM:
- PROM (Programmable ROM):
- PROM can be programmed only once.
- EPROM (Erasable Programmable ROM):
- EPROM can be reprogrammed using ultraviolet light.
- EEPROM (Electrically Erasable Programmable ROM):
- EEPROM can be reprogrammed using an electric charge.
- PROM (Programmable ROM):
This is all about primary memory.
2. Secondary Memory (Non-Volatile Memory)
- Stores data permanently, even without power. Examples include hard disk drives (HDDs) and solid-state drives (SSDs).
- HDDs use semi-random access mechanisms, where the read/write head can locate a track randomly, but block access is sequential, making it slower than primary memory. Lets study secondary memory in more detail.
Introduction to Secondary Memory
To store data permanently, the computer uses secondary memory.
Types of Data Stored in Secondary Memory
Secondary memory is used to store data such as:
- Operating systems, which manage the entire system
- System software like device drivers
- Application programs
- Images, audio files, videos, games, documents, and much more
We often hear that the processor is unaware of the secondary memory’s existence. To the processor, RAM is the only physical memory, which is why it is referred to as the “physical address space”.
On the other hand, the secondary memory is managed by the operating system, and it communicates with the main memory through a technique known as virtual memory mapping.
(Note: The virtual memory mapping technique is part of the Operating System course, so we will mainly focus on the architectural specifications of secondary memory in this course.)
Categories of Secondary Memory
We can classify secondary memories into two categories:
- Removable Auxiliary Storages
- Fixed Auxiliary Storages
Removable Auxiliary Storages
These storage types offer portability, meaning they allow us to transfer data from one computer to another. For instance, if we have received a hall ticket via email for an exam, we can store its digital copy on a USB flash drive and then go to an internet cafe to print it.
In this case, the USB drive provided portability by allowing us to transfer the file from one machine to another. Now, let’s look at the different removable auxiliary storages:
1. Magnetic Tapes
- Magnetic tape is a medium for magnetic storage, made of a thin, magnetizable coating on a narrow strip of plastic film.
- First developed in Germany in 1928, it was based on magnetic wire recording.
- While mostly obsolete today, magnetic tapes are still used in tape vaulting—a process for backing up critical data, particularly for analytical processing in big companies.
- The Sony Corporation achieved a storage capacity of 185 terabytes per cartridge in 2014.
2. Floppy Disks
- Floppy disks debuted in 1960 and came in three sizes: 8-inch, 5.25-inch, and the popular 3.5-inch.
- The most commonly used floppy disks had storage capacities of 1.2 to 1.44 MB.
- Floppy disks became so popular that their symbol is still used in software to represent the “save” function.
- An interesting fact: The first hard drive partitions were named starting with C because earlier systems used floppy drives labeled A and B.
3. Optical Disks
- Optical disks are data storage devices that use low-powered laser beams for writing and reading data.
- Types include:
- CD (Compact Disc): 700 MB storage capacity
- DVD (Digital Versatile Disc): 4.7 GB capacity
- BD (Blu-ray Disc): Up to 128 GB for quad-layer disks
- All these disks use similar data storage methods, subdividing the disk into tracks and sectors.
Now lets know more about CD :-
CD (Compact Disc)
Lazers, Rainbows, and 80s Innovations: The Compact Disc Revolution
The 80s saw groundbreaking technology like laser discs, drum machines, and the radical introduction of the compact disc (CD). CDs, with their robust data capacity, revolutionized media consumption and storage. Though streaming has since dominated, the CD marked a turning point in digital sound.
The CD’s predecessor, the Laser Disc (launched in 1978), used optical technology to store analog video via pits and lands. This laid the groundwork for Philips and Sony to co-develop a digital audio format in 1979. Compact in size, with high-quality sound, the CD was named to echo Philips’ earlier “Compact Cassette.”
How CDs Work
CDs use non-return-to-zero inverted encoding, where changes between pits and lands encode binary data. Error correction mechanisms like Cross-Interleaved Reed-Solomon Code (CIRC) ensure playback accuracy despite scratches or defects. Encoding techniques like 8-to-14 modulation further reduce errors.
Manufacturing CDs
CDs are molded from a master disc etched with data, then metallized with aluminum and coated for protection. Unlike LaserDiscs, CDs are single-sided, with data just beneath the label. This design makes them more scratch-resistant.
Advances and Oddities
Sony and Philips’ collaboration set new standards for digital audio. Later, hybrid formats like DualDiscs attempted to bridge CDs with DVDs but failed to meet official CD standards. Though largely obsolete today, CDs remain a fascinating milestone in digital media history.
4. Memory Cards
- Memory cards, based on flash memory, are used in portable devices like digital cameras, smartphones, and tablets.
- Flash memory was invented by Toshiba in the 1980s.
- Memory cards come in several variations:
- SD Cards (Secure Digital): Up to 2 GB
- SDHC Cards (Secure Digital High Capacity): 2 GB to 32 GB
- SDXC Cards (Secure Digital Extended Capacity): 32 GB to 2 TB
- SDUC Cards (Ultra Capacity): 2 TB to 128 TB, with speeds of 985 MB/s
5. Flash Drives
- Flash drives (also known as thumb drives) are small, portable storage devices that use flash memory with an integrated USB interface.
- Flash drives are popular for transferring files and creating backups.
- Common flash drives have a storage range of 8 GB to 256 GB, though higher capacity versions (up to 2 TB) exist.
- Flash drives are more durable than older storage technologies like floppy disks and optical discs, lasting anywhere from 10 to 100 years.
6. Hard Drives
The Power of Modern Hard Drives
A modern hard drive, small enough to fit in your hand, can store more data than a library. It achieves this through high-speed spinning discs coated with magnetized grains that store data as magnetic patterns representing zeros and ones.
Increasing Storage Density
Modern drives boast areal densities of 600 gigabits per square inch, thanks to:
- Thin film lithography for miniaturized readers.
- Noise-filtering algorithms for accurate data retrieval.
- Thermal expansion control for precise operation at nanometer scales.
Overcoming Data Loss
To combat data loss from the superparamagnetic effect, engineers shifted to perpendicular recording, achieving densities of one terabit per square inch. Emerging technologies like Heat-Assisted Magnetic Recording (HAMR) and Bit-Patterned Media promise even greater capacities, up to 20 terabits per square inch.
A Collaborative Feat
Decades of innovation by scientists and engineers have made hard drives a marvel of efficiency, storing vast data with extraordinary precision in a compact form.
Memory Hierarchy
The memory hierarchy organizes storage into levels:
- Registers: Fastest but smallest, store instructions temporarily.
- Cache Memory: Stores frequently accessed data close to the processor.
- Main Memory (RAM): Medium speed and size, used for active processes.
- Secondary Storage: Permanent and large but slower.
The virtual memory mapping technique allows seamless communication between main memory and secondary storage through paging or demand paging, managed by the operating system.
What is a Pen Drive?
A pen drive is a portable USB storage device used for transferring and storing data. It is a convenient, compact tool compatible with any system that has a USB port.
Key Features
- Introduced: Developed by M-Systems in 1999, named for its pen-like design.
- Usage: Primarily used for data storage and transfer between multiple systems.
- Compatibility: Works with any system with a USB port.
- Capacity:
- Initially offered 8 MB of storage.
- Now supports up to 1 TB, providing ample space for modern needs.
- Advantages:
- Portable and easy to use.
- Faster and more reliable than older storage options like floppy drives.
- Allows for convenient data backup and sharing.
Why is it Popular?
- Pen drives gained immense popularity due to their compact size, high storage capacity, and versatility.
- They are widely used for personal and professional data transfer, replacing bulkier and less efficient storage tools.
Conclusion
Pen drives are an essential tool for anyone needing reliable, portable storage. Their ease of use and growing storage capabilities make them indispensable in today’s digital world.
Key Insights
- A single large memory unit isn’t practical due to speed and cost constraints.
- An organized memory hierarchy optimizes performance by balancing speed, cost, and storage capacity.
- The CPU interacts with registers, cache, and main memory, while the operating system handles communication with secondary memory.