0% found this document useful (0 votes)
2 views46 pages

FCA2

This document covers memory organization and architecture, focusing on types of memory, memory hierarchy, addressing methods, and units of measurement. It explains the importance of efficient memory design for computer performance, including classifications based on volatility, accessibility, and storage purpose. Additionally, it discusses the functioning of DRAM, cache memory, and virtual memory, alongside the significance of addressing in memory management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views46 pages

FCA2

This document covers memory organization and architecture, focusing on types of memory, memory hierarchy, addressing methods, and units of measurement. It explains the importance of efficient memory design for computer performance, including classifications based on volatility, accessibility, and storage purpose. Additionally, it discusses the functioning of DRAM, cache memory, and virtual memory, alongside the significance of addressing in memory management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

UNIT 2

MEMORY ORGANIZATION AND


ARCHITECTURE
LEARNING OBJECTIVES

1.Identify and classify memory types.


2.Explain memory hierarchy and performance
3.Understand addressing methods.
4.Convert memory units and explain word size
INTRODUCTION
 Memory is the part of a computer that stores data and instructions. It
provides the CPU with the information it needs to run programs and the
operating system.
 The CPU works very fast and needs quick access to data. If the memory is too slow, the
CPU has to wait, which reduces the computer’s speed and performance. Fast, efficient
memory helps the computer run smoothly.
 As CPUs became faster, memory couldn’t keep up. This created a problem called the
memory wall — the CPU wastes time waiting for data from slower memory.
 To fix this, computers use:
 Cache memory (very fast, small memory close to the CPU)
 A memory hierarchy (different types of memory organized by speed and size)
WHY STUDY MEMORY ARCHITECTURE?
 Makes Computers Faster: Good memory design helps the CPU
get data quickly, so the computer runs faster.
 Supports Multitasking: Lets you open many apps (like a browser,
music player, and Word document) without slowing down.
 Balances Cost and Speed: Uses a mix of fast (but expensive)
and slow (but cheaper) memory to keep the computer affordable
and efficient.
 Moves Data Efficiently: Organizes how data travels between the
CPU and memory, reducing wait times.
MEMORY CLASSIFICATION
MEMORY CLASSIFICATION IN COMPUTING
 Memory in computing can be classified based on different criteria such as volatility,
access type, and storage purpose.
1. Classification Based on Volatility
 Volatile Memory = Needs power to keep data. If the power goes off, the data is lost.
 Example: RAM – Like your computer’s short-term memory. When you're working on a Word file,
it's stored in RAM. If the computer suddenly shuts down before saving, the work is gone.
 Cache – Very fast, short-term storage inside the CPU.
 Registers – Tiny bits of memory inside the processor used to perform tasks super fast.
 Non-Volatile Memory = Keeps data even when the power is off.
 Example: Hard Drive or SSD – Like your computer’s long-term memory. Your saved files, photos,
and software stay even after shutdown.
 ROM – Stores permanent instructions (like how to start the computer).
CLASSIFICATION BASED ON ACCESSIBILITY
 This means how data is accessed in the memory.
 Random Access Memory (RAM): Any piece of data can be read instantly, no
matter where it is.
 Example: RAM – You can jump to any open program instantly without going
through others first.
 Sequential Access Memory (SAM): Data is read in order, like going through a
playlist one song at a time.
 Example: Magnetic Tape – Like old cassette tapes. You have to go through data in
sequence, which is slower.
CLASSIFICATION BASED ON STORAGE PURPOSE
1. Primary Memory
 This is the main working memory of the computer. It’s fast and directly used
by the CPU while running programs.
 Example:
 RAM – Like your desk while you're working. You put books and papers
you're currently using on it.
 ROM – Like a built-in instruction manual that never changes (e.g., tells the
computer how to start up).
 Think of it as: Memory for active tasks.
CLASSIFICATION BASED ON STORAGE PURPOSE

2. Secondary Memory
 This is your computer’s permanent storage – where all your files, apps,
and the operating system live.
 It's slower than primary memory but keeps data even when power is off.
 Example: Hard Drives (HDDs), Solid State Drives (SSDs).
 Think of it as:Your computer’s filing cabinet.
CLASSIFICATION BASED ON STORAGE PURPOSE

3. Tertiary Memory
 This is used for backups and archiving – to store data that’s not needed
often.
 It's even slower and sometimes needs to be manually loaded.
 Example: Magnetic Tapes, CDs/DVDs
 Think of it as: Long-term storage or a warehouse for old files.
TYPES OF MEMORY
Type Function Example

Very fast memory used for cache. L1 Cache, L2 Cache, L3 Cache


SRAM

DRAM Main memory for running applications.


SDRAM, DDR2, DDR3, DDR4, DDR5

