ANDIJAN STATE PEDAGOGICAL INSTITUTE
Lecture materials · 2026–2027 academic year
SUBJECT
Information Systems and Digital Technologies
Lecture 7 · Primary Memory
Part 1 of 2 · 2 hours
Lecturer: Ismailov Alisher
Telegram: @Urobotuz
FUNDAMENTALS OF COMPUTERS · CHAPTER 3
Memory
How a computer holds data — for right now, and for later
0
0
1
1
0
2
0
3
1
4
1
5
0
6
1
7
8 bits = 1 byte = one character (here, the letter 'M')
A RAM module: memory chips (ICs) on a circuit board. Source: textbook Fig. 3.3
LECTURE 07 · 2 HOURS · PART 1/2
0x01 · WARM-UP
Why does a phone advert list two memory sizes?
EXAMPLE PHONE SPEC SHEET
8 GB
RAM
128 GB
Storage
Think – Pair – Share (2 min)
1.Why two different numbers?
2.Which one keeps your photos when the phone is switched off?
3.What happens to an unsaved note if the battery dies?
0x02 · LEARNING OBJECTIVES
By the end of this lesson, you can…
1
Classify memory into internal process, primary and secondary memory.
2
Explain bits, bytes, words and addresses, and convert KB, MB, GB and TB to bytes.
6
Explain the purpose of memory and the memory hierarchy.
7
Relate memory size and speed to the performance of software.
0x03 · INTRODUCTION
Two jobs, so two kinds of memory
CPU
Primary memory
called "memory"
Secondary memory
called "storage"
data & address buses
(direct access)
I/O channels
✕ The CPU cannot read secondary memory directly — data goes to primary memory first
Now: holds data the CPU is handling at this moment (temporary).
Later: stores programs and results permanently.
0x04 · PURPOSE OF MEMORY
Why does a computer need memory?
Holds the running program
The CPU can only run instructions that are in main memory.
Holds the data in use
The document, photo or game level you are working on.
Keeps results
Intermediate and final results of calculations.
Feeds the CPU fast
Fast memory keeps the processor busy instead of waiting.
Starts the computer
ROM holds the start-up program (firmware).
Buffers data
Holds data moving between the CPU and I/O devices.
0x05 · MEMORY CATEGORIES
Three categories of memory
Memory
Secondary memory
Primary memory
Internal process memory
Low
High
Cost
Slow
Fast
Speed
High
Low
Capacity
Redrawn from textbook Fig. 3.1
0x06 · MEMORY CATEGORIES
What belongs in each category?
Internal process memory
Cache memory
Registers
Inside or near the CPU. Temporary. Accessed directly by the CPU.
Primary memory
RAM — volatile
ROM — non-volatile
Also called main memory. Accessed directly by the CPU.
Secondary memory
Magnetic disks
Magnetic tapes
Also called auxiliary memory. Much larger capacity; permanent until removed.
0x07 · CHECK 1
CHECK FOR UNDERSTANDING
Sort it: which category?
Cache memory
Magnetic tape
RAM
Registers
ROM
Magnetic disk
Internal process
Primary
Secondary
Predict
•Which category is fastest?
•Which holds the most data?
•Which ones keep data after power is switched off?
0x08 · MEMORY HIERARCHY
The memory hierarchy
Registers
Inside the CPU · a few bytes · fastest of all
Cache (L1, L2, L3)
On or next to the CPU · KB to MB · very fast
Main memory (RAM)
On the motherboard · GB · fast, volatile
Secondary storage (SSD, HDD)
Inside the computer · TB · slower, permanent
Offline storage (tape, disc, cloud)
Outside the computer · huge · slowest, cheapest
faster · smaller · costlier
slower · bigger · cheaper
↕
0x09 · MEMORY HIERARCHY
Speed, size and cost at each level
LEVEL
Typical access time
Typical size
Cost per GB
Registers
under 1 ns
hundreds of bytes
highest
Cache
about 1–10 ns
KB to tens of MB
very high
RAM
about 50–100 ns
4–64 GB
medium
SSD
about 0.1 ms
256 GB – 4 TB
low
HDD
about 5–10 ms
1–20 TB
lowest
Scale: if a register took 1 second, reading from an HDD would take several months.
0x0A · MEMORY AND PERFORMANCE
Why memory matters for software performance
Enough RAM
More programs and tabs stay open without slowing down.
Too little RAM
The OS swaps to disk (virtual memory) — everything slows.
Cache hits
Data found in cache is used at once; a miss means waiting for RAM.
Locality
Programs reuse nearby data, so caching works well.
Fast storage
An SSD loads programs into RAM much faster than an HDD.
Efficient software
Programs that waste memory (memory leaks) slow the whole system.
0x0B · CHECK 2
CHECK FOR UNDERSTANDING
Memory detective
A
Put these in order, fastest first: RAM, registers, SSD, cache.
B
A laptop with 4 GB of RAM crawls when 30 browser tabs are open. Why?
C
The CPU finds the data it needs in L1 cache. What is this called?
D
Why not build all memory from registers?
E
A game loads twice as fast after moving it to an SSD. Why?
F
A program uses more and more memory until the PC freezes. What is the bug?
Key words
• hierarchy
• swapping / virtual memory
• cache hit
• cost per byte
• faster storage
• memory leak
0x0C · MEMORY REPRESENTATION
Bits, bytes and words
bit
a binary digit: 0 or 1
0
1
0
0
0
0
0
1
byte = 8 bits → represents one character (this one is 'A')
byte
the smallest addressable unit of memory
word
a group of bytes, usually 2 or 4
byte
byte
2-byte word
byte
byte
byte
byte
4-byte word
0x0D · MEMORY REPRESENTATION
Every memory cell has an address
data item
0
data item
1
01000001
2
data item
3
⋮
data item
N
memory cells
address
CPU:
"read address 2"
Think of numbered lockers
Each cell (data item) gets a unique number — its address. The CPU finds a cell by its address, like an index in an array.
Redrawn from textbook Fig. 3.2
0x0E · MEMORY CAPACITY
Measuring capacity: each step is × 1,024
1 KB
Kilobyte
1,024 bytes
× 1,024
1 MB
Megabyte
1,048,576 bytes
× 1,024
1 GB
Gigabyte
1,073,741,824 bytes
× 1,024
1 TB
Terabyte
1,099,511,627,776 bytes
Try it
2 KB = ? bytes
1 MB = ? KB
½ GB = ? MB
OPTIONAL MODERN NOTE Drive makers often count 1 KB = 1,000 bytes. The 1,024 version is sometimes written KiB. Use the textbook values in this course.
0x0F · CHECK 3
CHECK FOR UNDERSTANDING
True or false?
1
A byte is the smallest addressable unit of memory.
T / F
2
The CPU can read data directly from secondary memory.
T / F
3
A word is usually a group of 2 or 4 bytes.
T / F
4
Internal process memory is the slowest kind of memory.
T / F
Quick calculation
4 KB = ? bytes
Show your working on a mini-whiteboard.
0x11 · REVIEW
Review: can you answer these?
01
Name the three categories of memory.
02
Why is RAM called volatile?
03
How many bits are in a byte? What is a word?
04
How many bytes are in 1 MB (textbook value)?
05
Give three reasons why a computer needs memory.
06
Order from fastest to slowest: RAM, registers, SSD, cache.
07
What is a memory address?
08
What happens when a computer has too little RAM?
0x12 · EXIT TICKET
Exit ticket
Answer on a slip of paper before you leave.
1
Order from fastest to slowest: primary memory, secondary memory, internal process memory.
2
How many bytes are in 1 KB and in 1 GB (textbook values)?
3
There is a cache miss. What does the CPU have to do?
Next lesson: RAM and ROM — their types and where they are used.