(b) Compare and contrast the different memory technologies (SRAM, DRAM, Flash an
ID: 3729017 • Letter: #
Question
(b) Compare and contrast the different memory technologies (SRAM, DRAM, Flash and magnetic disk) used in a memory hierarchy with respect to cost, size, access ime and power consumption (c) Explain the concept of locality of reference by providing examples and state its importance to memory systems. (d) Assume that both the arrays (A & B) are of same size and are stored contiguously. I and N are scalar variables. In the code identify variables which exhibit temporal locality and variables which exhibit spatial locality. Provide justification for your answer to get full credit. for (I-0; 1 n; I++)Explanation / Answer
As per your requirement the below one is solution please follow it
(B)
SRAM and DRAM are the type of Random Access Memory or RAM. which is known as Static Random Access Memory (SRAM) and Dynamic Random Access Memory (DRAM).
SRAM and DRAM holds data but in a different ways.
SRAM (Static Random Access Memory):-
The term static specify that the memory keep as content as long as power remain applied. SRAM does not need to be refreshed as the transistors inside would continue to hold the data SRAM chips use a matrix of 6 transistor and no capacitor.Transistors do not require power to check leakage, so SRAM need not have to be refreshed on a regular basis.SRAMis used as cache memory require to be very fast and small.SRAM uses more chips than DRAM for the same amount of storage space, that's why making the manufacturing costs higher.SRAM modules are also much simpler compared to DRAM, which makes it easier for most people to create an interface to access the memory. SRAM memory is still used in a lot of devices where speed is more critical than capacity. The most important use of SRAM is in the cache memory of processors where speed is very important.
SRAM is faster,consume less power and more expensive compared to DRAM.
Dynamic Random Access Memory (DRAM) :
DRAM requires the data to be refreshed periodically in order to hold the data.This is done by putting the memory on a refresh circuit that rewrites the data various hundred times per second.DRAM is used for most system memory space because it is lo-cost and small. Dynamic random access memory deploy one transistor to store data on one capacitor.but that capacitor will lose the data as it loses its charge unless the capacitor is periodically recharged.recharging of the capacitors is the cause the word dynamic is used in dynamic random access memory.DRAM are create up of memory cells. These cells are collected of one capacitor and one transistor.DRAM module only needs a transistor and a capacitor for every bit of data where SRAM needs 6 transistors. Because the number of transistors in a memory module determine its capacity.DRAM module can have almost 6 times more capacity with a similar transistor count to an SRAM module.Because of its lower price, DRAM has become the common in computer main memory.
Flash disk
Flash disk is a data storage device in a computer that uses flash memory chips that can remain data perfect even when they are provide with no power. These chips can be permanently embedded in the computer’s motherboard.
flash disk is a portably type of flash memory device. It includes a printed circuit, a flash chip and a USB connector.These components are protected inside it.The main use of flash drives is not for long term storage, but rather short term storage and data transfer. Flash drives, compared to old disk and CD-ROMs, are faster and has more storage capacity.
before flash drives were only capable of holding data up to 2GB, but with recent technological advances flash drives are able to hold up 256GB, and drives up to 2TB are under development.Flash drives use minimal power to transfer files.Flsh disk is very expensive to buy it.
Magnetic Disk
Magnetic Disk is a storage device in a computer.it does not ‘go away’ even when the computer is switched off, the way system memory does. It stores data by means of the use of spinning metal platters.
A magnetic disk contains one or more hard speedly rotating discs coated with magnetic material. Magnetic heads are placed on a moving actuator that is used to read/write data on the magnetic tape. The read/write heads are supported on a thin layer of air inside the enclosed disk unit with only tiny gaps between the heads and the disk surface.A hard disk is similar to old cassette tapes, which also recorded data on a magnetic tape, though these have a much higher storage capacity
magnetic disk are also considered a safe option compared to flash drivers, as they are less susceptible to viruses and are available with firewalls.
Compare Flash and magnetic disk:
Flash disk such as SSD (solid state drives) are far more expensive than magnetic disk
Both Flash and magnetic disk do the same job.They boot your system, and store your applications and personal files. But each type of storage has its own unique feature set.
using Flash disk PC will boot in less than a minute, and often in just seconds. A hard drive requires time to speed up to operating system.
Devices that run on flash memory execute faster than those that run on hard drives.
magnetic disk can have larger memory capacity than flash disk.
Flash disk do not require a power source for memory storage while magnetic devices do.
(C)
In computer science, locality of reference, also known as the principle of locality, is a phenomenon describing the same value, or related storage locations, being frequently accessed. There are two basic types of reference locality. Temporal locality, refers to the reuse of specific data, and/or resources, within a relatively small time duration. Spatial locality, refers to the use of data elements within relatively close storage locations. Sequential locality, a special case of spatial locality, occurs when data elements are arranged and accessed linearly, such as, traversing the elements in a one-dimensional array.
Locality is merely one type of predictablebehavior that occurs in computer systems. Systems that exhibit strong locality of referenceare great candidates for performance optimization through the use of techniques such as the cache, instruction prefetch technology for memory, or the advanced branch predictor at the pipeliningof processors.
There are several different types of locality of reference:
Temporal locality
If at one point in time a particular memory location is referenced, then it is likely that the same location will be referenced again in the near future. There is a temporal proximity between the adjacent references to the same memory location. In this case it is common to make efforts to store a copy of the referenced data in special memory storage, which can be accessed faster. Temporal locality is a special case of the spatial locality, namely when the prospective location is identical to the present location.
Spatial locality
If a particular memory location is referenced at a particular time, then it is likely that nearby memory locations will be referenced in the near future. In this case it is common to attempt to guess the size and shape of the area around the current reference for which it is worthwhile to prepare faster access.
Branch locality
If there are only few amount of possible alternatives for the prospective part of the path in the spatial-temporal coordinate space. This is the case when an instruction loop has a simple structure, or the possible outcome of a small system of conditional branching instructions is restricted to a small set of possibilities. Branch locality is typically not a spatial locality since the few possibilities can be located far away from each other.
Equidistant locality
It is halfway between the spatial locality and the branch locality. Consider a loop accessing locations in an equidistant pattern, i.e. the path in the spatial-temporal coordinate space is a dotted line. In this case, a simple linear function can predict which location will be accessed in the near future.
In order to benefit from the very frequently occurring temporal and spatial kind of locality, most of the information storage systems are hierarchical; see below. The equidistant locality is usually supported by the diverse nontrivial increment instructions of the processors. For the case of branch locality, the contemporary processors have sophisticated branch predictors, and on the base of this prediction the memory manager of the processor tries to collect and preprocess the data of the plausible alternatives.
(D)
Temporal locality
As in the above code the value of I and N will be accessed again and agian on each iteration. So the variables I and N will be stored likely in temoral locality. because the processor will assume, correctly, that is a piece of data is accessed, it will likely be accessed again very soon. B[0] will also accessed again and again so it will also be the part of temporal locality variables.
spatial locality:
Spatial locality in the way in which processor will store the data in cache before required so that execution will be fast. This is why when one piece of data is needed, the processor will also load the entire block with data that is next to the data we just accessed. So processor will keep record of A[i] for the next iterator before the requirement.
Lets say if i =0 then processor will store A[1] also in the cache prior so that when required it will access easily.
So i;j and A[i] will be the part of spatial locality
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.