Memory organization 1 - 5 Flashcards

- memory and memory units - memory hierarchy design and characteristics -byte and world addressable memory - simultaneous and hierarchical access memory organization - Register allocations in code generation

1
Q

Memory devices are digital system that store data either temporarily or for a long term. Digital computers to hard disk have built in memory devices that can store data of user or manufacturers. The data either be in the form of control programs or programs that boot the system. Hence, to store such huge amount of data the memory devices must have enormous capacity. The challenge is to build memory devices that have large capacity but cost effective. The memory devices must be capable of storing both permanent data and instantaneous data.

A

Memories are made up of registers. Each register in the memory is one storage location. The storage location is also called a memory location. Memory locations are identified using Address. The total number of bits a memory can store is its capacity.

A storage element is called a Cell. Each register is made up of a storage element in which one bit of data is stored. The data in a memory are stored and retrieved by the process called writing and reading respectively.

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

word

A

a group of bits where a memory unit stores binary information. A word with a group of 8 bits is called a byte.
A memory unit consists of data lines, address selection lines, and control lines that specify the direction of transfer.

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

bit (binary units)

A

bit is a logical representation of the electric state. It can be 1 or 0.

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

nibble

A

it means the group of 4 bits.

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

byte

A

a byte is a group of 8 bits.

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

Kilobyte (kb): 1kb = 1024 byte

Megabyte (mb): 1mb = 1024 kb

Gigabyte (gb): 1gb = 1024 mb

A

Terabyte (tb): 1tb = 1024 gb

Petabyte (pb): 1pb = 1024 tb

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

Byte addressable memory

A

When the data space in the cell = 8 bits then the corresponding address space is called as Byte Address.

Based on this data storage i.e. Bytewise storage, the memory chip configuration is named as Byte Addressable Memory.

For eg. : 64K X 8 chip has 16 bit Address and cell size = 8 bits (1 Byte) which means that in this chip, data is stored byte by byte.

It is suitable for the processes that require data comprising single byte at a time. A single address is issued for accessing a single byte in byte addressable memory.

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

Byte addressable memory

A

When the data space in the cell = 8 bits then the corresponding address space is called as Byte Address.

Based on this data storage i.e. Bytewise storage, the memory chip configuration is named as Byte Addressable Memory.

For eg. : 64K X 8 chip has 16 bit Address and cell size = 8 bits (1 Byte) which means that in this chip, data is stored byte by byte.

It is suitable for the processes that require data comprising single byte at a time. A single address is issued for accessing a single byte in byte addressable memory.

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

Word addressable memory

A

When the data space in the cell = word length of CPU then the corresponding address space is called as Word Address.

Based on this data storage i.e. Wordwise storage, the memory chip configuration is named as Word Addressable Memory.

For eg. : For a 16-bit CPU, 64K X 16 chip has 16 bit Address & cell size = 16 bits (Word Length of CPU) which means that in this chip, data is stored word by word.

In case of word addressable memory, the necessary condition involves computing the address of word that contains required byte, fetch that word and then extraction of needed byte from the two byte word takes place. So, it is indirectly accessible. Hence, modern machines are byte addressable.

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

registers

A

fastest locations in the memory hierarchy. But unfortunately, this resource is limited. It comes under the most constrained resources of the target processor. Register allocation is an NP-complete problem. However, this problem can be reduced to graph coloring to achieve allocation and assignment. Therefore a good register allocator computes an effective approximate solution to a hard problem.

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

Allocation

A

Maps an unlimited namespace onto that register set of the target machine.

Reg. to Reg. Model: Maps virtual registers to physical registers but spills excess amount to memory.

Mem. to Mem. Model: Maps some subset of the memory location to a set of names that models the physical register set.

Allocation ensures that code will fit the target machine’s reg. set at each instruction.

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

Assignment

A

Maps an allocated name set to the physical register set of the target machine.

Assumes allocation has been done so that code will fit into the set of physical registers.

No more than ‘k’ values are designated into the registers, where ‘k’ is the no. of physical registers.

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

General register allocation is an NP-complete problem

A

Solved in polynomial time, when (no. of required registers) <= (no. of available physical registers).

An assignment can be produced in linear time using Interval-Graph Coloring.

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

Local register allocation and assignment

A

