You are on page 1of 24

MEMORY IN COMPUTER

Ishanvi Patel B.TECH (ICT) IU2241240033


CONTENTS

Introduction

Memory

Memory hierarchy

Locality of references

Characteristics

Summary

MEMORY IN COMPUTER 2
INTRODUCTION

Memory organization is a crucial aspect of computer


architecture. It refers to the way a computer’s memory is
arranged and managed. Memory organization involves the
use of different types of memory, including RAM, ROM,
cache memory, virtual memory, flash memory, and
magnetic disks.

MEMORY IN COMPUTER 3
MEMORY
What is memory in a computer?
Functions of memory.
Characteristics of memory.
MEMORY

DEFINITION AND FUNCTION CHARACTERISTICS

Definition: Memory in a computer refers to the • Speed: Computer memory is faster than
storage space where data and instructions are secondary memory.
stored for processing.
• Type: It primarily consists of semiconductor
It allows the computer to store and retrieve memories.
information as needed during its operations.
• Volatility: Most computer memory is volatile
Function: It holds both input (raw data to be (meaning data is lost when power is cut off).
processed) and output (the machine’s response
after processing). • Essential: A computer system cannot
function without primary memory.

MEMORY IN COMPUTER 5
MEMORY
HIERARCHY
What is Memory hierarchy?
Locality of references
Types of memory hierarchy.
MEMORY HIERARCHY

The “Memory Hierarchy” in a computer system is an organizational structure for data storage and retrieval, which arranges
different types of memory based on their speed, cost, and capacity. It’s a tiered structure of system memory designed to
minimize access time and optimize the performance of the system.
The idea is to balance the speed, cost, and capacity. Faster memory types like registers and cache are more expensive and
have less capacity, so they’re used for data that the CPU needs to access quickly. Slower memory types like main memory
and secondary storage are less expensive and have more capacity, so they’re used for storing larger amounts of data

It is important because:
• Balances speed, size, and cost.
• Ensures efficient data handling.
• Allows the processor to move seamlessly between levels based on requirements.

MEMORY IN COMPUTER 7
LOCALITY OF REFERENCES
The principle of locality states that a computer program tends to access the same set of memory locations repetitively over
a short period of time. This principle is based on the observation that most execution in a program is concentrated in a few
areas.

There are two basic types of locality of reference:


• Temporal Locality: If a particular memory location is referenced, then it is likely that the same location will be
referenced again in the near future. This is why we often store a copy of the referenced data in faster memory storage
(like cache), to reduce the latency of subsequent references.
• Spatial Locality: If a particular storage location is referenced at a particular time, then it is likely that nearby memory
locations will be referenced in the near future. This is why we often attempt to guess the size and shape of the area
around the current reference for which it is worthwhile to prepare faster access for subsequent reference.

This principle is used in the design of many parts of a computer system including hardware (like cache memory), operating
systems, and compilers. The memory hierarchy was developed based on this program behavior known as locality of
references.

MEMORY IN COMPUTER 8
MEMORY HIERARCHY

MEMORY IN COMPUTER 9
TYPES OF MEMORY HIERARCHY

Internal Memory External Memory

Internal Memory or Primary Memory External Memory or Secondary Memory


comprises of Main Memory, Cache Memory & comprises of Magnetic Disk, Optical Disk,
CPU registers. and Magnetic Tape i.e. peripheral storage
devices which are accessible by the
This is directly accessible by the processor. processor via an I/O Module.
This is indirectly accessible by the processor.

MEMORY IN COMPUTER 10
SYSTEM-SUPPORTED MEMORY STANDARDS

Name Register Cache Main Memory Secondary Memory

Size less than 1 KB less than 16 MB less than 16GB more than 100 GB

Implementation Multi-ports On-chip/SRAM DRAM (capacitor memory) Magnetic

Access Time 0.25ns to 0.5ns 0.5 to 25ns 80ns to 250ns 50 lakh ns

Bandwidth 20000 to 1 lakh MB 5000 to 15000 1000 to 5000 20 to 150

