COMPUTER MEMORY SYSTEM Flashcards

1
Q

What is a computer memory?

A

Computer memory refers to the electronic holding place for instructions and data where the processor can read quickly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe and illustrate the memory hierarchy

A
  • The memory is characterized on the basis of two key factors; capacity and access time.
  • The lesser the access time, the faster is the speed of memory
  • The computer uses a hierarchy of memory that is organized in a manner to enable the fastest speed and largest capacity of memory as shown in figure.

*See notes for pic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe each of the 5 parameters of memory

A
  • Storage Capacity: It is representative of the size of the memory.
  • The capacity of internal memory and main memory can be expressed in terms of number of words or bytes.
  • Access Modes: A memory is comprised of various memory locations.
  • The information from these memory locations can be accessed randomly, sequentially and directly.
  • Access Time: The access time is the time required between the desired modes for a read or write operation till the data is made available or written at the desired location.
  • Physical Characteristics: In this respect. the devices can be categorized into four main categories: electronic, magnetic, mechanical and optical.
  • Permanence of Storage: Its permanence is high for future use in magnetic materials.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two main categories of the memory

A

1.Primary Memory(Main Memory)
• The memory unit that communicates directly with the CPU is called main memory.
• The primary memory allows the computer to store data for immediate manipulation and to keep track of what is currently being processed.
• It is volatile in nature (biased to RAM), it means that when the power is turned off, the contents of the primary memory are lost forever.
• Divided into RAM and ROM

2.Secondary Memory (Auxiliary Memory/Storage
Devices)
• The secondary memory stores much larger amounts of data and information for extended periods of time.
• Data in secondary memory cannot be processed directly by the CPU, it must first be copied into primary storage i.e…, RAM.
• Secondary storage is used to store data and programs when they are not being processed.
• It is also non-volatile in nature.
• Due to this, the data remain in the secondary storage as long as it is not overwritten or deleted by the user.
• It is a permanent storage i.e., device.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Briefly describe RAM

A

It is also known as read/write memory, that allows CPU to read as well as write data and instructions into it.
• RAM is used for the temporary storage of input data, output data and intermediate results.
• RAM is a microchip implemented using semiconductors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the two categories of RAM

A

i. Dynamic RAM (DRAM) It is made up of memory cells where each cell is composed of one capacitor and one transistor. DRAM must be refreshed continually to store information.
• The refresh operation occurs automatically thousands of times per second DRAM is slower, less-expensive and occupies less space on the computer’s motherboard.

ii. Static RAM (SRAM) It retains the data as long as power is provided to the memory chip.
• It needs not be ‘refreshed’ periodically. SRAM uses multiple transistors for each memory cell. It does not use capacitor.
• SRAM is often used as cache memory d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is EDO DRAM

A

Extended Data Output Dynamic RAM (EDO DRAM) It is a type of RAM chip.
• It is used to improve the time to read content from memory and enhance the method of access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe ROM

A
  • It is also known as non-volatile memory or permanent storage.
  • It does not lose its content when the power is switched off.
  • ROM has only read capability, no write capability.
  • ROM can have data and instructions written to it only one time.
  • Once a ROM chip is programmed at the time of manufacturing, it cannot be reprogrammed or rewritten.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the categories of ROM

A

a. Programmable ROM (PROM) It is also non-volatile in nature. Once a PROM has been programmed, its contents can never be changed. It is a one-time programmable device. PROMs are manufactured blank and can be programmed at buffer, Final test or in system.
• These type of memories are found in video game consoles, mobile phones, implantable medical devices and high definition multimedia interfaces.
b. Erasable Programmable ROM (EPROM) It is similar to PROM, but it can be erased by exposure to strong ultraviolet light, then rewritten. So, it is also known as Ultraviolet Erasable Programmable ROM (UV EPROM).
c. Electrically Erasable Programmable ROM (EEPROM) It is similar to EPROM, but it can be erased electrically, then rewritten electrically and the burning process is reversible by exposure to electric pulses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the cache memory

A

(THIS IS ALSO SOMETIMES VIEWED AS A MAJOR TYPE OF MEMORY ON ITS OWN)
(Therefore having cache memory, primary/main memory and secondary memory)
• A CPU hardware cache is a smaller memory, located closer to the processor, that stores recently referenced data or instructions so that they can be quickly retrieved if needed again.
• By reducing costly reads and writes that access the slower main memory, caching has an enormous impact on the performance of a CPU.
• Cache memory is very expensive, so it is smaller in size.
• Generally. computers have cache memory of sizes 256 KB to 2 MB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List some other memories affiliated with the main memory

A

• Flash Memory is a kind of semiconductor-based nonvolatile rewritable memory used in digital camera, mobile phone. Printer.
etc.
• Virtual Memory is a technique that allows the execution of processes that are not completely in main memory.
• One major advantage of this scheme is that programs can be larger than main memory.
• This technique frees programmers from the concerns of memory storage limitations.
• Buffer is a temporary physical storage used to hold data during execution of process from one place to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

List some examples of Secondary memory devices

A
  • Magnetic disks - Hard Disk Drive, Floppy Disk, Memory Stick
  • Optical Disk – CD, DVD, Blue-ray disk
  • Solid State Disks - Pen/Flash Drive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some of the ways in which the cache has been improved

A

