Memory Organization
Memory Organization
Main memory
Internal memory, also called "main or primary memory" refers to
memory that stores small amounts of data that can be accessed quickly
while the computer is running.
There are basically two kinds of internal memory: ROM and RAM.
Types of RAM
There are two main types of RAM: Dynamic RAM (DRAM) and Static
RAM (SRAM).
DRAM (pronounced DEE-RAM), is widely used as a computer’s main
memory. Each DRAM memory cell is made up of a transistor and a
capacitor within an integrated circuit, and a data bit is stored in the
capacitor(Binary infn is stored in the form of electric charges that are
applied to capacitors). Since transistors always leak a small amount, the
capacitors will slowly discharge, causing information stored in it to
drain; hence, DRAM has to be refreshed (given a new electronic charge)
every few milliseconds to retain data.
SRAM (pronounced ES-RAM) is made up of four to six transistors. It
keeps data in the memory as long as power is supplied to the system
unlike DRAM, which has to be refreshed periodically. As such, SRAM is
faster but also more expensive, making DRAM the more prevalent
memory in computer systems.
Bootstrap Loader
It is a pgm whose function is to start the computer software
operating when power is turned on.
Main memory
Types of ROM :
PROM : Short for programmable read-only memory, a memory chip on
which data can be written only once. Once a program has been written
onto a PROM, it remains there forever. Unlike RAM, PROMs retain their
contents when the computer is turned off. The difference between a
PROM and a ROM (read-only memory) is that a PROM is manufactured
as blank memory, whereas a ROM is programmed during the
manufacturing process. To write data onto a PROM chip, you need a
special device called a PROM programmer or PROM burner. The process
of programming a PROM is sometimes called burning the PROM.
EPROM : Acronym for erasable programmable read-only memory, and
pronounced ee-prom, EPROM is a special type of memory that retains its
contents until it is exposed to ultraviolet light. The ultraviolet light clears
its contents, making it possible to reprogram the memory. To write to
and erase an EPROM, you need a special device called a PROM
programmer or PROM burner.
EEPROM : Short form of electrically erasable programmable read-only
memory. EEPROM is a special type of PROM that can be erased by
exposing it to an electrical charge. Like other types of PROM, EEPROM
retains its contents even when the power is turned off. Also like other
types of ROM, EEPROM is not as fast as RAM.
RAM CHIP
to the CPU 16 - 11 10 9 8 R
7D - W1
R Data bus
Decoder
3 2 1 0
CS1
CS2
128× 8 Data
RD
RAM 1
WR
AD7
CS1
CS2
128× 8 Data
RD
RAM 2
WR
AD7
CS1
CS2
128× 8 Data
RD
RAM 3
WR
AD7
CS1
CS2
128× 8 Data
RD
RAM 4
WR
AD7
CS1
CS2
1-7 128× 8 Data
ROM
8
AD9
9
Associative Memory
Associative Memory
Match
register
Input
Associative memory
array and logic M
Read
Write m words
n bits per word
Output
Associative memory of an m word, n cells per word
A1 Aj An
K1 Kj Kn
Word 1 C 11 C 1j C 1n M1
Word i C i1 C ij C in Mi
Word m C m1 C mj C mn Mm
Write
R S Match
F ij To M i
logic
Read
Output
Match logic
Neglect the K bits and compare the argument in A with the bits
stored in the cells of the words.
K1 A1 K2 A2 Kn An
Mi
Read Operation
If only one word may match the unmasked argument field, then
connect output Mi directly to the read line in the same word
position,
If we exclude words having zero content, then all zero output will
indicate that no match occurred and that the searched item is
not available in memory.
Write Operation
Locality of reference
The references to memory at any given interval of time tent to be
contained within a few localized areas in memory.
If the active portions of the program and data are placed in a fast
small memory, the average memory access time can be reduced.
When the CPU refers to memory and finds the word in cache, it
produces a hit. If the word is not found in cache, it counts it as
a miss.
The ratio of the number of hits divided by the total CPU references
to memory (hits + misses) is the hit ratio. The hit ratios of 0.9 and
higher have been reported
Cache Memory
The average memory access time of a computer system can be
improved considerably by use of cache.
The cache is placed between the CPU and main memory. It is the
faster component in the hierarchy and approaches the speed of
CPU components.
For example,
· Associative Mapping
· Direct Mapping
· Self – Associative Mapping.
Cache Memory
The 9 least significant bits constitute the index field and the
remaining 6 bits form the tag fields.
The main memory needs an address but includes both the tag and
the index bits.
The cache memory requires the index bit only i.e., 9 bits.
There are 2k words in the cache memory & 2n words in the main
memory.
e.g: k = 9, n = 15
Direct Mapping
Direct Mapping
00000
6710
Direct Mapping
Each word in cache consists of the data word and it associated tag.
When a new word is brought into cache, the tag bits store along
data
The tag field of the CPU address is equal to tag in the word from
cache; there is a hit, otherwise miss.
Each tag requires 6 bits & each data word has 12 bits, so the word
length is 2(6+12) =36 bits
When the CPU generates a memory request, the index value of the
address is used to access the cache.
The tag field of the CPU address is compared with both tags in the
cache.
· Random replacement
· FIFO
· Least Recently Used (LRU)
Writing into cache
there are two writing methods that the system can proceed.
This method has the advantage that main memory always contains the
same data as the cache.
Write-back method
In this method only the cache location is updated during a write operation.
The location is then marked by a flag so that later when the word is
removed from the cache it is copied into main memory.
The reason for the write-back method is that during the time a word resides
in the cache, it may be updated several times.