Computer Memory
Definition
• Computer memory is any physical device used to store data, information, or
instructions either temporarily (like RAM) or permanently (like ROM, hard drives).
Structure
• Memory is divided into blocks made up of small units called cells.
• Each cell can hold a fixed amount of data (usually 1 byte = 8 bits).
Addressing
• Each memory cell has a unique address, used to store or retrieve data.
• Address range:
o Starts at 0
o Ends at (memory size − 1)
o Example: If memory has 1,024 cells (1 KB) → addresses go from 0 to 1023.
Primary Memory (RAM – ROM)
Primary memory is the main memory of the computer, directly accessible by the CPU.
It is faster than secondary storage but usually smaller in size.
1. RAM (Random Access Memory)
• Volatile → Data is lost when the power is turned off.
• Acts as the working place of a computer → stores programs and data currently in
use.
• Types of RAM:
o SRAM (Static RAM) – faster, more expensive, used in cache.
o DRAM (Dynamic RAM) – slower, cheaper, used as main memory.
Example: When you open a program, it is loaded from disk into RAM for quick access.
2. ROM (Read Only Memory)
• Non-volatile → Data is retained even when the power is turned off.
• Content is usually written during manufacturing and cannot (normally) be changed.
• Stores firmware (like BIOS).
• Variants:
o PROM (Programmable ROM) – programmed once after manufacturing.
o EPROM (Erasable PROM) – can be erased with UV light and reprogrammed.
o EEPROM (Electrically Erasable PROM) – can be erased and reprogrammed
electronically.
Example: When you start a computer, the ROM (BIOS/UEFI) provides startup
instructions.
Secondary Storage Devices
Why do we need them?
1. Limited primary storage
o Primary memory (RAM, ROM) is small in size compared to the huge amount
of data we need to store.
2. High cost of main memory
o Primary memory (especially SRAM/DRAM) is expensive.
o Secondary storage provides much cheaper storage per GB.
Characteristics of Secondary Storage Devices
• High storage capacity → Can store GBs to TBs (and beyond).
• Non-volatile → Retains data even when power is off.
• Economical → Much cheaper than primary memory.
• Removable storage media → Many devices (USBs, CDs, external HDDs) can be
removed and transported.
Examples of Secondary Storage Devices
1. Magnetic storage
o Hard Disk Drives (HDDs), Magnetic tapes, Floppy disks.
2. Optical storage
o CDs, DVDs, Blu-ray discs.
3. Solid-state storage
o SSDs (Solid State Drives), USB flash drives, Memory cards.
4. Cloud storage
o Online storage services (Google Drive, Dropbox, etc.).
Types of Secondary Storage Devices
1. Magnetic Tape
• Used mainly for large files and backup purposes.
• Data is recorded in the form of magnetic spots on the tape.
• Sequential access → to read data in the middle, you must go through earlier data
first.
• Read and write operations supported.
• Advantages: Low cost, high capacity, portable.
• Disadvantages: Slow access speed (not suitable for direct/random access).
• Example: Backup tapes used in data centers.
2. Magnetic Disks (Hard Disks / HDDs)
• Data can be directly accessed (random access).
• Information is stored on both sides of the platters.
• The disk is divided into tracks (circular paths) and sectors (slices of tracks).
• Used as main secondary storage in computers for decades.
• Advantages: High capacity, faster than magnetic tape.
• Disadvantages: Slower than SSDs, mechanical parts may fail.
• Example: Hard drives inside desktops and laptops.
3. Floppy Disk
• Material: Made of thin, flexible plastic coated with magnetic material.
• Features:
o Small and cheap.
o Removable storage device.
o Used for transferring small files in older computers.
• Capacity: Very limited (1.44 MB for standard floppy disks).
• Status: Obsolete today, replaced by USB drives, CDs, and cloud storage.
4. Optical Disks
• Data is stored using laser technology.
• Features:
o Large storage capacity compared to floppy disks.
o Data stored on a single reflective surface.
o Portable and removable.
• Examples:
o CD (Compact Disc) → typically 700 MB.
o DVD (Digital Versatile Disc) → 4.7 GB (single layer), 8.5 GB (dual layer).
o Blu-ray Disc → up to 25 GB (single layer), 50 GB (dual layer).