0% found this document useful (0 votes)
42 views

Chapter 09 Memory - Coa KU

The document discusses computer memory organization. It defines different types of computer memory including main memory (RAM), storage, ROM, and different levels of memory hierarchy. It describes characteristics of memory systems such as volatility, mutability, accessibility, addressibility, capacity and performance. It provides details on main memory (RAM) types, characteristics, and differences between RAM and ROM.

Uploaded by

Sujan Timalsina
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)
42 views

Chapter 09 Memory - Coa KU

The document discusses computer memory organization. It defines different types of computer memory including main memory (RAM), storage, ROM, and different levels of memory hierarchy. It describes characteristics of memory systems such as volatility, mutability, accessibility, addressibility, capacity and performance. It provides details on main memory (RAM) types, characteristics, and differences between RAM and ROM.

Uploaded by

Sujan Timalsina
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/ 30

Chapter 09: Memory Organization

A) Microcomputer Memory:

Computer data storage, often called storage or memory, refers to computer


components, devices, and recording media that retain digital data used for computing
for some interval of time. Computer data storage provides one of the core functions
of the modern computer, that of information retention. It is one of the fundamental
components of all modern computers, and coupled with a central processing unit
(CPU, a processor), implements the basic computer model used since the 1940s.

In contemporary usage, memory usually refers to a form of semiconductor storage


known as random-access memory (RAM) and sometimes other forms of fast but
temporary storage. Similarly, storage today more commonly refers to mass storage
— optical discs, forms of magnetic storage like hard disk drives, and other types
slower than RAM, but of a more permanent nature. Historically, memory and storage
were respectively called main memory and secondary storage. The terms internal
memory and external memory are also used.

The contemporary distinctions are helpful, because they are also fundamental to the
architecture of computers in general. The distinctions also reflect an important and
significant technical difference between memory and mass storage devices, which
has been blurred by the historical usage of the term storage. Nevertheless, this article
uses the traditional nomenclature.

B) Characteristics of Memory system:


Storage technologies at all levels of the storage hierarchy can be differentiated by
evaluating certain core

characteristics as well as measuring characteristics specific to a particular


implementation. These core characteristics are volatility, mutability, accessibility,
and addressibility. For any particular implementation of any storage technology, the
characteristics worth measuring are capacity and performance.

Volatility