Stores permanent bootup (firmware)


ROM BIOS, Firmware chip
instructions.
Flash Stores data in portable devices. USB drives, SSD

Magnetic storage Long-term data storage (using magnetic disks) Hard Disk Drive (HDD), Floppy Disk
for files and programs

Stack Keeps track of what happens during program Call Stack, Execution Stack
execution.

Register Super fast memory inside the CPU. CPU Registers: Program Counter
(PC), Accumulator
REGISTER MEMORY
Register Full Name Function Typical Size
Name
Memory Address Holds the memory address of the data or instruction that needs 32 bits (4 Bytes)
MAR

MDR or
Register
Memory Data CACHE MEMORY
to be accessed.

Holds the actual data that is being transferred to or from


Register/Memory 32 bits
MBR memory.
Buffer Register
Temporarily stores intermediate arithmetic and logic results from 32 bits
AC Accumulator
the ALU.
Contains the address of the next instruction to be fetched and 32 bits
PC Program Counter
executed.
Current Instruction
Holds the instruction that is currently being decoded or
CIR or IR Register/Instruction 32 bits
executed.
Register
General Purpose Used for various purposes such as holding temporary data, 32 bits (each)
GPR
Register operands, or results during processing.
Points to the top of the current stack in memory; used for 32 bits
SP Stack Pointer
managing function calls and returns.
Holds condition codes (e.g., zero, carry, sign, overflow) that reflect 8–16 bits
Flags Register (or
FLAGS the outcome of operations and control program flow.
Status Register)
CACHE MEMORY
Term Extra Info
What It Does

Cache Memory CACHE MEMORY


Very fast memory near the CPU. Stores frequently Speeds up data access.
used data.

Levels

L1 Cache Fastest, smallest cache directly in the CPU. Used for most frequently accessed
data.

L2 Cache Larger and slower than L1. Often on the CPU chip.
Stores recently used data not in L1.

L3 Cache Shared among CPU cores. Larger and slower than L2. Improves performance in multi-core
systems.
Term What It Does Extra Info

Direct-Mapped
CACHE MEMORY
Cache Mapping Technique
Each memory block maps to one cache line only Easy but can cause more "misses"
Cache
Fully Associative Data can go in any cache line. Fewer cache misses, but more
Cache complex.
N-Way Set- Data can go to one of N possible cache lines in a set. Balanced speed and efficiency. Most
Associative Cache commonly used in CPUs.
Locality of Reference: is a key concept that explains and justifies the structure of the memory
hierarchy—especially cache, main memory, and virtual memory.
It supports why data is organized across faster and slower layers, based on access patterns, and is crucial
for understanding cache effectiveness and performance optimization.
1. Temporal Locality Recently accessed data is likely to be accessed again soon

2. Spatial Locality Data near recently accessed memory is likely to be accessed soon
DYNAMIC RANDOM ACCES
MEMORY (DRAM)
DRAM
 DRAM stands for Dynamic Random Access Memory.
 It’s the main memory used in most computers, phones, tablets, and other
devices.
 It is volatile, meaning it loses all data when power is turned off.
 DRAM temporarily stores the data and instructions that the CPU needs
while running programs.
 Key Features of DRAM: Volatile, High capacity, Slower than SRAM, Requires
refresh circuits.
 There are two main types: Asynchronous DRAM and Synchronous DRAM
(SDRAM).
TYPES OF DRAM
 Asynchronous DRAM:
 Operates without syncing to the CPU clock, leading to slower access times
and increased latency.
 Common in older computer systems before the rise of SDRAM.
 Has a basic control interface but requires more wait states for CPU
interaction.
 Less suitable for modern multitasking and high-speed applications.
 Replaced by faster, clock-synchronized memory like SDRAM and DDR.
TYPES OF DRAM
 SDRAM (Synchronous DRAM):
 Operates in sync with the CPU clock, enabling faster and more predictable data access
than traditional DRAM.
 Supports pipelining, allowing multiple instructions to be queued, improving throughput.
 Offers faster access times and lower latency, making it suitable for modern computing
systems.
 Commonly used in main system memory (e.g., DDR2, DDR3, DDR4, DDR5) for desktops,
laptops, and servers.
 Timed operations enhance performance stability and multitasking efficiency.
 DDR (Double Data Rate) SDRAM variants transfer data on both clock edges, increasing
bandwidth and reducing power usage.
DRAM
Advantages Disadvantages

Can store large amounts of data Volatile – data is lost when power is off

Cost-effective – cheaper per bit than SRAM


Slower than SRAM due to refresh cycles

Compact – fits more memory in smaller space Requires refreshing thousands of times per second

Widely used – compatible with most systems Consumes more power during refresh operations