Managed by Compiler Hardware Operating System Operating System

Backing Mechanism From cache from Main Memory from Secondary Memory from i/o

MEMORY IN COMPUTER 11
MEMORY
HIERARCHY
DESIGN
Detailed block diagram
Registers, Cache, Main Memory, Secondary
Memory, Tertiary Memory
Temporary storage
space
MEMORY
RAM ROM
HIERARCHY Permanent storage
DESIGN space

SSD

MEMORY IN COMPUTER 13
MEMORY HIERARCHY DESIGN : REGISTERS

Registers are small, fast storage areas located inside a computer's Central Processing Unit (CPU) or the Arithmetic Logic
Unit (ALU). They play a crucial role in holding the data required by the CPU for immediate processing. This helps the
computer process instructions efficiently.

• Fast and Temporary Storage: Registers are made up of flip-flops and usually hold a limited amount of data ranging from
8 to 64 bits, depending on the processor architecture¹. They act as intermediate storage for data during arithmetic logic
and other processing operations.
• Types of Registers: There are several types of registers, including the Accumulator Register (used for arithmetic and
logical operations), Program Counter Register (keeps track of the memory address of the next instruction to be
executed), and General-Purpose Registers (can hold data and memory addresses)¹.
• Role in Memory Hierarchy: Registers are at the top of the memory hierarchy in computer systems, providing fast access
to frequently used data.

MEMORY IN COMPUTER 14
MEMORY HIERARCHY DESIGN : CACHE MEMORY
Cache Memory is a small, fast type of computer memory that acts as a buffer between the Central Processing Unit (CPU)
and the main memory. It stores frequently used data and instructions that have been recently accessed from the main
memory. Cache memory is designed to minimize the time it takes to access data by providing the CPU with quick access to
frequently used data.

• Improving Performance: The main use of Cache Memory is to reduce the average time to access data from the main
memory. When the CPU needs to read or write a location in the main memory, it first checks if that data is in the cache.
If it is (a cache hit), the CPU reads the data from the cache, which is much faster. If the data is not in the cache (a cache
miss), the data is retrieved from the main memory.

• Fast and Temporary Storage: Cache Memory is much


faster than main memory (RAM), but it's also smaller.
holdS frequently used data and instructions so they're
immediately available when needed.
• Levels of Cache Memory: There can be various levels of
cache memory. Level 1 (L1) or Registers are the fastest
and store data immediately used by the CPU. Level 2
(L2) or Cache Memory is also fast and stores data
temporarily for quick access by the CPU

MEMORY IN COMPUTER 15
MEMORY HIERARCHY DESIGN : MAIN MEMORY

Main memory, also known as RAM (Random Access Memory), is the primary memory of a computer system. It has a larger
storage capacity than cache memory, but it is slower. Main memory is used to store data and instructions that are currently
in use by the CPU.
• Volatile: Main Memory is usually volatile, which means the information stored in it is lost when the computer is turned
off.
• Storage: Main Memory stores operating system software, software applications, and other information for the Central
Processing Unit (CPU) to have fast and direct access when needed to perform tasks.
• Types of Main Memory:
o Static RAM: Static RAM stores the binary information in flip flops and information remains valid until power is
supplied. It has a faster access time and is used in implementing cache memory.
o Dynamic RAM: It stores the binary information as a charge on the capacitor. It requires refreshing circuitry to
maintain the charge on the capacitors after a few milliseconds. It contains more memory cells per unit area as
compared to SRAM.
• Role in Memory Hierarchy: Main Memory is a part of the memory hierarchy in computer systems, sitting between fast,
expensive cache memory and slow, inexpensive secondary storage

MEMORY IN COMPUTER 16
MEMORY HIERARCHY DESIGN : SECONDARY STORAGE

Secondary storage is a non-volatile memory unit that has a larger storage capacity than main memory. It is used to store
data and instructions that are not currently in use by the CPU. It is used for the permanent storage of data and programs for
later retrieval. Secondary storage has the slowest access time and is typically the least expensive type of memory in the
memory hierarchy.

