0% found this document useful (0 votes)
13 views47 pages

Presentation 5421 Content Document 20250306025428PM

The document provides an overview of computer memory organization, detailing types of memory including primary (RAM and ROM) and secondary memory, as well as cache and virtual memory. It explains memory hierarchy, representation, and evaluation criteria, alongside the advantages and disadvantages of various memory types. Additionally, it covers memory management techniques such as associative memory and mapping procedures for cache memory.

Uploaded by

rishimalaviya05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views47 pages

Presentation 5421 Content Document 20250306025428PM

The document provides an overview of computer memory organization, detailing types of memory including primary (RAM and ROM) and secondary memory, as well as cache and virtual memory. It explains memory hierarchy, representation, and evaluation criteria, alongside the advantages and disadvantages of various memory types. Additionally, it covers memory management techniques such as associative memory and mapping procedures for cache memory.

Uploaded by

rishimalaviya05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Module-7

Memory Organization
Contents
• Memory Hierarchy
• Main Memory
• Auxiliary Memory
• Associative Memory
• Cache Memory
• Virtual Memory
• Memory Management Hardware
Introduction
Computer Memory Refers to electronics holding place for
instruction and data where the processor can reach
quickly.

Memory can be classified into two broad categories:

(1) Primary Memory (to handle the data).


(2) Secondary Memory (to store the output).
Motherboard
ROM, RAM
Memory Representation

• The basic unit of memory is bit. Memory


can be represented in the bit and bytes..
• 1 Bit = Binary Digit
• 8 Bits = 1 Byte
• 2^10 = 1024 Bytes = 1 KB (Kilo Byte)
• 2^20 = 1024 KB = 1 MB (Mega Byte)
• 2^30 = 1024 MB = 1 GB (Giga Byte)
• 2^40 = 1024 GB = 1 TB(Terra Byte)
Memory Hierarchy
• The memory is characterized on the basis of two key factors—
capacity and access time.
• Three fundamental types of memory:
 Internal processor Memory
• This memory is placed in CPU and it includes cache
memory and special registers, both of which can be
directly accessed by processor.
 Primary Memory
• RAM and ROM fall in the category of primary memory, also
known as main memory.
 Secondary Memory
• Also known as auxiliary memory, secondary memory
provides backup storage for instructions and data.
• Most commonly used secondary memory devices are hard
disk, magnetic disk, and magnetic tapes.
Memory Hierarchy
Storage Evaluation Criteria
• Storage Capacity
 It refers to size of memory.
• Cost
 Estimated by the cost per bit of storage.
• Access Time
 Time required between the request made for read/write
operation and time it takes for completion of the request.
• Physical Characteristics
 Four parts namely, electronic, magnetic, mechanical and
optical
• Permanence of Storage
 Volatile or Non-volatile.
• Access Mode
 Sequential
 Random
READ ONLY MEMORY (ROM)
• ROM stands for Read Only Memory.
 we can only read but cannot write on it.
 It is non-volatile. The information is stored permanently in such memories
during manufacture.
• A ROM, stores such instructions that are required to start a computer. This
operation is referred to as bootstrap.
 ROM chips are in the computer, other electronic items like washing machine
and microwave oven.
• BIOS(Basic Input Output System) is the responsible for the startup
of computer so it can be considered as a Read only memory.
• ROM for each and Every computer may be different that’s what
the
compatibility issue of platform generating while we use a different
platform.
Types of ROM
1. Masked ROM:
 The very first ROMs were hard-wired devices,
 It contained a pre-programmed set of data or instructions.
These kind of ROMs are known as masked ROMs.

2. Programmable ROM (PROM):


 The user buys a blank PROM and enters the desired
contents using a PROM program, also known as one-
time programmable (OTP) device
 Inside the PROM chip there are small
fuses which are burnt out during
programming.
Types of ROM (cont..)
3. Erasable Programmable ROM (EPROM):
 EPROM can be erased by exposing it to ultra-violet
light for a duration of up to 40 minutes.
 This process will erase the entire EPROM and then it
reprogrammed.
 EPROMs are more expensive than PROMs.
Types of ROM(cont..)
4. Electrically Erasable and Programmable
Read Only Memory (EEPROM):
 EEPROM can be erased by an electrical charge and then written to by