Easy to upgrade or expand in most computers Needs extra control circuitry for refresh timing
HOW DRAM WORKS
 DRAM stores each bit of data using a capacitor and a transistor.
 A charged capacitor = 1, and an uncharged capacitor = 0.
 Capacitors leak charge over time, so DRAM must refresh data thousands
of times per second.
manages data
 This is done automatically by the memory controller. flow to and from
the computer's
 Data is accessed using a grid of rows and columns: main memory
 The system selects a row (Row Address Strobe or RAS),
 Then a column (Column Address Strobe or CAS),And then reads or writes
data at that intersection.
DRAM
 Why It Matters:
 Each generation of DDR SDRAM is faster, uses less energy, and offers more
bandwidth than the one before.
 They are not backward-compatible, meaning you can't mix different
generations on the same motherboard.
 Today’s most used types in consumer devices (Laptop, Desktop PC) are
DDR4 and DDR5, while LPDDR (Low Power DDR) 5 is used in
smartphones for better battery life.
VIRTUAL MEMORY
Term What It Does Extra Info

Helps run more apps or


Uses part of the hard drive or SSD as large programs than RAM
Virtual Memory
extra RAM when physical RAM is full. can handle. Managed by the
OS using paging.
Paging (in Breaks memory into small blocks
Only needed pages are kept
Virtual (pages) that are moved between RAM
in RAM, saving space.
Memory) and disk.

Keeps track of where each page is Used by the OS to manage


Page Table
(RAM or disk). virtual memory efficiently.

Slows down the system


Happens when data is not in RAM and
Page Fault temporarily while loading
must be loaded from the disk.
the page.
MEMORY HIERARCHY
MEMORY HIERARCHY IN COMPUTING
 Memory in a computer system is organized in a hierarchy based on speed,
cost, and capacity.
 This hierarchy ensures that frequently accessed data is stored in faster
memory, optimizing system performance.
 Registers (Fastest, smallest, inside CPU)
 Cache (Faster access than RAM; stores frequently used data.)
 Main Memory (RAM) (Larger, used for active applications)
 Secondary Storage (Permanent storage, slowest)
Level Speed Cost per Bit Capacity Description

Small storage locations within the


Registers Fastest Highest Minimal CPU that hold data currently
being processed.
Stores frequently accessed
Cache Memory Small to
Very High High instructions and data to reduce
(L1, L2, L3) Moderate
latency.
Temporary storage that holds data
Main Memory
Moderate Moderate Larger than cache and instructions for active
(RAM)
processes.
Secondary
Non-volatile storage for long-term
Storage Slower Lower Large
data retention.
(SSD/HDD)

Used for data backup and archival


Tertiary Storage Slowest Lowest Very Large
purposes.
What it Stores
MEMORY HIERARCHY IN COMPUTING
 Trade-offs in Memory Hierarchy
 Speed: Faster memory (registers, cache) improves performance but is limited and
expensive.
 Size: Larger memory (RAM, storage) holds more data but is slower.
 Cost: Faster memory is costly per gigabyte, while larger memory is cheaper but slower.
 Why Memory Hierarchy Matters
 Efficiency: Faster memory reduces CPU wait times, improving performance.
 Cost-Effectiveness: Uses expensive fast memory alongside larger, cheaper memory to
balance performance and cost.
 Adaptability: Optimizes memory use based on workload and application needs.
 Scalability: Allows systems to upgrade with faster and larger memory over time.
ADDRESSING
ADDRESSING IN COMPUTER MEMORY
 Memory addressing refers to how data is accessed in a computer's memory.
 Efficient addressing ensures fast data retrieval and smooth program execution.
 Types of Addressing:
 Physical Addressing: The actual memory location assigned by the hardware.
 Logical Addressing: Virtual addresses used by programs, translated into physical addresses
by the OS.
 Importance:
 Data Retrieval: Helps the CPU locate and access stored data.
 Efficiency: Optimizes access time and system performance.
 Data Organization: Manages data within memory hierarchies.
Addressing Mode Description Example

Immediate Addressing Uses a direct value in the instruction. MOV A, 5 (Store 5 in A)

Register Addressing Uses a register to store the operand. MOV A, B (Copy B to A)

Direct Addressing Uses a specific memory address. MOV A, 100 (Load from 100)

Indirect Addressing Uses a register holding the memory address. MOV A, (B) (Load from B’s address)

Indexed Addressing Uses a base address plus an index for arrays. MOV A, (100 + I) (Access array)

Stack Addressing Uses the stack for storing/retrieving values. PUSH A (Store A on stack)
UNITS OF MEASUREMENTS
UNITS OF MEASUREMENT IN COMPUTING
 Understanding computing units is essential for evaluating storage, memory, and