Non-volatile memory Will retain the stored information even if it is not constantly
supplied with electric power. It is suitable for long-term storage of information.
(Nowadays used for most of secondary, tertiary, and off-line storage. In 1950s and
1960s, it was also used for primary storage, in the form of magnetic core memory.

Volatile memory Requires constant power to maintain the stored


information(RAM). The fastest memory technologies of today are volatile ones (not
a universal rule). Since primary storage is required to be very fast, it predominantly
uses volatile memory.

Differentiation

Dynamic random access memory

A form of volatile memory which also requires the stored information to be


periodically re-read and re-written, or refreshed, otherwise it would vanish.
Static memory

A form of volatile memory similar to DRAM with the exception that it never needs
to be refreshed.

Mutability

Read/write storage or mutable storage Allows information to be overwritten at any


time. A computer without some amount of read/write storage for primary storage
purposes would be useless for many tasks. Modern computers typically use
read/write storage also for secondary storage.

Read only storage Retains the information stored at the time of manufacture, and
write once storage(Write Once Read Many) allows the information to be written
only once at some point after manufacture. These are called immutable storage.
Immutable storage is used for tertiary and off-line storage. Examples include CD-
ROM and CD-R. Slow write, fast read storage Read/write storage which allows
information to be overwritten multiple times, but with the write operation being
much slower than the read operation. Examples include CD-RWand flash memory.

Accessibility

Random access

Any location in storage can be accessed at any moment in approximately the same
amount of time. \Such characteristic is well suited for primary and secondarystorage.

Sequential access

The accessing of pieces of information will be in a serial order, one after the other;
therefore the time to access a particular piece of information depends upon which
piece of information was last accessed. Such characteristic is typical of off-line
storage.

Addressability

Location-addressable

Each individually accessible unit of information in storage is selected with its


numerical memory address. In modern computers, location-addressable storage
usually limits to primary storage, accessed internally by computer programs, since
location-addressability is very efficient, but burdensome for humans.

File addressable

Information is divided into filesof variable length, and a particular file is selected
with human-readabledirectory and file names. The underlying device is still
location-addressable, but the operating system of a computer provides the file system
abstraction to make the operation more understandable. In modern computers,
secondary, tertiary and off-line storage use file systems.

Content-addressable

Each individually accessible unit of information is selected based on the basis of


(part of) the contents stored there. Content-addressable storage can be implemented
using software (computer program) or hardware (computer device), with hardware
being faster but more expensive option. Hardware content addressable memory is
often used in a computer's CPU cache.

Capacity

Raw capacity

The total amount of stored information that a storage device or medium can hold. It
is expressed as a quantity of bits or bytes (e.g. 10.4 megabytes).

Memory storage density

The compactness of stored information. It is the storage capacity of a medium


divided with a unit of length, area or volume (e.g. 1.2 megabytes per square inch).

Performance

Latency

The time it takes to access a particular location in storage. The relevant unit of
measurement is typically nanosecondfor primary storage, millisecond for secondary
storage, and second for tertiary storage. It may make sense to separate read latency
and write latency, and in case of sequential access storage, minimum, maximum and
average latency.
Throughput

The rate at which information can be read from or written to the storage. In computer
data storage, throughput is usually expressed in terms of megabytes per second or
MB/s, though bit rate may also be used. As with latency, read rate and write rate
may need to be differentiated. Also accessing media sequentially, as opposed to
randomly, typically yields maximum throughput.

Magnetic

Magnetic storageuses different patterns of magnetization on a magnetically coated


surface to store information. Magnetic storage is non-volatile. The information is
accessed using one or more read/write heads which may contain one or more
recording transducers. A read/write head only covers a part of the surface so

that the head or medium or both must be moved relative to another in order to access
data. In modern computers, magnetic storage will take these forms:

Magnetic disk

o Floppy disk, used for off-line storage

o Hard disk drive, used for secondary storage

Magnetic tape data storage, used for tertiary and off-line storage

C) Memory Heirarchy:
D) Main Memory:
Main memory, often referred to as RAM (Random Access Memory), is a type of
computer memory that is used to store data and machine code currently being used
and processed by a computer. It is a volatile memory, meaning that its contents are
lost when the power is turned off.

Here are some key points about main memory:

Volatility: Main memory is volatile, which means that it loses its contents when the
power is turned off. This is in contrast to non-volatile memory like hard drives or
solid-state drives, which retain data even when the power is off.

Speed: Main memory is much faster than secondary storage devices like hard drives
or SSDs. This speed is crucial for providing quick access to data that the CPU needs
during program execution.

Random Access: The term "Random Access" in RAM implies that any memory cell
can be directly accessed (read or written) in a constant time, regardless of the
memory location's distance from the currently addressed cell. This is in contrast to
sequential access, where the time to access a particular piece of data depends on its
position in the sequence.

Temporary Storage: Main memory is used for temporary storage of data that the
CPU is actively using or processing. This includes the operating system, running
applications, and data needed for the execution of programs.

Types of RAM:
Dynamic RAM (DRAM): Requires refreshing thousands of times per second to
retain data. It is less expensive but slower compared to SRAM.

Static RAM (SRAM): Doesn't need refreshing and is faster than DRAM but is more
expensive and consumes more power.

Capacity: The capacity of main memory is measured in gigabytes (GB) or terabytes


(TB) in modern computers. The amount of RAM a system has can impact its overall
performance, especially when running memory-intensive applications or multiple
tasks simultaneously.

ROM, or Read-Only Memory, is a type of non-volatile memory that is used


primarily in the startup process of a computer or electronic device. Unlike RAM
(Random Access Memory), ROM retains its contents even when the power is turned
off. Here are characteristics of ROM:

Non-Volatile: ROM is non-volatile, meaning it retains its data even when the power
is turned off. This characteristic makes ROM suitable for storing critical and
permanent data, such as firmware and basic input/output system (BIOS) information.

Read-Only: The term "Read-Only" implies that the data stored in ROM is generally
not modified or written to during normal operation. It is pre-programmed during
manufacturing and is intended to be stable throughout the lifespan of the device.
This is in contrast to RAM, which is read and written to during regular use.