The first caches were off-chip, or external.
• These were soon replaced by on-chip cache memories typically made from SRAM.
• To improve performance further, these on-chip caches were split into instruction and data partitions.
• Cache partitions led to the birth of multi-level cache hierarchies
• Where processor cores would have their own small, private cache (L1) that sat above a larger shared cache (L2), with some processors including a third cache level (L3) and occasionally a fourth (L4).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the principle of locality of reference and how does it relate to caching

A
  • Caching works via the principle of locality of reference.
  • Locality of reference refers to the tendency of a processor to access the same memory locations as it runs an application.
  • Because these memory accesses are predictable, they can be exploited via caching
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the subsets of locality

A
  • Locality is typically divided into two subsets—temporal locality and spatial locality—and sometimes a third, known as algorithmic locality.
  • Temporal locality refers to the reuse of specific data items within a short time frame
  • Spatial locality refers to the tendency of data items that will be needed soon to reside in memory locations near or adjacent to items that are needed now.
  • Algorithmic locality is the tendency of applications to perform operations on related data items though not in any short time period and despite the fact that the items are not near each other in memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  • A cache may be organized such that:
  • In one case, there are more data elements per block and fewer blocks
  • In another case, there are fewer elements per block but more blocks
  • However, in both cases – i.e. larger blocks but fewer of them OR shorter blocks, but more of them – the cache’s total capacity (amount of data storage) remains the same.
  • What are the pros and cons of each organization? Support your answer with a short example assuming that the cache is direct mapped.
A

Advantages of Bigger Blocks
——————————————————————–
•Using bigger blocks means more data transfer per I/O call. So faster data transfer from disk to memory.

  • Using bigger blocks means more space for key storage in the branch nodes of B*-tree indexes, which reduces index height, which improves the performance of indexed queries.
  • When using large block there are less probability of chained and migrated rows, which in turn reduced the number of reads required to get the information.

Disadvantages of bigger Blocks
———————————————————————-
•If the rows are predominated random then you are increasing the possibility of contention in the buffer cache. Because now with same same amount of memory in buffer cache as it was in small blocks, we need more memory in the buffer cache to keep the same amount of buffers in memory in the buffer cache.

•If you have high transactional concurrency to a segment, using bigger blocks is just going to make the concurrency even higher.

Small Block
The advantage of small blocks are they reduce block contention and they are really good where there is small rows or the selectivity of rows are highly random.

The disadvantages of small blocks are they have relatively larger overhead.

17
Q

What is the difference between caches and virtual memories

A

1Objective
Cache memory increase CPU access speed. Virtual memory increase main memory capacity.
2Memory Unit
Cache memory is a memory unit and is very fast to access. Virtual memory is a technique and involves hard disk and is slower to access.
3 Management
CPU and related hardwares manages cache memory. Operating System manages virtual memory.
4 Size
Cache memory is small in size. Size of virtual memory is much larger than cache memory.
5 Operation
Cache memory keeps recently used data. Virtual memory keeps the programs which are not getting accommodated in main memory.

18
Q

Describe cache size and performance

A

There are several motivations for minimizing the cache size. The larger the cache, the greater the number of gates involved in addressing the cache is needed. The result is that larger caches end up being slightly slower than small ones. The available chip and board area also limits cache size.

19
Q

Describe direct mapping

A

This is the simplest form of mapping. One block from main memory maps into only one possible line of cache memory. As there are more blocks of main memory than there are lines of cache, many blocks in main memory can map to the same line in cache memory.

To implement this function, use the following formula:

α = β % γ

where α is the cache line number, β is the block number in main memory, γ is the total number of lines in cache memory and % being the modulus operator.

20
Q

What is the disadvantage of direct mapping

A

The main disadvantage of using this type of mapping is that there is a fixed cache location for any given block in main memory. If two blocks of memory sharing the same cache line are being continually referenced, cache misses would occur and these two blocks would continuously be swapped, resulting in slower memory access due to the time taken to access main memory (or the next level of memory).

21
Q

Describe associative mapping

A

This type of mapping overcomes the disadvantage of direct mapping by permitting each main memory block to be loaded into any line of cache. To do so, the cache control logic interprets a memory address as a tag and a word field. The tag uniquely identifies a block in main memory. The primary disadvantage of this method is that to find out whether a particular block is in cache, all cache lines would have to be examined. Using this method, replacement algorithms are required to maximize its potential.

22
Q

Describe Set Associative mapping

A

This type of mapping is designed to utilize the strengths of the previous two mappings, while minimizing the disadvantages. The cache is divided into a number of sets containing an equal number of lines. Each block in main memory maps into one set in cache memory similar to that of direct mapping. Within the set, the cache acts as associative mapping where a block can occupy any line within that set. Replacement algorithms may be used within the set.

23
Q

List the four most common replacement algorithms

A

For associative and set associative mapping, however, an algorithm is needed. For maximum speed, this algorithm is implemented in the hardware.

  1. least recently used This replaces the candidate line in cache memory that has been there the longest with no reference to it.
  2. first in first out This replaces the candidate line in the cache that has been there the longest.
  3. least frequently used This replaces the candidate line in the cache that has had the fewest references.
  4. random replacement This algorithm randomly chooses a line to be replaced from among the candidate lines. Studies have shown that this yields only slightly inferior performance than other algorithms.
24
Q

Explain the differences between L1 and L2 cache

A

L1 has a smaller memory capacity than L2. Also, L1 can be accessed faster than L2. L1 is usually in-built to the chip, while L2 is soldered on the motherboard very close to the ch