0% found this document useful (0 votes)
20 views12 pages

Unit V Theory and Numerical Solution

Uploaded by

aanku5835
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)
20 views12 pages

Unit V Theory and Numerical Solution

Uploaded by

aanku5835
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/ 12

Auxiliary memory

Auxiliary memory, also known as secondary storage, is a crucial component of a computer system. It
provides non-volatile storage, meaning it retains data even when the computer is powered off. This
allows for long-term storage of programs and data that are not actively being used by the CPU.

Key Characteristics of Auxiliary Memory:

• Non-volatile: Data is retained even when the power is off.

• High capacity: Offers significantly larger storage capacity compared to primary memory (RAM).

• Lower cost per bit: More economical for storing large amounts of data.

• Slower access speed: Accessing data from auxiliary memory is slower than accessing data from
RAM.

Types of Auxiliary Memory:

1. Magnetic Storage:

o Magnetic Disks: These are circular platters coated with magnetic material. Data is stored
by magnetizing or demagnetizing spots on the disk surface.

▪ Hard Disk Drives (HDDs): Consist of multiple platters stacked on a spindle, with
read/write heads that access data on each surface. HDDs offer high capacity and
relatively fast access times.

▪ Floppy Disks: Older, portable storage medium with lower capacity and slower
access times compared to HDDs.

o Magnetic Tapes: These are plastic tapes coated with magnetic material. Data is stored
sequentially along the tape. Magnetic tapes are commonly used for backups and archival
storage due to their high capacity and low cost.

2. Optical Storage:

o CDs (Compact Discs): Data is stored as microscopic pits on a reflective surface. CDs are
read by a laser beam.

o DVDs (Digital Versatile Discs): Similar to CDs but with higher storage capacity due to
smaller pit size and multiple layers.

o Blu-ray Discs: Use a blue laser with a shorter wavelength, allowing for even higher
storage capacity than DVDs.

3. Solid-State Storage:

o Solid State Drives (SSDs): Use flash memory to store data. SSDs have no moving parts,
resulting in significantly faster access times, lower power consumption, and greater
durability compared to HDDs.
o USB Flash Drives: Portable storage devices that use flash memory. They are small,
convenient, and widely used for transferring data between computers.

Memory Hierarchy:

Auxiliary memory forms the lowest level of the memory hierarchy in a computer system. This hierarchy
consists of:

1. Registers: Fastest and smallest memory, located within the CPU.

2. Cache Memory: Fast memory used to store frequently accessed data from RAM.

3. Main Memory (RAM): Volatile memory used to store actively running programs and data.

4. Auxiliary Memory: Non-volatile memory used for long-term storage.

Importance of Auxiliary Memory:

• Permanent Storage: Enables long-term storage of programs, data, and operating systems.

• Data Backup and Archiving: Provides a means to create backups of important data and archive
old data for future use.

• Program Storage: Stores application programs that can be loaded into RAM when needed.

• Virtual Memory: Extends the apparent size of RAM by using a portion of auxiliary memory as a
swap space.

Summary

Solid-State
Feature Magnetic Storage Optical Storage
Storage
Storage
Magnetization Optical reading Flash memory
Mechanism
Access Speed Slower Slower Faster
Capacity High Medium Medium to High
Cost Low Medium Higher
Durability Moderate Moderate High
Common HDD, Magnetic SSD, USB Flash
CD, DVD, Blu-ray
Examples Tape Drive

Memory Hierarchy
Memory Hierarchy is one of the most required things in Computer Memory as it helps in optimizing the
memory available in the computer. There are multiple levels present in the memory, each one having a
different size, different cost, etc. Some types of memory like cache, and main memory are faster as
compared to other types of memory but they are having a little less size and are also costly whereas
some memory has a little higher storage value, but they are a little slower. Accessing of data is not
similar in all types of memory, some have faster access whereas some have slower access.

Types of Memory Hierarchy

This Memory Hierarchy Design is divided into 2 main types:

• External Memory or Secondary Memory: Comprising of Magnetic Disk, Optical Disk, and
Magnetic Tape i.e. peripheral storage devices which are accessible by the processor via an I/O
Module.

• Internal Memory or Primary Memory: Comprising of Main Memory, Cache Memory & CPU
registers . This is directly accessible by the processor.

Memory Hierarchy Design

1. Registers

Registers are small, high-speed memory units located in the CPU. They are used to store the most
frequently used data and instructions. Registers have the fastest access time and the smallest storage
capacity, typically ranging from 16 to 64 bits.

2. Cache Memory

Cache memory is a small, fast memory unit located close to the CPU. 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.

3. 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.

Types of Main Memory

