Рет қаралды 25,062
TRB Computer Science - Computer System Architecture - Memory System Overview
Tamil Nadu TRB computer instructors Grade1 exam
----------
Classification of Memory
1. Primary Memory / Main Memory
Semiconductor Memory
a. Volatile
Data will be lost if system power off
i. RAM (Randam Access Memory) Read/Write Memory
Latency time is same for any block of data
1. SRAM - Static RAM
a. Costly and faster compare to DRAM
b. Less capacity only
c. Used for Cache
2. DRAM - Dynamic RAM (Asynchronous)
a. Slower and cheap compare to SRAM
b. Can have more capacity
c. Uses extra capacitor along with transistors, and it can hold the data for some time if power off
i. Requires refreshing to retain the data in capacitor
d. Used for Main Memory
3. SDRAM - Synchronous DRAM (Sync with CPU Clock)
4. SDR SDRAM - Single Data Rate SDRAM
5. DDR SDRAM - Double Data Rate SDRAM
6. GDDR SDRAM - Graphics Double Data Rate SDRAM
b. Non-Volatile
Data will not be lost even if system power is off
i. ROM (Read Only Memory)
1. PROM - Programmable ROM
2. EPROM - Erasable PROM
3. EEPROM - Electrically EPROM
ii. Flash Memory (Faster, stores data in chunks 512b)
2. Secondary Memory / External Memory (Non-Volatile)
Magnetic Storage (memory)
a. Hard disk
b. Pen drive
c. Tape
d. Drive
e. Memory card
Important Factors of Memory
1. Speed
2. Size / Capacity
3. Cost
Memory Hierarchy
Principle of Locality
• Programs tends to reuse data and instructions that are closer to those they have been recently, or they were recently referenced.
• Temporal Locality
o Recently referenced data are likely to be referenced in the near feature (Time)
• Spatial Locality
o Item with nearby addresses tend to be referenced more often with high probability (location)
int sum = 0;
for(i =0 to 100; i++) {
sum += a[i];
}
Where,
Array of elements in succession - Spatial - location
Sum value in iteration - Temporal - time
• Processor is the Master in Computer system
• Memory and I/O are Slaves
• Processor is much faster compare to Memory, ie., Memory access is slower than CPU cycles
• DRAM has an access time of 30-50ns
o Further system may need 3x longer or more time to get data from Memory to CPU
• Accessing the Fastest Process to Slowest Memory, processor has to wait until memory completes the job
• It reduces the Processor Utilization
• Locality of reference increases small amount of speed access in memory
• But still Speed between CPU and Memory is widen
• To Increase the Processor Utilization with Memory, Memory has been spliced into multiple chunks (Fastest, medium fast, slower)
• As per factors of memory, if Speed increases Cost will get increase and size get reduced and so on
• Fast storage technology costs more and have less capacity
• Arrange the different layers (chunks) is called Memory Hierarchy
• Approach of organizing memory and storage system is called Memory Hierarchy
o To achieve Higher performance
o To get the Highest possible access speed and minimize the cost of Memory
• Processor first interact with Fastest Memory, if data not found interact with medium and slowest …
• CPU always access fastest memory
• CACHE is the Fastest memory (SRAM)
o Used to Store data temporarily and access quickly
• DRAM behaves Medium speed Memory also called Main Memory
• Slow Memory
o Storage purpose memory (Tape, disk …)
• Main Memory stores data and program during operations
• CPU Registers holds words retrieved from CACHE
• CACHE holds CACHE lines retrieved from Main Memory
• Main Memory holds disk blocks retrieved from Disk
• Disks holds files from Tapes / remote Network servers
• CPU First access Registers to get Data, if not copy data from CACHE to Registers, then Main memory to Cache to Registers and so on
• CPU always retrieve data from Registers
• Smaller memories are Faster but expensive (Performance increases)
• Larger memories are Slower but cost effective
Relationship between Memory Levels
Access Time is closer to CPU is lesser than far from CPU
Cost per byte is closer to CPU is greater than far from CPU
Memory size is closer to CPU is lesser than far from CPU
Transfer Bandwidth is closer to CPU is greater than far from CPU
Unit of Transfer is closer to CPU is lesser than far from CPU
Frequency of access is closer to CPU is greater than far from CPU
Properties of Memory Levels
• Inclusion:
o Any data part of lower level has to be present in the higher level
• Coherence (Consistency):
o Multiple copies of same data are available at each level, all copies needs to be identical
• Locality of Reference:
o Temporal: will be used in the near feature (Time)
o Spatial: Adjacent data are likely to be used often (location)
o Sequential: Execution of instructions