Sie sind auf Seite 1von 65

MEMORY SYSTEM ORGANIZATION AND

ARCHITECTURE
Memory Systems Hierarchy
Computer Memory
• A memory is just like a human brain. It is used to store
data and instructions.

• Computer memory is the storage space in computer


where data is to be processed and instructions required
for processing are stored.

• The memory is divided into large number of small parts


called cells.

• Each location or cell has a unique address which varies


from zero to memory size minus one
Types of Memory
Memory is primarily of three types

– Cache Memory

– Primary Memory/Main Memory/Volatile

– Secondary Memory/Non-Volatile
Cache Memory

• Cache memory is a very high speed semiconductor


memory which can speed up CPU.

• It acts as a buffer between the CPU and main


memory.

• It is used to hold those parts of data and program


which are most frequently used by CPU.

• The parts of data and programs are transferred from


disk to cache memory by operating system, from
where CPU can access them.
Advantages
The advantages of cache memory are as follows:

Cache memory is faster than main memory.

It consumes less access time as compared to main


memory.

It stores the program that can be executed within a short


period of time.

It stores data for temporary use.


Disadvantages

The disadvantages of cache memory are as


follows:
Cache memory has limited capacity.

It is very expensive.


Primary Memory (Main Memory)
 Primary memory holds only those data and instructions on
which computer is currently working.

 It has limited capacity and data is lost when power is switched


off.

 It is generally made up of semiconductor device. These


memories are not as fast as registers.

 The data and instruction required to be processed reside in


main memory.

 It is divided into two subcategories RAM and ROM.


Characteristics of Main Memory
These are semiconductor memories

Usually volatile memory.

Data is lost in case power is switched off.

It is working memory of the computer.

Faster than secondary memories.

A computer cannot run without primary memory.


Secondary Memory
 This type of memory is also known as external memory or
non-volatile.

 It is slower than main memory. These are used for storing


data/Information permanently.

 CPU directly does not access these memories instead they


are accessed via input-output routines.

 Contents of secondary memories are first transferred to


main memory, and then CPU can access it.
For example : disk, CD-ROM, DVD etc.
Characteristic of Secondary Memory
• These are magnetic and optical memories
• It is known as backup memory.
• It is non-volatile memory.
• Data is permanently stored even if power is
switched off.
• It is used for storage of data in a computer.
• Computer may run without secondary memory.
• Slower than primary memories.
Types of main memory

ROM- Read only Memory/Non Volatile

RAM- Random Access Memory/Volatile


Types of ROM
• PROM-Programmable ROM
• Programmed after Manufacture
• Once they are programmed , cannot be changed
• One-Time Programmable

• EPROM-Erasable programmable read-only memory


• Erasable using UV radiation
• Reprogrammable
Types of ROM
EEPROM
• Erase Electrically
• The chip does not have to removed to be
rewritten.
• The entire chip does not have to be completely
erased to change a specific portion of it.
• Changing the contents does not require
additional dedicated equipment.(1 byte )
.
Types of ROM
Flash Memory
 A type of EEPROM that uses in-circuit wiring to
erase by applying an electrical field to the entire
chip or to predetermined sections of the chip called
blocks.

 This erases the targeted area of the chip, which can


then be rewritten. Flash memory works much faster
than traditional EEPROMs because instead of
erasing one byte at a time, it erases a block or the
entire chip, and then rewrites it.
ROM USAGE
 Permanent Storage

 Micro Programming

 Library subroutines

 Systems Programs(BIOS)

 Function tables
RAM
 Read and write (R/W) memory of a computer is
called RAM.

 The User can write information to it and read


information from it.

 Ram any location can be reached in a fixed ( and


short) amount of time after specifying its address.
characteristics
 RAM is a volatile memory, it means information
written to it can be accessed as long as power is on.

 As soon as the power is off, it can not be accessed.


so this mean RAM computer memory essentially
empty.

 RAM holds data and processing instructions


temporarily until the CPU needs it.
characteristics
RAM is considered “random access” because you
can access any memory cell directly if you know the
row and column that intersect at that cell.

RAM is made in electronic chips made of so called


semiconductor material, just like processors and
many other types of chips.

In RAM, transistors make up the individual storage


cells which can each “remember” an amount of
data
Types of RAM

Dynamic RAM

Static RAM
Dynamic RAM
Dynamic RAM : loses its stored information in a very
short time (for milli sec.) even when power supply is
on.

D-RAM’s are cheaper & lower.

In the most common form of computer memory,


Dynamic Memory Cell, represents a single bit of data.

The capacitor holds the bit of information – a 0 or a 1.


Dynamic RAM
Dynamic memory to work, either the CPU or the
Memory Controller has to come along and recharge
all of the capacitors holding it before they discharge.

To do this, the memory controller reads the memory


and then writes it right back.

This refresh operation happens automatically


thousands of times per second.
Static RAM
Static RAM uses a completely different technology. S-RAM
retains stored information only as long as the power supply
is on.

Static RAM’s are costlier and consume more power. They


have higher speed than D-RAMs.

In static RAM, a form of flip flop holds each bit of memory.

A flip-flop for a memory cell takes four or six transistors


along with some wiring, but never has to be refreshed. This
makes static RAM significantly faster than dynamic RAM.
Some other RAMS
 EDO (Extended Data Output) RAM : In an EDO RAMs, any
memory location can be accessed. Stores 256 bytes of data
information into latches.

 SDRAM (Synchronous DRAMS), SGRAMs (Synchronous


Graphic RAMs) These RAM chips use the same clock rate as
CPU uses. They transfer data when the CPU expects them to
be ready.

 DDR-SDRAM (Double Data Rate – SDRAM) : This RAM