slightly higher-than-normal voltage.
 In EEPROM, any location can be selectively erased and programmed.
 EEPROMs can be erased one byte at a time, rather than erasing
the entire chip. Hence, the process of re-programming is flexible but
slow.
5. Flash ROM:
 Flash ROM, also called flash BIOS or flash memory, is a type of
constantly powered non- volatile memory that can be erased and re-
programmed in blocks.
 It is a variation of EEPROM.
Advantages of ROM

The advantages of ROM are as follows:


• Non-volatile in nature
• These cannot be accidentally changed
• Cheaper than RAMs
• Easy to test
• These are static and do not require refreshing
• Its contents are always known and can be verified
Random Access Memory (RAM)
• RAM(Random Access Memory) is the primary memory of
the CPU for storing data, program and program result.
 It is read/write memory which stores data until the
machine is working. As soon as the machine is switched
off, data is erased.
• RAM is volatile, i.e. Data stored in it is lost when we
switch off the computer or if there is a power failure.
• RAM is small, both in terms of its physical size and in the
amount of data it can hold.
• Data in the RAM can be accessed randomly but it is very
expensive.
MAIN MEMORY
RAM and ROM Chips

Typical RAM chip


Typical ROM Chips
MEMORY ADDRESS MAP

Address space assignment to each memory chip


Example: 128 bytes RAM and 512 bytes ROM

Memory Connection to CPU


- RAM and ROM chips are connected to a CPU through the data and
address buses
- The low-order lines in the address bus select the byte within the chips
and other lines in the address bus select a particular chip through
its chip select inputs
CONNECTION OF MEMORY TO CPU
Associative Memory

• Search of items in a table stored in memory.


– Searching of Symbol Table by assembler to get binary
equivalent of symbol.
– Account number in a file to determine the holder’s name
in account status.
• Searching By index
– Address is given to each content and search for the
content by using one by one address.
– Number of memory access is more if item is located at
higher location.
Associative Memory
• Search by Content.
• Also known as content addressable memory(CAM).
– Search by content rather than by address.
– Number of accesses reduced.
– Time reduced.
– Simultaneous memory access and in parallel on the
basis of data rather than address.
• When searches by content(memory word), the
memory locates all words which matches the
specified content and marks them for reading.
Hardware Organization

Compare each word in CAM in parallel with the


content of A(Argument Register)
- If CAM Word[i] = A, M(i) = 1
- Read sequentially accessing CAM for CAM Word(i) for M(i) = 1
- K(Key Register) provides a mask for choosing a particular field or key
in the argument in A(only those bits in the argument that have 1’s in
their corresponding position of K are compared)
Organization of CAM
CACHE MEMORY
• Locality of Reference
– The references to memory at any given time interval tend
to be confined within a localized areas
– Loops and subroutines.
– The addresses generated by a typical program refer to a
few localized areas of memory repeatedly, while the
remainder of memory is accessed relatively infrequently.
• Cache
– The property of Locality of Reference makes the Cache
memory systems work
– Cache is a fast small capacity memory that should hold
those information which are most likely to be accessed
Cache Memory

• 5*10 times faster access than main memory


PERFORMANCE OF CACHE
• Memory Access:
– All the memory accesses are directed first to Cache
– If the word is in Cache; Access cache to provide it to CPU
– If the word is not in Cache; Bring a block (or a line)
including that word to replace a block now in Cache.

How can we know if the word that is required is


there ?
If a new block is to replace one of the old blocks,
which one should we choose ?
Performance of Cache Memory
System

• Hit ratio.
• When the CPU refers to memory and finds
the word in cache, it is said to produce a hit.
• If the word is not found in cache, it is in main
memory and it counts as a miss.
• The ratio of hits divided by the total CPU
references to memory is hit ratio.
MEMORY AND CACHE MAPPING
• Transformation of data from main memory to cache
memory is referred to as a mapping process.
• Three types of mapping procedures:
1. Associative Mapping
2. Direct Mapping
3. Set-Associative Mapping.
MEMORY AND CACHE MAPPING
Associative Mapping

• Associative memory stores both the address and


