2. Memory basics
• Memory : - Physical storage device in computer system.
• Single memory can be used to store the data.
• But we are using multiple memory, to increase the performance.
• So memory hierarchy is used.
• Goal of memory hierarchy:- To maximise the access speed
To minimise the cost per bit.
• Different types of memory :-
Internal memory - Registers, cache memory
Main memory - RAM, ROM
Secondary memory - HDD
Tertiary memory - Tape drive
5. Static RAM vs Dynamic RAM
1. Made up of Flip-Flop
2. No periodic refreshment
required
3. Faster
4. More costly
5. Used as cache memory
1.Made up of capacitor
2. Periodic refreshment
required
3. Comparatively slower
4. Less expensive
5. Used as main memory
6. Memory representation
✓ Memory is used to store the data.
✓ Memory is divided into number of
cells.
✓ It looks like a two dimensional array.
✓ Each cross section of row and column
is known as cell.
✓ Capacity of each cell is 1 bit.
✓ Each row in memory is called Word.
✓ Size of word may be 8bit/16bit/
32bit/64 bit.
✓ If n-number of bits is used for
address lines then total memory
address possible is 2n .
✓ Range of address is 0 to 2n-1 .
Cell
7. Memory organisation
• 128 x 8 decoder is given. Find number of bits required?
128 x 8
Decoder
CS
8bits data line
WR
RD
Address Line 7-bits
✓ 128 x 8 means total address is 128 and 8 data lines
present.
✓ To represent 128 address space 7bit address line is
required.
✓ CS means chip Select , 1 bit is required to enable the
chip.
number of address line(n)= log2
total address
log2
128 = log227=7*1=7
✓ WR stands for write, needs 1bit.
✓ For read(RD) 1-bit is required.
✓ So total bits required= 7+8+1+1+1 = 18bits
9. Characteristics of cache memory
• Cache memory is fastest memory.
• Present in between main memory processor.
• Smaller in size.
• Expensive.
• Used for frequently accessed data.
• Reduce the average access time.
10. Cache hit/miss
• If the processor finds that the memory location is in the cache, a cache
hit has occurred and data is read from cache
• If the processor does not find the memory location in the cache,
a cache miss has occurred. For a cache miss, the cache allocates a new
entry and copies in data from main memory, then the request is
fulfilled from the contents of the cache.
• The performance of cache memory is frequently measured in terms of
a quantity called Hit ratio.
• Hit ratio= number of hit/ hit + miss = total hit /total reference accessed
11. Locality of reference
• Locality of reference: It is known as Principle of locality. Frequently
used data present in cache memory. Processor searches required data
in cache that is called locality of reference.(tendency of processor to
access the same set of memory location repetitively within relatively
small duration). It is of two types.
• Temporal locality : Recently reference items may required in near future.
• Spatial locality : Items in the near by address are may be referenced. It is
also known as data locality. Sequential locality is special type of Spatial
locality.
12. Types of caches
Primary caches: - Located in processor chip.
- access time is comparably less.
- normally known as label-1 cache(L1).
Secondary cache: - present between primary cache and Main memory.
- access time is more than primary cache.
- usually known as label-2 cache(L2).
Primary
cache
Secondary
cache