transfers data on both edges of the clock. Therefore the
transfer rate of the data becomes doubles.
Main Memory Capacity

• Memory Locations/ word can be


grouped into blocks

• Memory capacity usually measured in


bits

• Total no of memory location*size of


memory location
Main Memory Capacity
• Main memory is divided into blocks

• If a memory word is 8 bit and the size of block is 8


words
Main Memory Capacity
Find the capacity of main memory, if the total number
of blocks in the memory is 128
Solution
1 block = 8 word
128 blocks =128 *8 =1024 word
1 word = 8 bit
Capacity= 1024 * 8 =210*23=213 bits
How many blocks in main memory if the memory capacity
is 32kbits

Solution:

Capacity=No of locations* size of each location

No of locations = 32kbits / 8 bits

=(32 * 210 )/ 23 =2 12
No of blocks = 2 12/8 =2 9=512 blocks
Main Memory contains 8k blocks of 512 words each. Each word is 8 bit

Solution:

Capacity= No of locations* size of location

No of locations= 8 *210 *29 =222

Size of location =8 =23 bits

Capacity = 222 * 23 = 225= 220 * 25 = 32 Mbyte


Constructing 256K X 8 RAM using four 64K x
8 RAM Chip
Constructing 256K X 8
RAM using 64K x 8 RAM
Chip
When bit 17 and 16 = 00
The first 64 x 8 RAM is activated
Address : 0 – 65,535

When bit 17 and 16 = 01


The 2nd 64 x 8 RAM is activated
Address : 65,536 – 131,071

When bit 17 and 16 = 10


The 3rd 64 x 8 RAM is activated
Address : 131,071 – 196,607

When bit 17 and 16 = 11


The 4th 64 x 8 RAM is activated
Address : 196,608 – 262,143
Memory Interleaving
• A technique used to increase the throughput.

• The core idea is to split the memory system in


to independent banks, which can answer read
or write request in parallel
Cache Memory
Cache Memory
Cache-Latency /Delay
• Cache Hit Latency

– Time taken to identify the required data is present in


cache or not

• Cache Miss Latency

– Time taken to get from main memory to cache


– Read the data/Instruction
Main Memory-Latency/Delay
• Page Hit

– Time taken to identify the required data is present in


Main Memory or not

• Page miss/Page Fault

– Time taken to get from Secondary memory to Main


– Read the data/Instruction
Mapping

• A memory map is a structure of data (which


usually resides in memory itself) that indicates
how memory is laid out.
Cache Management
Cache memory organization
• Direct Mapping
• Associative mapping
• Set associative mapping

• Numerical problems solved in class


Direct Mapping
S.no

Words/block
Main Memory Tag Directory
Cache Size or Tag bits
Size size
Block size

1
128 KB 16 KB 256 B ? ?
2
32 GB 32 KB 1 KB ? ?
3
? 512 KB 1 KB 7 ?
4
16 GB ? 4 KB 10 ?
5
64 MB ? ? 10 ?
6
? 512 KB ? 7 ?
Direct Mapping
S.no

Words/block
Main Memory Tag Directory
Cache Size or Tag bits
Size Size(bits)
Block size

1
128 KB 16 KB 256 B 3 3x 26
2
32 GB 32 KB 1 KB 20 20 x 25
3
226 512 KB 1 KB 7
7 x 29
4
16 GB
224 4 KB 10
10 x 212
5
64 MB
216 Unknown 10 Unknown
6
226 512 KB Unknown 7 Unknown
Associative Mapping
No of
comparator
s
Words/block
Main Memory Tag Directory
Cache Size or Tag bits
Size size
Block size

?
128 KB 16 KB 256 B ? ?
?
32 GB 32 KB 1 KB ? ?
?
? 512 KB 1 KB 17 ?
?
16 GB ? 4 KB ? ?
?
64 MB ? ? 10 ?
?
? 512 KB ? 7 ?
Associative Mapping
No of
comparat
ors Main Words/block
Tag Directory
Memory Cache Size or Tag bits
size
Size Block size

64 128 KB 16 KB 256 B 9 9 X26


25 32 GB 32 KB 1 KB 25 25 X25
29 27 MB 512 KB 1 KB 17 17 X 29
Unknown 16 GB Unknown 4 KB 22 Unknown
Unknown Unknown
64 MB Unknown 64 KB 10
Unknown
Unknown 512 KB Unknown 7 Unknown
Set Associative mapping
Main Cache Block size Tag bits Tad DIR size Set
memory memory Associative/
No of lines in
a set
128 KB 16 KB 256 B ? ? 2-way

32 GB 32KB 1 KB ? ? 4-way

? 512 KB 1 KB 7 ? 8-way

16 GB ? 4 KB 10 ? 4-way

64 MB ? ? 10 ? 4-way

? 512 KB ? 7 ? 8-way
Set Associative mapping
Main memory Cache memory Block size Tag Tad DIR size Set
bits Associa
tive/
No of
lines in
a set
128 KB 16 KB 256 B 4 4 X 26 2-way

32 GB 32KB 1 KB 22 22 X 32 4-way

223 B 512 KB 1 KB 7 7X 29 8-way

16 GB 226 4 KB 10 10 X 214 4-way

64 MB UNKNOWN UNKNOWN 10 UNKNOWN 4-way

UNKNOWN 512 KB UNKNOWN 7 UNKNOWN 8-way

Das könnte Ihnen auch gefallen