content of the memory word.
• Any location in cache to store any word from main
memory.
DMEMORY AND CACHE MAPPING
Direct Mapping
• Associative memories are expensive compared to RAM be
cause of added logic associated with each cell.
• Possibility of using RAM for the cache.
• ADDRESSING RELATIONSHIPS BETWEEN MAIN AND CACHE
MEMORIES
Direct Mapping Cache Organization
DIRECT MAPPING
• CPU generates a memory request with
(TAG;INDEX)
- Access Cache using INDEX ; (tag; data)
Compare TAG and tag
- If matches -> Hit
Provide Cache[INDEX](data) to CPU
- If not match -> Miss
Cache[INDEX] <- (TAG;M[TAG; INDEX])
CPU <- Cache[INDEX](data)
MEMORY AND CACHE MAPPING - SET
ASSOCIATIVE MAPPING

• Disadvantage of direct mapping is that two words


with same index in their address but with
different tag values can not reside in cache
memory at the same time.
• Set-Associative mapping is an improvement over
direct mapping in which each word of cache can
store two or more words of memory under the
same index register.
• Number of tag-data items in one word of cache is
said to form a set
Set-Associative Mapping

• When the CPU generates a memory request,


the index value of the address is used to
access the cache.
Set-Associative Mapping
• The tag field of the CPU address is compared
with both tags in the cache to determine if a
match occurs.
• When a miss occurs and the set is full, it is
necessary to replace one of the tag-data
items with a new value.
• The most common replacement algorithms
are: random replacement, FIFO and LRU
Virtual Memory
• Virtual Memory is used to give programmers
the illusion that they have a very large
memory at their disposal, even though the
computer actually has a relatively small main
memory.
• A virtual memory system provides a
mechanism for translating program-
generated addresses into correct main
memory locations.
Virtual Memory
• Address Space
– An address used by a programmer will be called a
virtual address, and the set of such addresses is
known as address space.
• Memory Space
– An address in main memory is called a location
or physical address. The set of such locations is
called the memory space.
Virtual Memory
• Relation between Address space & Memory space
Virtual Memory
Address Mapping
• Address Space and Memory Space are each
divided into fixed size group of words called
blocks or pages
• 1K words group
Page 0
Page 1
Page 2 Memory Block 0
Address Page 3 space Block 1
space Page 4 M = 4K = 212
N = 8K = 213 Block 2
Page 5 Block 3
Page 6
Page 7
Example
• An address space is specified by 24 bits and
the corresponding memory space by 16 bits.
– How many words are there in address space.
– How many words are there in the memory space.
– If a page consists of 2K words, how many pages
and blocks are there in the system?
Address Mapping
Organization of memory Mapping Table in a paged system
Exercise
• The logical address space in a computer
system consists of 128 segments. Each
segment can have up to 32 pages of 4K words
in each. Physical memory consists of 4K
blocks of 4K words in each. Formulate the
logical and physical address formats.
• Give the binary number of the logical address
for segment 36 and word number 2000 in
page 15.
Advantages
• The big advantage of virtual memory is that
only a part of the program needs to be in
memory for execution.
• So, more programs can run simultaneously
at the same time interval.
• Virtual memory can increase CPU utilization
and overall power of a system since large
programmes can be run with real less
primary memory.
Disadvantages
• The major disadvantage of virtual memory is
when a system uses virtual memory, the
application may run very slowly.
• So, CPU takes more times to switch between
the applications.
Exercise 1
• How many 128*8 RAM chips are needed to
provide a memory capacity of 2048 bytes?
• How many lines of the address bus must be
used to access 2048 bytes of memory? How
many of these lines will be common to all
chips?
• How many lines must be decoded for chip
select? Specify the size of the decoders.
Exercise 2
• A computer employs RAM chips of 256*8 and ROM
chips of 1024*8.The computer system needs 2K bytes
of RAM,4K bytes of ROM and four interface units, each
with four registers. A memory-mapped I/O
configuration is used. The two highest-order bits of the
address bus are assigned 00 for RAM,01 for ROM and
10 for interface registers.
• How many RAM and ROM chips are needed?
• Draw a memory-address map for the system.
• Give the address range in hexadecimal for RAM,ROM
and interface.

You might also like