2 ND Chapter
Computer Memory
Computer Memory
• Definition:
Computer memory is a physical device
capable of storing information
temporarily or permanently.
• Stores instructions and data
• Used by CPU, operating systems, and
software
• Two main types:
• Primary (Main/Internal Memory)
• Secondary (Auxiliary/Backing Storage
Memory)
Primary Memory
• Definition:
Primary memory holds instructions and
data when a program is executed.
• Also called main or internal memory
• Fast and temporary storage
• Examples: RAM, ROM
Secondary Memory
• Definition:
Secondary memory stores data and
programs not currently in use, providing
long-term storage.
• Also called auxiliary memory
• Large capacity but slower than primary
memory
• Examples: Hard disk, SSD, DVD, USB
Bit
• Definition:
A bit (binary digit) is the smallest unit of information in
computing.
• Can have only two values: 0 or 1
• Represents simple states (on/off, true/false)
• Used to store and transfer binary data
• Example: 4 bits have combination of 16 values (2⁴)
->0001 , 0010 , 0011
Byte
• Definition:
A byte is a unit of data consisting of 8 bits.
• Most common unit in computer systems
• Represents a character, digit, or symbol (A, h, 6, @)
• Storage and memory are measured in multiples of bytes
• Example: Measured in bytes, KB, MB, etc.
Units of Memory
• Definition:
Units of memory are the standard measures used to
represent the amount of data a computer can store.
• 1 Byte = 8 Bits
• Memory Word: depends on computer architecture (e.g.,
16-bit, 32-bit, 64-bit processors).
Common Units (from smallest to largest)
• Bit (b): Smallest unit, stores 0 or 1.
• Byte (B): 8 bits = 1 byte (can store one character like A or 5).
• Kilobyte (KB): 1 KB = 1024 bytes.
• Megabyte (MB): 1 MB = 1024 KB.
• Gigabyte (GB): 1 GB = 1024 MB.
• Terabyte (TB): 1 TB = 1024 GB.
Primary Memory
• Definition:
Primary memory (or main memory) is the
part of the computer that stores data and
instructions for processing.
• Key Points:
• Holds data and instructions for CPU.
• Used by system at startup and for running
programs.
• Several gigabytes in size.
• When software is loaded, it first goes into
primary memory.
Types of Primary Memory
• Primary memory is divided into:
• Chip Memory
• Magnetic Memory
Chip Memory
• Definition:
Chip memory is a semiconductor-based
memory made of tiny electronic circuits
embedded in an Integrated Circuit (IC).
• Key Points:
• Made from silicon wafers with millions of
transistors (electronic switches).
• Uses metal-oxide semiconductor technology.
• Examples: RAM, ROM, Cache, SSD, Flash
memory.
• Very fast (no mechanical parts).
• Used in computers, phones, appliances,
automobiles, etc.
Magnetic Memory
• Definition:
Magnetic memory stores data using
magnetic fields on cores or disks.
• Key Points:
• Popular from 1950s–1970s.
• Used magnetic core memory.
• Not used as main memory nowadays.
Volatile vs Non-Volatile Memory
• Memory can be classified into two types:
• Volatile memory
• Non-volatile memory
Volatile Memory
• Definition:
Volatile memory requires continuous power to store data.
When power is off, data is lost.
• Key Points:
• Example: RAM
• Fast access
• Temporary storage
Non-Volatile Memory
• Definition:
Non-volatile memory retains stored data even when power
is switched off.
• Key Points:
• Examples: ROM, Flash memory, SSD
• Permanent storage
• Used to store firmware and important data
Fundamental Types of Main Memory
• Main memory is classified into three types:
• Internal Processor Memory
• RAM (Random Access Memory)
• ROM (Read-Only Memory)
Internal Processor Memory
• Definition:
Internal processor memory is a memory that is directly
accessible to the CPU and is extremely fast.
• Examples:
• Registers: Store small amounts of data, directly linked with
CPU operations.
• Cache Memory: Stores frequently used data to speed up
processing.
Cache Memory
• Definition:
Cache memory is a very fast memory inside
or near the CPU that stores frequently
accessed data and instructions.
• Key Points:
• Reduces CPU’s time to access data from
RAM.
• If data is not found in cache, CPU fetches
from RAM.
• Greatly improves system performance.
Levels of Cache Memory
• L1 Cache
• Built into CPU core.
• Fastest but very small (up to 8 MB).
• Closest to processor.
• L2 Cache
• Larger in size (64 KB to 16 MB).
• Slightly slower than L1 but still very fast.
• Acts as a backup to L1 cache.
RAM (Random Access
Memory)
• Definition:
RAM is a volatile memory that stores data
temporarily while the computer is ON. Data is
lost when power is OFF.
• Key Points:
• Called main memory / primary memory /
system memory.
• Data is read/written randomly (not
sequentially).
• Faster but temporary.
• RAM modules are inserted into the
motherboard.
• Examples of RAM modules:
• SD-RAM, DDR, DDR2, DDR3
Types of RAM
• There are two main types:
• Static RAM (SRAM)
• Dynamic RAM (DRAM)
Static RAM (SRAM)
• Definition:
SRAM is a type of RAM that does not need to be refreshed to retain
data.
• Key Points:
• Very fast and reliable.
• Expensive and consumes more space.
• Lower storage capacity.
• Mainly used in cache memory.
Dynamic RAM (DRAM)
• Definition:
DRAM is a type of RAM that must be periodically refreshed to retain
data.
• Key Points:
• Slower than SRAM.
• Simpler and cheaper to manufacture.
• Higher storage capacity.
• Mostly used as main memory in personal computers.
SDRAM
• Definition: SDRAM (Synchronous Dynamic RAM) is a type of RAM that
operates in sync with the system clock.
Key Points:
• Works synchronously with system data bus.
• Faster than non-synchronous RAM.
• Common in modern computers.
DDR SDRAM
• Definition: DDR SDRAM (Double Data Rate SDRAM) is an improved
version of SDRAM that transfers data twice per clock cycle.
Key Points:
• Reads/writes two words per clock cycle.
• Versions: DDR1, DDR2, DDR3, DDR4, DDR5.
• Speeds: 100 MHz – 8400 MHz.
• Sizes: 512 MB to 32 GB.
ROM (Read Only Memory)
• Definition: ROM is a non-volatile memory that permanently stores
data, even when the power is off.
• Key Points:
• Permanent storage of information.
• Data cannot be written by users/programmers.
• Contents are set by manufacturers.
• Used for firmware, system boot instructions.
Types of ROM
• ROM is classified into three main types:
• PROM (Programmable Read Only Memory)
• EPROM (Erasable Programmable Read Only Memory)
• EEPROM (Electrically Erasable Programmable Read Only Memory)
PROM(Programmable Read Only Memory)
• Definition: PROM is a type of ROM that can be programmed once and
cannot be changed afterward.
Key Points:
• Manufactured Programmed it properly and no one can change it.
• Irreversible process.
• Data fed using a PROM programmer.
EPROM(Erasable Programmable Read Only Memory)
• Definition: EPROM (Erasable PROM) is a type of ROM that can be
erased and reprogrammed using ultraviolet (UV) light.
Key Points:
• Erased by exposing to UV light for 20 minutes.
• Entire chip gets erased at once.
• Can be reused after erasing.
EEPROM (Electrically Erasable Programmable Read Only
Memory)
• Definition: EEPROM (Electrically Erasable PROM) is a ROM that can be
erased and reprogrammed electrically.
Key Points:
• Erased within milliseconds.
• Limited reprogramming (10,000 times).
• Flash drives are a special type of EEPROM.
Secondary Memory
• Holds data or information permanently.
• Also called auxiliary storage / external
storage.
• Located outside the CPU.
• Non-volatile → data is not lost when power
is OFF.
• Examples: Hard Disk, CD, DVD, SSD, Flash
memory, Memory cards.
Secondary Storage Devices
• Characteristics:
• Non-volatile (data remains after power off).
• Very high capacity (up to terabytes).
• Cost-effective compared to main memory.
• Reusable: data can be erased and stored again.
• Types:
• Sequential access devices
• Random (direct) access devices
• Examples: Magnetic tapes, Magnetic disks, Optical disks, Flash
memory, Memory cards.
Sequential Access Storage
• Data stored/read in fixed or linear order.
• Retrieval is indirect (must scan records).
• Less efficient for accessing particular data.
• Cheaper than direct access storage.
• Examples: Magnetic tapes, Audio/Video cassettes.
Direct Access Storage
• Also called Random Access Storage.
• Data can be addressed independently.
• Retrieval is direct (no need to scan records).
• More efficient for accessing particular data.
• More expensive than sequential storage.
• Examples: Magnetic disks, Compact disks, SSDs, modern memory
devices.
Comparison – Sequential vs Direct Access
• Sequential Access • Direct Access
• Data read in order • Data read directly
• Less efficient • More efficient
• Cheaper • Expensive
• Used in Magnetic tapes, cassettes • Used in Disks, CDs, SSDs
Types of Secondary Storage Devices
• Secondary storage devices are divided into four categories:
• Magnetic Tapes
• Magnetic Disks
• Optical Disks
• Chip Memory
Magnetic Tapes
• Used for data storage for more than 50
years.
• Sequential access device: data is
read/written one by one in order.
• Made of thin tape with a magnetic coating.
• Used for backup, archiving, and large data
storage.
• Cheaper but slower than disks.
• Modern tapes can store up to 30 TB.
Magnetic Disks
• Most common secondary storage.
• Made of either:
• Flexible plastic → Floppy Disks
• Rigid metal → Hard Disks
• Surface coated with magnetic material.
• Multiple platters (disks) with read/write
heads.
• Allows direct access to data.
(i)Floppy Disks and Zip Disks
• Old types of magnetic storage.
• Floppy disks were popular in 1980s–
1990s.
• Portable but with very limited storage.
• Obsolete today (not used anymore).
Introduction to Hard Disks (HDD)
• HDD (Hard Disk Drive) = Non-volatile, random access, large storage
device for digital data.
• Common in desktop & laptop computers.
• Housed inside a sealed case to protect from dust, smoke particles,
and other contaminants.
• Used since the 1960s for secondary storage of data.
• Popular due to high storage capacity and low cost.
Components of HDD
• Platters → Circular disks that hold
magnetic data.
• Spindle → Rotates the platters.
• Read/Write Head → Reads and writes data.
• Arm/Actuator → Moves the head to the
correct track.
• Circuit Board → Controls drive operations.
• Power Port & Interface Port → Connect
HDD to computer.
Working of HDD
• Platters spin at speeds 3,600 – 15,000 RPM.
• Data stored in magnetic spots on platters.
• Read/Write Head floats close to the platter surface without touching.
• Actuator positions the head accurately over data tracks.
• Controlled by electromagnetic signals from the circuit board.
Tracks, Sectors, and Cylinders
• Disk surface divided into tracks (concentric circles).
• Sectors → Each track split into smaller sections (smallest storage
unit).
• Cylinder → Same track number across multiple platters.
• Inner tracks store less data than outer tracks because outer tracks
have a greater circumference.
Optical Disks
• plastic disk that stores binary data (0 & 1).
• Data stored as pits (low reflection = 0) and
lands (high reflection = 1).
• Laser beam reads/write data by detecting
reflection from the disk surface.
• Data arranged in a spiral track starting from
the inner track to the outer track.
• Common optical disk types:
• CD (Compact Disk)
• DVD (Digital Versatile Disk)
• Blu-Ray Disk (BD)
CD (Compact Disk)
• Plastic disk used for digital data storage.
• Usually 700 MB capacity.
• Data can be read-only (CD-ROM) or
read/write (CD-RW).
• Diameter: 12 cm
• Thickness: 1.2 mm
• Inter-track distance: 1.6 μm
• Accessed by laser in a CD drive.
DVD (Digital Versatile Disk)
• Optical disk technology used for video,
audio, and data storage.
• Capacity: 4 to 16 GB.
• Supports read-only and read/write.
• Faster than CDs but less than Blu-ray.
• Now mostly obsolete compared to Blu-ray &
modern storage.
Blu-Ray Disk (BD)
• Successor to DVD.
• Uses a blue laser (shorter wavelength than
red laser in CDs/DVDs).
• Capacity: 25 GB to 100 GB.
• Faster and better quality than DVD.
• Still used for HD movies and games.
Chip Memory as Secondary
Storage
• Chip (Microchip): Small piece of semi-
conducting material (usually silicon).
• Integrated Circuit (IC): Small circuit
embedded on the chip.
• Components: A typical chip contains
millions of transistors (electronic
components).
• Uses:
• Flash memory
• Memory cards
• Purpose: Used as portable secondary
storage in computers.
Flash Memory
• Definition:
Non-volatile computer storage chip that can
be electrically erased and reprogrammed.
(A type of EEPROM)
• Examples of Use:
• Laptops
• Tablets
• Digital audio players
• Digital cameras
• Smartphones
Flash Memory Drive (USB Flash
Drive)
• Definition: A small portable device used to
store and transfer data. It uses flash memory
and connects to a computer through a USB
port.
• Features:
• Re-writable and portable
• Smaller than other storage media
• Used for documents, presentations, and
media
• Faster than CDs and DVDs for data
transfer
• Other Names:
USB Memory Pen, USB Pen Drive, USB
Memory Stick
Advantages of Flash Memory
• Portable and easy to use
• Faster read/write compared to hard disks
• Smaller physical size
• Less prone to damage
• Cheaper in small capacities than traditional
drives
• Uses less power than hard disks
• More durable than other computer memory
Disadvantages of Flash Memory
• Limited write/erase cycles
• Small size: easy to lose
• Higher cost per GB than hard drives for
large storage
Flash Memory Cards
• Definition: Electronic flash memory device
for storing text, pictures, audio, and video.
• Uses:
• Digital cameras
• Mobile phones
• Laptops
• MP3 players
• Video game consoles
• Variety: Available in different sizes and
storage capacities.
Thank you
M Awais Khan
03149821082
mawaiskhanbt@[Link]