Firmware Storage: ROM is commonly used to store firmware, which is a set of


instructions or software that is permanently programmed into the hardware.
Firmware is essential for the basic functionality of a device and is often responsible
for initializing the hardware components during the boot-up process.

Boot Process: During the boot-up sequence of a computer or electronic device, the
initial instructions required to start the system are often stored in ROM. This includes
the BIOS or UEFI firmware, which performs system checks, initializes hardware
components, and hands over control to the operating system stored on other storage
devices.
Types of ROM:

Mask ROM (MROM): The data is permanently written during the manufacturing
process, and it cannot be modified or reprogrammed.

Programmable ROM (PROM): Users can write data to PROM once using a special
device called a PROM programmer.

Erasable Programmable ROM (EPROM): Allows for data to be erased and


reprogrammed using ultraviolet light exposure.

Electrically Erasable Programmable ROM (EEPROM): Provides the capability to


erase and reprogram data electrically, allowing for more flexibility without the need
for ultraviolet light.

Limited Read/Write Capability: While traditional ROM is read-only, the


programmable and erasable versions (PROM, EPROM, EEPROM) provide limited
read/write capability for specific use cases, such as firmware updates.

E) Auxiliary Memory
Auxiliary memory, also known as secondary storage or external storage, refers to
storage devices that are used to store data and programs for the long term. Unlike
the primary or main memory (RAM) which is volatile and loses its contents when
power is turned off, auxiliary memory retains data even when the power is off. The
primary function of auxiliary memory is to provide non-volatile, large-capacity
storage for the operating system, applications, and user data. Here are characteristics
of auxiliary memory:

1. Non-Volatile Storage: Auxiliary memory is non-volatile, meaning it retains


data even when the power is turned off. This is in contrast to volatile memory
like RAM, which loses its contents when the power is off.

2. Large Capacity: Auxiliary memory devices typically have a much larger


storage capacity compared to RAM. Common examples include hard disk
drives (HDDs), solid-state drives (SSDs), optical discs (CDs, DVDs, Blu-
rays), and USB flash drives.
3. Data Persistence: Data stored in auxiliary memory persists across power
cycles. This makes it suitable for long-term storage of files, applications, and
the operating system.

4. Slower Access Speed: While auxiliary memory provides large storage


capacity, its access speed is generally slower than that of RAM. This is why
data is typically loaded from auxiliary memory to RAM when a program is
executed.

5. Examples of Auxiliary Memory Devices:

• Hard Disk Drive (HDD): Uses magnetic storage to store data and is
commonly used in personal computers and servers.

• Solid-State Drive (SSD): Uses flash memory to store data and offers
faster access times compared to HDDs.

• Optical Discs: Include CDs, DVDs, and Blu-rays. They are used for
storing data, music, movies, and software.

• USB Flash Drives: Portable, solid-state storage devices that connect to


computers via USB ports.

6. Backing Up Data: Auxiliary memory is often used for creating backups of


important data to prevent data loss in the event of hardware failures, accidents,
or other disasters.

7. Virtual Memory: In computing, virtual memory is a memory management


capability of an operating system that uses auxiliary memory to extend the
available address space of RAM. It allows programs to use more memory than
is physically available in RAM.

8. File Systems: Auxiliary memory devices are formatted with file systems that
organize and manage data storage. Common file systems include NTFS,
FAT32, and exFAT for Windows, and HFS+ and APFS for macOS.

F) Associative Memory
G) Cache memory :
Speed of the main memory is very low in comparison with the speed of processor

– For good performance, the processor cannot spend much time of its time waiting
to access instructions and data in main memory.

– Important to device a scheme that reduces the time to access the information

– An efficient solution is to use fast cache memory

– When a cache is full and a memory word that is not in the cache is referenced, the
cache control hardware must decide which block should be removed to create space
for the new block that contain the referenced word.

Cache memory is constructed with SRAM. It is much faster than DRAM, with
acess time in order of 10 ns. It is also much more expensive than DRAM used for
physical memory.

In memory hierarchy, cache memory is closest to the microprocessor. A cache


controller copies data from physical memory to cache memory when cpu needs it.

cache memory uses parallel searching of data. It first compares the incoming address
to the address present in the cache. if the address matches, it is said that a hit is
occurred and the corresponding data is read by the cpu.. if the address do not match,
it is said that a miss has occurred.
cache memory consist of 2 levels:

level 1 cache(internal cache)

level 2 cache(external cache)

Reason of including L2 cache: if there is no L2 cache and the processor makes


an acess request for a memory location not in L1 cache then processor must acess
DRAM physical memory across the bus. Due to typical slow bus speed and slow
memory acess time, this results in poor performance. IF L2 cache is used, the data
can be access using a zero wait state transaction. And use of separate bus rather than
system bus.

ELEMENTS OF CACHE DESIGN: The factors to be considered while designing


the cache memory…

1) Cache size:
cache size should be small so that the average cost per bit is close to that
of main memory. The larger the cache it is slower.
2) mapping techniques:
it specifies how the cache is organized. types: direct, associative, set
associative.
3) Replacement algorithms: when the cache is filled up, and a new block is
brought into cache ,one of existing block must be replaced. Replacement
algorithm is needed for associative and set associative mapping. To achieve
high speed,such algorithm must be implemented in hardware.
The 4 most common replacement algorithms are:-
a) LRU: least recently used.
most effective.
replace that block in the set that has been in cache longest with no
reference to it.
easily implemented in 2 way associative.
b) FIFO: first in first out.
replace that block in a set that has been in cache longest.
fifo is easily implemented as round robin or circular buffer
technique.
c) LFU: least frequently used.
replace that block in the set that has experience fewer references
lfu can be implemented by associating a counter with each line.
d) Random replacement:
Pick a line at random from among the candidate lines. it has low
performance.

e) write policy:
i) write through: when a data is written from CPU into a location
in a cache, it is also written corresponding in physical memory.
ii) write back: the value written to cache is not always written to
physical memory. The value is written to physical memory only
once,when data is removed from cache.

f) line size: FOR HPC system, 64 and 128 bytes line sizes are mostly
used.
g) number of caches: cache memory is placed at 2 0r 3 levels. they are called
first level, second level and third level. some processor contain L1 and
L2 within the processor. the cache within the processor are internal cache
and outside the processor is external cache.

Cache Mapping:
Cache mapping defines how a block from the main memory is
mapped to the cache memory in case of a cache miss. Cache
mapping is a technique by which the contents of main memory
are brought into the cache memory.
1. Direct Mapping
2. Fully Associative Mapping
3. K-way Set Associative Mapping
1) Direct mapping,
A particular block of main memory can map only to a particular
line of the cache. Consider cache memory is divided into ‘n’
number of lines. Then, block ‘j’ of main memory can map to line
number (j mod n) only of the cache.
In direct mapping,
There is no need for any replacement algorithm. This is because
a main memory block can map only to a particular line of the
cache. Thus, the new incoming block will always replace the
existing block (if any) in that particular line.
2. Fully Associative Mapping
In fully associative mapping, A block of main memory can map
to any line of the cache that is freely available at that moment.
This makes fully associative mapping more flexible than direct
mapping.
Here, All the lines of cache are freely available. Thus, any block
of main memory can map to any line of the cache. Had all the
cache lines been occupied, then one of the existing blocks will
have to be replaced. In fully associative mapping, A
replacement algorithm is required. Replacement algorithm
suggests the block to be replaced if all the cache lines are
occupied. Thus, replacement algorithm like FCFS Algorithm,
LRU Algorithm, etc is employed.
3. K-way Set Associative Mapping
In k-way set associative mapping,
Cache lines are grouped into sets where each set contains k
number of lines. A particular block of main memory can map to
only one particular set of the cache. However, within that set,
the memory block can map any cache line that is freely
available.

Here, k = 2 suggests that each set contains two cache lines.


Since cache contains 6 lines, so number of sets in the cache = 6
/ 2 = 3 sets. Block ‘j’ of main memory can map to set number (j
mod 3) only of the cache. Within that set, block ‘j’ can map to
any cache line that is freely available at that moment. If all the
cache lines are occupied, then one of the existing blocks will
have to be replaced.
Set associative mapping is a combination of direct mapping and
fully associative mapping. It uses fully associative mapping
within each set. Thus, set associative mapping requires a
replacement algorithm. If k = 1, then k-way set associative
mapping becomes direct mapping.

H) Virtual Memory

You might also like