Allocation just inside a basic block is called Local Reg. Allocation. Two approaches for local reg. allocation: Top-down approach and bottom-up approach.

Top-Down Approach is a simple approach based on ‘Frequency Count’. Identify the values which should be kept in registers and which should be kept in memory.

Algorithm:

Compute a priority for each virtual register.
Sort the registers into priority order.
Assign registers in priority order.
Rewrite the code.

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

beyond single Blocks

A

More complicated because the control flow enters the picture.

Liveness and Live Ranges: Live ranges consist of a set of definitions and uses that are related to each other as they i.e. no single register can be common in a such couple of instruction/data.

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

Memory organisation:
Simultaneous Access Memory Organisation

A

In this organisation, CPU is directly connected to all the levels of Memory.

CPU accesses the data from all levels of Memory simultaneously.

For any “miss” encountered in L1 memory, CPU can directly access data from higher memory levels
(i.e. L2, L3, …..Ln).

If H1 and H2 are the Hit Ratios and T1 and T2 are the access time of L1 and L2 memory levels respectively then the
Average Memory Access Time can be calculated as:
T=(H1T1)+((1-H1)H2*T2

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

Memory organisation:
Hierarchical Access Memory Organisation

A

In this organisation, CPU is always directly connected to L1
i.e. Level-1 Memory only.

CPU always accesses the data from Level-1 Memory.

For any “miss” encountered in L1 memory, CPU cannot directly access data from higher memory levels(i.e. L2, L3, …..Ln). First the desired data will be transferred from higher memory levels to L1 memory.
Only then it can be accessed by the CPU.

If H1 and H2 are the Hit Ratios and T1 and T2 are the access time of L1 and L2 memory levels respectively then the
Average Memory Access Time can be calculated as:
T=(H1T1)+((1-H1)H2*(T1+T2)

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

Computer system design:
Memory hierarchy

A

an enhancement to organize the memory such that it can minimize the access time. The Memory Hierarchy was developed based on a program behavior known as locality of references.

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

Why Memory Hierarchy is Required in the System?

A

Memory Hierarchy is one of the most required things in Computer Memory as it helps in optimizing the memory available in the computer. There are multiple levels present in the memory, each one having a different size, different cost, etc. Some types of memory like cache, and main memory are faster as compared to other types of memory but they are having a little less size and are also costly whereas some memory has a little higher storage value, but they are a little slower. Accessing of data is not similar in all types of memory, some have faster access whereas some have slower access.

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

Memory hierarchy:
External Memory or Secondary Memory

A

Comprising of Magnetic Disk, Optical Disk, and Magnetic Tape i.e. peripheral storage devices which are accessible by the processor via an I/O Module.

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

Memory hierarchy:
Internal Memory or Primary Memory

A

Comprising of Main Memory, Cache Memory & CPU registers. This is directly accessible by the processor.

21
Q

Memory Hierarchy Design:
Registers

A

Registers are small, high-speed memory units located in the CPU. They are used to store the most frequently used data and instructions. Registers have the fastest access time and the smallest storage capacity, typically ranging from 16 to 64 bits.

22
Q

Memory hierarchy design:
Cache memory

A

Cache memory is a small, fast memory unit located close to the CPU. It stores frequently used data and instructions that have been recently accessed from the main memory. Cache memory is designed to minimize the time it takes to access data by providing the CPU with quick access to frequently used data.

23
Q

Memory hierarchy design:
main memory

A

also known as RAM (Random Access Memory), is the primary memory of a computer system. It has a larger storage capacity than cache memory, but it is slower. Main memory is used to store data and instructions that are currently in use by the CPU.

Types of Main Memory

Static RAM: Static RAM stores the binary information in flip flops and information remains valid until power is supplied. It has a faster access time and is used in implementing cache memory.

Dynamic RAM: It stores the binary information as a charge on the capacitor. It requires refreshing circuitry to maintain the charge on the capacitors after a few milliseconds. It contains more memory cells per unit area as compared to SRAM.

24
Q

Memory hierarchy design:
secondary storage

A

Secondary storage, such as hard disk drives (HDD) and solid-state drives (SSD), is a non-volatile memory unit that has a larger storage capacity than main memory. It is used to store data and instructions that are not currently in use by the CPU. Secondary storage has the slowest access time and is typically the least expensive type of memory in the memory hierarchy.

25
Q

Memory hierarchy design:
magnetic disk

A

Magnetic Disks are simply circular plates that are fabricated with either a metal or a plastic or a magnetized material. The Magnetic disks work at a high speed inside the computer and these are frequently used.

26
Q

Memory hierarchy design:
Magnetic tape

A

Magnetic Tape is simply a magnetic recording device that is covered with a plastic film. It is generally used for the backup of data. In the case of a magnetic tape, the access time for a computer is a little slower and therefore, it requires some amount of time for accessing the strip.

27
Q

Characteristics of memory hierarchy

A

Capacity: It is the global volume of information the memory can store. As we move from top to bottom in the Hierarchy, the capacity increases.

Access Time: It is the time interval between the read/write request and the availability of the data. As we move from top to bottom in the Hierarchy, the access time increases.

Performance: Earlier when the computer system was designed without a Memory Hierarchy design, the speed gap increased between the CPU registers and Main Memory due to a large difference in access time. This results in lower performance of the system and thus, enhancement was required. This enhancement was made in the form of Memory Hierarchy Design because of which the performance of the system increases. One of the most significant ways to increase system performance is minimizing how far down the memory hierarchy one has to go to manipulate data.

Cost Per Bit: As we move from bottom to top in the Hierarchy, the cost per bit increases i.e. Internal Memory is costlier than External Memory.

28
Q

Advantages of memory hierarchy

A

It helps in removing some destruction, and managing the memory in a better way.

It helps in spreading the data all over the computer system.

It saves the consumer’s price and time.

29
Q

what is memory?

A

Computer memory is just like the human brain. It is used to store data/information and instructions. It is a data storage unit or a data storage device where data is to be processed and instructions required for processing are stored. It can store both the input and output can be stored here.

30
Q

Characteristics of main memory

A

It is faster computer memory as compare to secondary memory.
It is semiconductor memories.
It is usually a volatile memory.
It is the main memory of the computer.
A computer system cannot run without primary memory.

31
Q

Primary memory

A

It is also known as the main memory of the computer system. It is used to store data and programs or instructions during computer operations. It uses semiconductor technology and hence is commonly called semiconductor memory. Primary memory is of two types:

32
Q

Primary memory:
Ram (Random Access Memory)

A

It is a volatile memory. Volatile memory stores information based on the power supply. If the power supply fails/ interrupted/stopped, all the data & information on this memory will be lost. RAM is used for booting up or start the computer. It temporarily stores programs/ data which has to be executed by the processor.

33
Q

Primary memory:
Ram (Random Access Memory)-
S RAM (Static RAM)

A

It uses transistors and the circuits of this memory are capable of retaining their state as long as the power is applied. This memory consists of the number of flip flops with each flip flop storing 1 bit. It has less access time and hence, it is faster.

34
Q

Primary memory:
Ram (Random Access Memory)-
D RAM (Dynamic RAM)

A

It uses capacitors and transistors and stores the data as a charge on the capacitors. They contain thousands of memory cells. It needs refreshing of charge on capacitor after a few milliseconds. This memory is slower than S RAM.

35
Q

Primary memory:
ROM (Read Only Memory)

A

It is a non-volatile memory. Non-volatile memory stores information even when there is a power supply failed/ interrupted/stopped. ROM is used to store information that is used to operate the system. As its name refers to read-only memory, we can only read the programs and data that is stored on it. It contains some electronic fuses that can be programmed for a piece of specific information. The information stored in the ROM in binary format. It is also known as permanent memory.

36
Q

Primary memory:
ROM (Read Only Memory)-
MROM (Masked ROM)

A

Hard-wired devices with a pre-programmed collection of data or instructions were the first ROMs. Masked ROMs are a type of low-cost ROM that works in this way.

37
Q

Primary memory:
ROM (Read Only Memory)-
PROM (Programmable Read Only Memory)

A

This read-only memory is modifiable once by the user. The user purchases a blank PROM and uses a PROM program to put the required contents into the PROM. Its content can’t be erased once written.

38
Q

Primary memory:
ROM (Read Only Memory)-
EPROM (Erasable Programmable Read Only Memory)

A

It is an extension to PROM where you can erase the content of ROM by exposing it to Ultraviolet rays for nearly 40 minutes.

39
Q

Primary memory:
ROM (Read Only Memory)-
EEPROM (Electrically Erasable Programmable Read Only Memory)

A

Here the written contents can be erased electrically. You can delete and reprogramme EEPROM up to 10,000 times. Erasing and programming take very little time, i.e., nearly 4 -10 ms(milliseconds). Any area in an EEPROM can be wiped and programmed selectively.

40
Q

Secondary memory

A

It is also known as auxiliary memory and backup memory. It is a non-volatile memory and used to store a large amount of data or information. The data or information stored in secondary memory is permanent, and it is slower than primary memory. A CPU cannot access secondary memory directly. The data/information from the auxiliary memory is first transferred to the main memory, and then the CPU can access it.

41
Q

Characteristics of Secondary memory

A

It is a slow memory but reusable.
It is a reliable and non-volatile memory.
It is cheaper than primary memory.
The storage capacity of secondary memory is large.
A computer system can run without secondary memory.
In secondary memory, data is stored permanently even when the power is off.

42
Q

Secondary memory:
Magnetic tapes

A

Magnetic tape is a long, narrow strip of plastic film with a thin, magnetic coating on it that is used for magnetic recording. Bits are recorded on tape as magnetic patches called RECORDS that run along many tracks. Typically, 7 or 9 bits are recorded concurrently. Each track has one read/write head, which allows data to be recorded and read as a sequence of characters. It can be stopped, started moving forward or backward, or rewound.

43
Q

Secondary memory:
magnetic disks

A

A magnetic disc is a circular metal or a plastic plate and these plates are coated with magnetic material. The disc is used on both sides. Bits are stored in magnetized surfaces in locations called tracks that run in concentric rings. Sectors are typically used to break tracks into pieces.

44
Q

Secondary memory:
Optical disks

A

It’s a laser-based storage medium that can be written to and read. It is reasonably priced and has a long lifespan. The optical disc can be taken out of the computer by occasional users.

45
Q

Secondary memory:
Optical disks-
CD-ROM

A

It’s called Compact Disk. Only read from memory.
Information is written to the disc by using a controlled laser beam to burn pits on the disc surface.
It has a highly reflecting surface, which is usually aluminum.
The diameter of the disc is 5.25 inches.
16000 tracks per inch is the track density.
The capacity of a CD-ROM is 600 MB, with each sector storing 2048 bytes of data.
The data transfer rate is about 4800KB/sec. & the new access time is around 80 milliseconds.

46
Q

Secondary memory:
Optical disks-
WORM- (Write Only Read Many)

A

A user can only write data once.
The information is written on the disc using a laser beam.
It is possible to read the written data as many times as desired.
They keep lasting records of information but access time is high.
It is possible to rewrite updated or new data to another part of the disc.
Data that has already been written cannot be changed.
Usual size – 5.25 inch or 3.5 inch diameter.
The usual capacity of 5.25 inch disk is 650 MB,5.2GB etc.

47
Q

Secondary memory:
Optical disks-
DVD

A

The term “DVD” stands for “Digital Versatile/Video Disc,” and there are two sorts of DVDs: (i)DVDR (writable) and (ii) DVDRW (Re-Writable)
DVD-ROMS (Digital Versatile Discs): These are read-only memory (ROM) discs that can be used in a variety of ways. When compared to CD-ROMs, they can store a lot more data. It has a thick polycarbonate plastic layer that serves as a foundation for the other layers. It’s an optical memory that can read and write data.
DVD-R: It is a writable optical disc that can be used just once. It’s a DVD that can be recorded. It’s a lot like WORM. DVD-ROMs have capacities ranging from 4.7 to 17 GB. The capacity of 3.5 inch disk is 1.3 GB.

48
Q

Cache Memory
It is a type of high-speed semiconductor memory that can help the CPU run faster. Between the CPU and the main memory, it serves as a buffer. It is used to store the data and programs that the CPU uses the most frequently.

Advantages of cache memory:

A

It is faster than the main memory.
When compared to the main memory, it takes less time to access it.
It keeps the programs that can be run in a short amount of time.
It stores data in temporary use.

49
Q

Disadvantages of cache memory

A

Because of the semiconductors used, it is very expensive.
The size of the cache (amount of data it can store) is usually small.