Classifications of Locality of References Principles Flashcards
What is principality of locality
Principle of locality or locality of reference is the tendency of a processor to access the same set of memory locations repetively over a short period of time
Types of locality
Temporal locality: Here a resource that is referenced at one point in time is referenced again soon afterwards
Spatial Locality: Here the likelihood of referencing a storage location is greater if a storage location near it has been recently refereence
Sequential Locality: Here storage is accessed sequentially, in descending or ascending order. This leads to memory hierachy
What is memory hierarchy
Memory hierarchy is a structure that uses multiple levels of memories; as the distance from the CPU increases, the size of the memories and the access time both increases.
The faster
Main memory is implemented from?
It is implemented from Dynamic Random Access Memory(DRAM)
The level closer to the processor(caches) uses ?
SRAM
Mention the levels in memory hierachy
CPU Registers
Static Random Access Memory
Main Memory
Local Disk
Remote Secondary Storage
Describe CPU Registers
They are at the top most level of this hierarchy, the hold the most frequently used data.
The are very limited in number and are the fasters
They are often used by the CPU and the ALU for performing arithmetic and logical opertions, for temporary storage of data.
What are registers
A register is a digital circuit with two basic functions: data storage and data movement.
Types of registers
Parallel and serial registers
Different manner:
Serial-in/Serial-out
Parallel-in/serial-out
Serial - in / pararell-out
Universal parallel-in/ parallel out
Describe SRAM
SRAM is a type of RAM that holds data in a static form, that is, as long as the memory has power.
SRAM stores a bit of data on four transistors using tow cross-coupled inverters.
What is Main Memory or DRAM
Dynamic random access is a type of memory that is typically used for data or program code that a computer processor needs to function.
Pro of DRAM
Simple design, speed and low cost in comparison to other types
Con of DRAM
Volatility and high power consumption
Describe Local Disks
A local drive is a computer disk drive that is installed directly within the host or the local computer
Describe Remote Secondary Storage
This includes Distrubuted File System(DFS) and online storage like cloud.
The storage area is vast with low cost but larger access time.
Differences between SRAM and DRAM
SRAM stores data till power is supplied while DRAM stored data only for few miliseconds irrespective of the power supply.
Uses nearly 6 transistors for each memory cell. Uses single transistor and capacitor for each memory cell.
Do not referesh the memory cell. Refereshing circuiting is need
Faster data access. Slower access
Consume more power. Low power consumption.
Cost per bit is high. Comparatively lower cost
How does data transfer between level work
Through blocks
What is block
The minimum unit of information that can be either present or absent
What is a memory unit
It is a collection of semi-conductor storage cells with circuits to access the data stored in them.
The data stored in memory is done with words
Why memory hierarchy
Fast storage techs cost more per byte and have less capacity
Gap betwen CPU and main memory speed is widening
Well written programs tend to exhibit good locality
Elements of memory
Processor Memory: Present inside the CPU for high spped data access. This consist of small set of registers that act as temporary storage.
Primary Memory: Directly accessed by the CPU. All data must be brought inside the main memory before accessing them.
Secondary memory: This is the cheapest, larage and relatively slow memory component. The data from the secondary memory is accessed by the CPU only after it is loaded to main memory.
What trade off among memory
Cost
Capacity
Access time
What is hit
If the requested data is found in the upper levels of memory hierarchy
What is miss
If the requested data is not found in the upper levels of memory hierarchy
What is hit ration
It is the fraction of memory access found in the upper level.
Formula for hit ration
Hit Ratio = Hit/(Hit+Miss)
Formula Miss rate
1 - hit rate
What is hit time
The time requried for accessing a level of memory hierarchy, including the time needed for finding whether the memory access is a hit or a miss
What is miss penalty
The time required for fetching a block into a level of the memory hierarchy from the lower level, including the time to access, transmit , insert it to new level and pass the block to the requestor
What is bandwidtg
The data transfer rate by the memory
What is Latency or access time
Memory Latency is the length of time between the memory reciept of a read request and its release of data corresponding with the request.
What is cycle time
It is the minimum time betwen requests to memory