• Non-volatile: Unlike primary memory (RAM), which is volatile, secondary storage retains data even when the computer
is switched off.
• Cost-effective: Secondary storage is less expensive compared to primary memory like RAM.
• Large Capacity: It allows for the storage of data ranging from a few megabytes to petabytes.
• Purpose: It is used for various purposes such as backup data used for future restores or disaster recovery, long -term
archiving of data that is not frequently accessed, and storage of non -critical data in lower-performing, less expensive
drives
• Examples: Hard drives, solid-state drives (SSDs), CDs, DVDs, and flash drives are examples of secondary storage
devices.

MEMORY IN COMPUTER 17
MEMORY HIERARCHY DESIGN : TERTIARY STORAGE

Tertiary storage, also known as tertiary memory, provides a third level of storage in the memory hierarchy of a computer
system. In general, tertiary storage is designed for large-scale data storage and is available in high-capacity devices1. It
provides an affordable and reliable solution for data that is not frequently accessed but needs to be preserved for various
reasons

• Data Storage: Tertiary storage is used to store data that is not commonly accessed and typically not required for daily
use.
• Cost and Speed: It is often slower and less expensive than primary and secondary storage.
• Usage: It is frequently used for data archiving and long-term storage.
• Access: Tertiary storage often accesses more slowly than main and secondary storage.
• Capacity: Tertiary storage offers significantly larger storage capacity compared to primary and secondary storage,
making it ideal for storing large amounts of data that may not fit in primary or secondary storage.
• Backup and Recovery: Tertiary storage is frequently used for data backup and recovery because it offers an affordable
and dependable way to store data that might be required in the event of data loss or corruption.
• Examples: Tape libraries, optical jukeboxes, and cloud storage are a few examples of tertiary storage system.

MEMORY IN COMPUTER 18
CLOSING
Characteristics
Summary
References
CHARACTERISTICS OF MEMORY HIERARCHY

CAPACITY ACCESS TIME PERFORMANCE COST PER BIT

The global volume of The time interval between A large difference in The term “Cost Per Bit”
information the memory the read/write request access time between the refers to the monetary
can store and the availability of the CPU registers and Main cost per unit of memory.
data. Memory results in lower It’s a way of expressing
performance of the the price you have to pay
system. for a specific amount of
memory.

Top to bottom -capacity Top to bottom - access To increase system Bottom to top - cost per
increases. time increases. performance - minimize bit increases
how far down the memory
hierarchy one has to go to
manipulate data.

MEMORY IN COMPUTER 20
SUMMARY

Overall, memory organization is a crucial aspect of


computer systems that requires careful consideration and
implementation. The choice of memory organization
depends on the specific requirements of the application,
the available hardware resources, and the desired level of
performance and reliability. Memory organization provides
several advantages, such as improved performance,
simplified program execution, and improved reliability.
However, it also has some disadvantages, such as
complexity, cost, overhead, compatibility issues, and
security issues.

MEMORY IN COMPUTER 21
1 https://medium.com/@shrutiikhatal07/memory-
organization-d0f486a4daa0

2 https://nanohub.org/courses/ss2014/01a/outline/unit7kaus
hikroysttmram/l72cachememoriesandcmos

3 https://www.geeksforgeeks.org/memory-hierarchy-design-
and-its-characteristics/?ref=lbp

4 https://www.geeksforgeeks.org/tertiary-storage-in-
operating-system/

REFERENCES
MEMORY IN COMPUTER 22
5 https://www.javatpoint.com/computer-registers

6 https://www.techopedia.com/definition/6307/cache-
memory

7 https://www.tutorialspoint.com/what-is-the-main-memory

8 https://www.javatpoint.com/secondary-storage-devices-
in-computer-organization

REFERENCES
MEMORY IN COMPUTER 23
THANK YOU

MEMORY IN COMPUTER 24

You might also like