• 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.

• 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.

4. Secondary Storage

Secondary storage, such as hard disk drives (HDD) and solid-state drives (SSD) , 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. Secondary storage has the slowest access time and is typically the
least expensive type of memory in the memory hierarchy.

5. Magnetic Disk

Magnetic Disks are simply circular plates that are fabricated with either a metal or a plastic or a
magnetized material. The Magnetic disks work at a high speed inside the computer and these are
frequently used.

6. Magnetic Tape

Magnetic Tape is simply a magnetic recording device that is covered with a plastic film. It is generally
used for the backup of data. In the case of a magnetic tape, the access time for a computer is a little
slower and therefore, it requires some amount of time for accessing the strip.

Characteristics of Memory Hierarchy

• Capacity: It is the global volume of information the memory can store. As we move from top to
bottom in the Hierarchy, the capacity increases.

• Access Time: It is the time interval between the read/write request and the availability of the
data. As we move from top to bottom in the Hierarchy, the access time increases.

• Performance: Earlier when the computer system was designed without a Memory Hierarchy
design, the speed gap increased between the CPU registers and Main Memory due to a large
difference in access time. This results in lower performance of the system and thus,
enhancement was required. This enhancement was made in the form of Memory Hierarchy
Design because of which the performance of the system increases. One of the most significant
ways to increase system performance is minimizing how far down the memory hierarchy one has
to go to manipulate data.

• Cost Per Bit: As we move from bottom to top in the Hierarchy, the cost per bit increases i.e.
Internal Memory is costlier than External Memory.
Advantages of Memory Hierarchy

• It helps in removing some destruction, and managing the memory in a better way.

• It helps in spreading the data all over the computer system.

• It saves the consumer’s price and time.

Associative memory
Associative memory is also known as content addressable memory (CAM) or associative storage or
associative array. It is a special type of memory that is optimized for performing searches through data,
as opposed to providing a simple direct access to the data based on the address.

It can store the set of patterns as memories when the associative memory is being presented with a key
pattern, it responds by producing one of the stored pattern which closely resembles or relates to the key
pattern.

How Does Associative Memory Work?

In conventional memory, data is stored in specific locations, called addresses, and retrieved by
referencing those addresses. In associative memory, data is stored together with additional tags or
metadata that describe its content. When a search is performed, the associative memory compares the
search query with the tags of all stored data, and retrieves the data that matches the query.

Associative memory is designed to quickly find matching data, even when the search query is incomplete
or imprecise. This is achieved by using parallel processing techniques, where multiple search queries can
be performed simultaneously. The search is also performed in a single step, as opposed to conventional
memory where multiple steps are required to locate the data.

Hardware organization of associative memory:-

Block Diagram of associative memory


• Argument Register: It contains words to be searched. It contains ‘n’ number of bits.

• Match Register: It has m-bits, One bit corresponding to each word in the memory array. After the
making process, the bits corresponding to matching words in match register are set to ‘1’.

• Key Register: It provides a mask of choosing a particular field/key in argument register. It


specifies which part of the argument word need to be compared with words in memory.

• Associative Memory Array: It combines word in that are to be compared with the arguments
word in parallel. It contains ‘m’ words with ‘n’ bit per word.

Applications of Associative memory :-

1. It can be only used in memory allocation format.

2. It is widely used in the database management systems, etc.

3. Networking: Associative memory is used in network routing tables to quickly find the path to a
destination network based on its address.

4. Image processing: Associative memory is used in image processing applications to search for
specific features or patterns within an image.

5. Artificial intelligence: Associative memory is used in artificial intelligence applications such as


expert systems and pattern recognition.

6. Database management: Associative memory can be used in database management systems to


quickly retrieve data based on its content.

Advantages of Associative memory :-

1. It is used where search time needs to be less or short.

2. It is suitable for parallel searches.

3. It is often used to speedup databases.

4. It is used in page tables used by the virtual memory and used in neural networks.

Disadvantages of Associative memory :-

1. It is more expensive than RAM

Virtual Memory
Virtual memory is a memory management technique used by operating systems to give the
appearance of a large, continuous block of memory to applications, even if the physical memory
(RAM) is limited. It allows larger applications to run on systems with less RAM.
• The main objective of virtual memory is to support multiprogramming, The main
advantage that virtual memory provides is, a running process does not need to be
entirely in memory.
• Programs can be larger than the available physical memory. Virtual Memory provides an
abstraction of main memory, eliminating concerns about storage limitations.
• A memory hierarchy, consisting of a computer system’s memory and a disk, enables a
process to operate with only some portions of its address space in RAM to allow more
processes to be in memory.

A virtual memory is what its name indicates- it is an illusion of a memory that is larger than the
real memory. We refer to the software component of virtual memory as a virtual memory
manager. The basis of virtual memory is the noncontiguous memory allocation model. The
virtual memory manager removes some components from memory to make room for other
components.
Types of Virtual Memory
In a computer, virtual memory is managed by the Memory Management Unit (MMU), which is
often built into the CPU. The CPU generates virtual addresses that the MMU translates into
physical addresses.
There are two main types of virtual memory:
• Paging
• Segmentation
Paging
Paging divides memory into small fixed-size blocks called pages. When the computer runs out of
RAM, pages that aren’t currently in use are moved to the hard drive, into an area called a swap
file. The swap file acts as an extension of RAM. When a page is needed again, it is swapped back
into RAM, a process known as page swapping. This ensures that the operating system (OS) and
applications have enough memory to run.
Segmentation
Segmentation divides virtual memory into segments of different sizes. Segments that aren’t
currently needed can be moved to the hard drive. The system uses a segment table to keep
track of each segment’s status, including whether it’s in memory, if it’s been modified, and its
physical address. Segments are mapped into a process’s address space only when needed.

Direct Memory Access (DMA) Controller


In modern computer systems, transferring data between input/output devices and memory can
be a slow process if the CPU is required to manage every step. To address this, a Direct Memory
Access (DMA) Controller is utilized. A Direct Memory Access (DMA) Controller solves this by
allowing I/O devices to transfer data directly to memory, reducing CPU involvement. This
increases system efficiency and speeds up data transfers, freeing the CPU to focus on other
tasks. DMA controller needs the same old circuits of an interface to communicate with the CPU
and Input/Output devices.

What is a DMA Controller?


Direct Memory Access (DMA) uses hardware for accessing the memory, that hardware is called
a DMA Controller. It has the work of transferring the data between Input Output devices and
main memory with very less interaction with the processor. The direct Memory Access
Controller is a control unit, which has the work of transferring data.

DMA Controller in Computer Architecture


DMA Controller is a type of control unit that works as an interface for the data bus and the I/O
Devices. As mentioned, DMA Controller has the work of transferring the data without the
intervention of the processors, processors can control the data transfer. DMA Controller also
contains an address unit, which generates the address and selects an I/O device for the transfer
of data. Here we are showing the block diagram of the DMA Controller.

Block Diagram of DMA Controller

Types of Direct Memory Access (DMA)


There are four popular types of DMA.
• Single-Ended DMA
• Dual-Ended DMA
• Arbitrated-Ended DMA
• Interleaved DMA
Single-Ended DMA: Single-Ended DMA Controllers operate by reading and writing from a single
memory address. They are the simplest DMA.
Dual-Ended DMA: Dual-Ended DMA controllers can read and write from two memory
addresses. Dual-ended DMA is more advanced than single-ended DMA.
Arbitrated-Ended DMA: Arbitrated-Ended DMA works by reading and writing to several
memory addresses. It is more advanced than Dual-Ended DMA.
Interleaved DMA: Interleaved DMA are those DMA that read from one memory address and
write from another memory address.
Q. How many total bits are required for a direct mapped cache with 16 KB of data and 4 –
word block, assuming a 32 bit address.
Solution
1. Cache Size in Words:

• Cache size = 16 KB = 16 * 1024 bytes = 16384 bytes

• Since there are 4 bytes per word, the cache size in words is 16384 bytes / 4 bytes/word = 4096
words

2. Number of Cache Lines:

• Block size = 4 words

• Number of cache lines = Cache size in words / Block size = 4096 words / 4 words/block = 1024
lines

3. Address Breakdown:

With a 32-bit address, we need to divide it into three parts for a direct-mapped cache:

• Block Offset: Since each block contains 4 words, we need 2 bits to select a word within a block
(2<sup>2</sup> = 4).

• Index: We have 1024 cache lines, so we need 10 bits to index into the cache (2<sup>10</sup> =
1024).

• Tag: The remaining bits are used for the tag. Tag bits = 32 (total address bits) - 2 (block offset
bits) - 10 (index bits) = 20 bits.

4. Bits per Cache Line:

Each cache line needs to store:

• Data: 4 words * 32 bits/word = 128 bits

• Tag: 20 bits

• Valid Bit: 1 bit (to indicate whether the cache line contains valid data) 1

Total bits per line = 128 + 20 + 1 = 149 bits

5. Total Cache Bits:

Total bits in the cache = Number of cache lines * Bits per cache line = 1024 lines * 149 bits/line = 152576
bits

Therefore, a total of 152,576 bits are required for the direct-mapped cache.

You might also like