system performance.
 Basic Units of Measurement
 Bit (b): The smallest unit of data, representing 0 or 1.
 Byte (B): A group of 8 bits, commonly used to store a single character.
 Kilobyte (KB): 1,024 bytes, used for small files like text documents.
 Megabyte (MB): 1,024 KB, used for images and audio files.
 Gigabyte (GB): 1,024 MB, common for device storage.
 Terabyte (TB): 1,024 GB, used for large-scale storage.
 Petabyte (PB): 1,024 TB, used in data centers and cloud storage.
 Exabyte (EB): 1,024 PB, used for massive data processing applications.
CONVERSION BETWEEN UNITS
 From Larger to Smaller Units (Divide by 1,024 each step)
 Example 1: Convert 2 GB to MB→ 2 GB × 1,024 = 2,048 MB
 Example 2: Convert 1 TB to GB→ 1 TB × 1,024 = 1,024 GB
 Example 3: Convert 0.5 MB to KB→ 0.5 MB × 1,024 = 512 KB
 From Smaller to Larger Units (Divide by 1,024 each step)
 Example 1: Convert 10,240 KB to MB→ 10,240 KB ÷ 1,024 = 10 MB
 Example 2: Convert 5,120 MB to GB→ 5,120 MB ÷ 1,024 = 5 GB
 Example 3: Convert 2,048 GB to TB→ 2,048 GB ÷ 1,024 = 2 TB
UNITS OF MEASUREMENT IN COMPUTING
WORD
 In computer architecture, a word is a unit of data with a defined bit length that a CPU can process, move,
and store in one operation.
 The word length typically corresponds to the width of the CPU’s data bus, allowing a full word to be
transferred between memory and CPU registers efficiently.
 A word can contain:
 An instruction
 A memory address
 Application data (e.g., integers, characters)
 The bit length of a word is typically a multiple of 8 bits (1 byte), aligning with byte-based architectures.
 Examples of Word Lengths:
 16-bit system (e.g., early Intel PCs): Word = 16 bits (2 bytes)
 32-bit system (e.g., IBM System/360): Word = 32 bits (4 bytes)
 64-bit system (modern CPUs): Word = 64 bits (8 bytes)
WORD SIZE
 Word Size (also called word length) refers to how many bits the CPU can process in a single
operation.
 A larger word size allows the CPU to process more data per cycle, improving overall
performance.
 Impact on Performance:
 Faster Data Handling: A bigger word size means the CPU can process more data at
once, speeding things up.
 More Memory Access:
 32-bit system: Can address up to 232 = 4 GB of memory.
 64-bit system: Can theoretically address up to 264 bytes (16 ExaBytes), though practical
limits are lower due to OS and hardware constraints.
 Better Software Performance: 64-bit software can utilize more memory, enabling
more complex applications and multitasking.
ADDRESSABLE MEMORY SPACE
 This refers to the total memory capacity the CPU can address, which is
determined by the word size and addressing capability.
 32-bit CPUs: Up to 4 GB of addressable space.
 64-bit CPUs: Can support much more memory (theoretically up to 16 EB).
 Memory Limitations:
 Operating System and Hardware: May cap usable memory below theoretical limits.
 Cost: Larger memory configurations are more expensive.
 Software Design: Some applications are not optimized for or capable of handling
large memory sizes.
QUIZ
1. Which type of memory is the fastest but has the least storage capacity?
a) RAM
b) Cache
c) Registers
d) Hard Disk
2. What is the primary purpose of virtual memory?
a) To store frequently accessed data
b) To extend RAM by using storage as temporary memory
c) To replace cache memory
d) To improve CPU speed
QUIZ
3. What is the main reason cache memory improves performance?
a) It is larger than RAM
b) It stores frequently accessed data close to the CPU
c) It has unlimited storage capacity
d) It replaces secondary storage
4. Which memory type retains data even when the computer is turned off?
a) RAM b) ROM c) Cache d) Register
5. What unit of memory is typically used to measure the storage capacity of
hard drives?
a) Kilobytes b) Megabytes c) Gigabytes d) Bits
QUIZ
6. Convert the following unit of measures?
a) 2 GB to KB
b) 200 KB to b
c) 2 TB to MB
d) 1000000000B to GB
REFERENCE
 Englander, I. (2014). The Architecture Of Computer Hardware, Systems Software, &
Networking. (5th Edition). John Wiley & Sons, Inc.
 Silberschatz A., Galvin P.B., & Gagne G. (2018). Operating System Concepts. (10ed).
John Wiley & Sons, Inc.
 Stallings, W. (2020). Computer Organization and Architecture. Pearson.
 Tanenbaum, A. S. (2016). Structured Computer Organization. Pearson.
UNIT 2 END

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy