Docsity

Memory Organization and Architecture in Computing Systems, Lecture notes of Computer Fundamentals

Partial preview of the text

Download Memory Organization and Architecture in Computing Systems and more Lecture notes Computer Fundamentals in PDF only on Docsity!

UNIT 2

MEMORY ORGANIZATION AND

ARCHITECTURE

LEARNING OBJECTIVES

1.Identify and classify types of memory.

2.Explain memory hierarchy and its performance

role.

3.Describe addressing methods.

4.Convert memory units.

WHY STUDY MEMORY ARCHITECTURE?  Helps computers run faster and respond quickly.  Supports multitasking without slowing down.  Balances cost by using fast and slow memory together.  Moves data efficiently between the CPU and memory.

MEMORY CLASSIFICATION

MEMORY CLASSIFICATION IN COMPUTING

3. Classification Based on Storage Purpose  Primary Memory: Fast and directly accessible by the CPU.  Example: RAM, ROM.  Secondary Memory: Permanent storage for programs and files.  Example: Hard Disk Drives (HDDs), Solid State Drives (SSDs).  Tertiary Memory: Used for long-term archival storage.  Example: Magnetic tapes, Optical discs (CDs, DVDs).

TYPES OF MEMORY

REGISTER MEMORY

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

CACHE MEMORY Term (^) What It Does Extra Info Cache Memory Very fast memory near the CPU. Stores frequently used data. Speeds up data access. 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. Cache Mapping Technique Direct-Mapped Cache Each memory block maps to one cache line only Easy but can cause more "misses" Fully Associative Cache Data can go in any cache line. Fewer cache misses, but more complex. N-Way Set- Associative Cache Data can go to one of N possible cache lines in a set. Balanced speed and efficiency. Most commonly used in CPUs.

VIRTUAL MEMORY

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)

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.