0% found this document useful (0 votes)
26 views23 pages

Unit 3 Memory Organisation

Uploaded by

586ayush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views23 pages

Unit 3 Memory Organisation

Uploaded by

586ayush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

UNIT 3 MEMORY

ORGANISATION
VBSPU BCA 1ST SEM

[DATE]
[COMPANY NAME]
[Company address]
What is RAM?
RAM, which stands for Random Access Memory, is a hardware device generally located
on the motherboard of a computer and acts as an internal memory of the CPU. It allows
CPU store data, program, and program results when you switch on the computer. It is
the read and write memory of a computer, which means the information can be written
to it as well as read from it.

RAM is a volatile memory, which means it does not store data or instructions permanently.
When you switch on the computer the data and instructions from the hard disk are stored in
the RAM, e.g., when the computer is rebooted, and when you open a program, the operating
system (OS), and the program are loaded into RAM, generally from an HDD or SSD. CPU
utilizes this data to perform the required tasks. As soon as you shut down the computer, the
RAM loses the data. So, the data remains in the RAM as long as the computer is on and lost
when the computer is turned off. The benefit of loading data into RAM is that reading data
from the RAM is much faster than reading from the hard drive.

Function of RAM
RAM has no potential for storing permanent data due to its volatility. A hard drive can
be compared to a person's long-term memory and RAM to their short-term memory.
Short-term memory can only hold a limited number of facts in memory at any given
time; however, it concentrates on immediate tasks. Facts kept in the brain's long-term
memory can be used to replenish short-term memory when it becomes full.

This is also how computers operate. When RAM is full, the CPU of the computer must
constantly access the hard drive to overwrite the old data in RAM with the fresh data.
The computer's performance is slowed by this process.

RAM will not run out of memory, unlike a hard disk of the computer, which can only
hold so much data before it becomes completely full. However, the RAM and storage
memory can both run out of space.

Types of RAM:
Integrated RAM chips can be of two types:

1. Static RAM (SRAM):


2. Dynamic RAM (DRAM):

Both types of RAM are volatile, as both lose their content when the power is turned
off.
Static RAM:

Static RAM (SRAM) is a type of random access memory that retains its state for data
bits or holds data as long as it receives the power. It is made up of memory cells and
is called a static RAM as it does not need to be refreshed on a regular basis because it
does not need the power to prevent leakage, unlike dynamic RAM. So, it is faster than
DRAM.

2) Dynamic RAM:

Dynamic Ram (DRAM) is also made up of memory cells. It is an integrated circuit (IC)
made of millions of transistors and capacitors which are extremely small in size and
each transistor is lined up with a capacitor to create a very compact memory cell so
that millions of them can fit on a single memory chip. So, a memory cell of a DRAM
has one transistor and one capacitor and each cell represents or stores a single bit of
data in its capacitor within an integrated circuit.
SRAM DRAM

It is a static memory as it It is a dynamic memory as it


does not need to be needs to be refreshed
refreshed repeatedly. continuously or it will lose
the data.

Its memory cell is made of Its memory cell is made of


6 transistors. So its cells one transistor and one
occupy more space on a capacitor. So, its cells occupy
chip and offer less storage less space on a chip and
capacity (memory) than a provide more memory than
DRAM of the same a SRM of the same physical
physical size. size.

It is more expensive than It is less expensive than


DRAM and is located on SRAM and is mostly located
processors or between a on the motherboard.
processor and main
memory.

It has a lower access time, It has a higher access time,


e.g. 10 nanoseconds. So, it e.g. more than 50
is faster than DRAM. nanoseconds. So, it is slower
than SRAM.

It stores information in a The information or each bit


bistable latching circuitry. of data is stored in a
It requires regular power separate capacitor within an
supply so it consumes integrated circuit so it
more power. consumes less power.

It is faster than DRAM as It is not as fast as SRAM, as


its memory cells don't its memory cells are
need to be refreshed and refreshed continuously. But
are always available. So, it still, it is used in the
is mostly used in registers motherboard because it is
in the CPU and cache cheaper to manufacture and
memory of various requires less space.
devices.

Its cycle time is shorter as Its cycle time is more than


it does not need to be the SRAM's cycle time.
paused between accesses
and refreshes.
What is ROM?

ROM, which stands for read only memory, is a memory device or storage medium that
stores information permanently. It is also the primary memory unit of a computer
along with the random access memory (RAM). It is called read only memory as we can
only read the programs and data stored on it but cannot write on it. It is restricted to
reading words that are permanently stored within the unit.

The manufacturer of ROM fills the programs into the ROM at the time of
manufacturing the ROM. After this, the content of the ROM can't be altered, which
means you can't reprogram, rewrite, or erase its content later. However, there are some
types of ROM where you can modify the data.

ROM contains special internal electronic fuses that can be programmed for a specific
interconnection pattern (information). The binary information stored in the chip is
specified by the designer and then embedded in the unit at the time of manufacturing
to form the required interconnection pattern (information). Once the pattern
(information) is established, it stays within the unit even when the power is turned off.
So, it is a non-volatile memory as it holds the information even when the power is
turned off, or you shut down your computer.

The information is added to a RAM in the form of bits by a process known as


programming the ROM as bits are stored in the hardware configuration of the device.
So, ROM is a Programmable Logic Device (PLD).

A simple example of ROM is the cartridge used in video game consoles that allows the
system to run many games. The data which is stored permanently on personal
computers and other electronic devices like smartphones, tablets, TV, AC, etc. is also
an example of ROM.

For example, when you start your computer, the screen does not appear instantly. It
takes time to appear as there are startup instructions stored in ROM which are required
to start the computer during the booting process. The work of the booting process is
to start the computer. It loads the operating system into the main memory (RAM)
installed on your computer. The BIOS program, which is also present in the computer
memory (ROM) is used by the microprocessor of the computer to start the computer
during the booting process. It allows you to open the computer and connects the
computer with the operating system.

ROM is also used to store Firmware, which is a software program which remains
attached to the hardware or programmed on a hardware device like a keyboard, hard
drive, video cards, etc. It is stored in the flash ROM of a hardware device. It provides
instructions to the device to communicate and interact with other devices.

Block Diagram of ROM:

The block of ROM has 'n' input lines and 'm' output lines. Each bit combination of the
input variables is known as an address. Each bit combination that comes out through
output lines is called a word. The number of bits per word is equal to the number of
output lines, m.

The address of a binary number refers to one of the addresses of n variables. So, the
number of possible addresses with 'n' input variables is 2n. An output word has a
unique address, and as there are 2n distinct addresses in a ROM, there are 2n separate
words in the ROM. The words on the output lines at a given time depends on the
address value applied to the input lines.

Internal Structure of ROM:


The internal structure comprises two basic components: decoder and OR gates. A
decoder is a circuit that decodes an encoded form (such as binary coded decimal, BCD)
to a decimal form. So, the input is in binary form, and the output is its decimal
equivalent. All the OR gates present in the ROM will have outputs of the decoder as
their output. Let us take an example of 64 x 4 ROM. The structure is shown in the
following image.

This Read Only Memory consists of 64 words of 4 bits each. So, there would be four
output lines, and one of the 64 words available on the output lines is determined from
the six input lines as we have only six inputs because in this ROM we have 26 = 64, so
we can specify 64 addresses or minterms. For each address input, there is a unique
selected word. For example, if the input address is 000000, word number 0 will be
selected and applied to the output lines. If the input address is 111111, word number
63 is selected and applied to the output lines.

Features of ROM:
ROM (Read-Only Memory) possesses several distinct features that make it suitable for
various applications. Let's explore some key features of ROM in simple language.

o Non-Volatile Memory: ROM is a non-volatile memory type; thus, it keeps its data
even when the power is switched off. This makes it suitable for storing permanent
instructions and data since it guarantees that the recorded information will remain
intact and may be accessed whenever necessary.
o Read-Only Nature: Reading-only memory, or ROM, as its name implies, prevents data
from being readily modified or wiped. This characteristic provides stability and prevents
accidental alterations, ensuring the integrity and reliability of the stored information.
o Permanent Storage: ROM offers permanent storage of data and instructions. Once
the data is programmed into ROM during manufacturing, it remains fixed and cannot
be changed without physically replacing the ROM chip. This permanence guarantees
the consistency and stability of the stored information.
o Firmware Storage: ROM is commonly used for storing firmware containing essential
instructions for operating electronic devices. ROM's non-volatile and read-only nature
ensures that the firmware remains unchanged, providing reliable and consistent
functionality to the device.
o Booting and Initialization: ROM plays a crucial role in electronic systems' booting
and initialization processes. The firmware stored in ROM contains the initial instructions
required to start the system, load the operating system, and initiate the hardware
components. This ensures a smooth and controlled startup sequence for the device.
o Data Security: ROM offers inherent data security. Since the data stored in ROM cannot
be modified or erased, it protects against unauthorized alterations or tampering. This
feature enhances the security and authenticity of the stored information, making ROM
suitable for critical instructions and sensitive data.
o Instant Read Access: ROM provides instant read access to the stored instructions and
data. The information can be accessed directly without time-consuming loading,
enabling quick retrieval and execution of essential instructions.
o Compatibility: ROM is compatible with various systems and architectures, allowing
seamless integration into different electronic devices and systems. This compatibility
ensures that ROM can be utilized in various applications.
o Reliability: Due to its read-only nature, ROM offers high reliability. The data stored in
ROM is not susceptible to accidental modifications or loss, ensuring consistent and
predictable performance over time. Such dependability is crucial for important systems
where stability and data integrity are of the utmost importance.
o Cost-Effectiveness: ROM is generally more cost-effective than other memory types,
making it an economical choice for many applications. Production costs are cheaper
since the manufacturing procedures used to produce ROMs are well-established.
Types of ROM:
1) Masked Read Only Memory (MROM):

It is the oldest type of read only memory (ROM). It has become obsolete so it is not
used anywhere in today's world. It is a hardware memory device in which programs
and instructions are stored at the time of manufacturing by the manufacturer. So it is
programmed during the manufacturing process and can't be modified,
reprogrammed, or erased later.

The MROM chips are made of integrated circuits. Chips send a current through a
particular input-output pathway determined by the location of fuses among the rows
and columns on the chip. The current has to pass along a fuse-enabled path, so it can
return only via the output the manufacturer chooses. This is the reason the rewriting
and any other modification is not impossible in this memory.

2) Programmable Read Only Memory (PROM):

PROM is a blank version of ROM. It is manufactured as blank memory and


programmed after manufacturing. We can say that it is kept blank at the time of
manufacturing. You can purchase and then program it once using a special tool called
a programmer.

In the chip, the current travels through all possible pathways. The programmer can
choose one particular path for the current by burning unwanted fuses by sending a
high voltage through them. The user has the opportunity to program it or to add data
and instructions as per his requirement. Due to this reason, it is also known as the user-
programmed ROM as a user can program it.

To write data onto a PROM chip; a device called PROM programmer or PROM burner
is used. The process or programming a PROM is known as burning the PROM. Once it
is programmed, the data cannot be modified later, so it is also called as one-time
programmable device.

Uses: It is used in cell phones, video game consoles, medical devices, RFID tags, and
more.

3) Erasable and Programmable Read Only Memory


(EPROM):

EPROM is a type of ROM that can be reprogramed and erased many times. The method
to erase the data is very different; it comes with a quartz window through which a
specific frequency of ultraviolet light is passed for around 40 minutes to erase the data.
So, it retains its content until it is exposed to the ultraviolet light. You need a special
device called a PROM programmer or PROM burner to reprogram the EPROM.

Uses: It is used in some micro-controllers to store program, e.g., some versions of Intel
8048 and the Freescale 68HC11.
4) Electrically Erasable and Programmable Read Only
Memory (EEPROM):

ROM is a type of read only memory that can be erased and reprogrammed repeatedly,
up to 10000 times. It is also known as Flash EEPROM as it is similar to flash memory. It
is erased and reprogrammed electrically without using ultraviolet light. Access time is
between 45 and 200 nanoseconds.

The data in this memory is written or erased one byte at a time; byte per byte, whereas,
in flash memory data is written and erased in blocks. So, it is faster than EEPROM. It is
used for storing a small amount of data in computer and electronic systems and
devices such as circuit boards.

Uses: The BIOS of a computer is stored in this memory.


5) FLASH ROM:

It is an advanced version of EEPROM. It stores information in an arrangement or array


of memory cells made from floating-gate transistors. The advantage of using this
memory is that you can delete or write blocks of data around 512 bytes at a particular
time. Whereas, in EEPROM, you can delete or write only 1 byte of data at a time. So,
this memory is faster than EEPROM.

It can be reprogrammed without removing it from the computer. Its access time is very
high, around 45 to 90 nanoseconds. It is also highly durable as it can bear high
temperature and intense pressure.

Uses: It is used for storage and transferring data between a personal computer and
digital devices. It is used in USB flash drives, MP3 players, digital cameras, modems
and solid-state drives (SSDs). The BIOS of many modern computers are stored on a
flash memory chip, called flash BIOS.
Auxiliary Memory
An Auxiliary memory is known as the lowest-cost, highest-capacity and slowest-access
storage in a computer system. It is where programs and data are kept for long-term
storage or when not in immediate use. The most common examples of auxiliary
memories are magnetic tapes and magnetic disks.

Magnetic Disks
A magnetic disk is a type of memory constructed using a circular plate of metal or
plastic coated with magnetized materials. Usually, both sides of the disks are used to
carry out read/write operations. However, several disks may be stacked on one spindle
with read/write head available on each surface.

The following image shows the structural representation for a magnetic disk.

o The memory bits are stored in the magnetized surface in spots along the concentric
circles called tracks.
o The concentric circles (tracks) are commonly divided into sections called sectors.
Magnetic Tape
Magnetic tape is a storage medium that allows data archiving, collection, and backup
for different kinds of data. The magnetic tape is constructed using a plastic strip coated
with a magnetic recording medium.

The bits are recorded as magnetic spots on the tape along several tracks. Usually, seven
or nine bits are recorded simultaneously to form a character together with a parity bit.

Magnetic tape units can be halted, started to move forward or in reverse, or can be
rewound. However, they cannot be started or stopped fast enough between individual
characters. For this reason, information is recorded in blocks referred to as records.
Memory Hierarchy Design and its
Characteristics
 Read

 Discuss

 Courses

 Video


In the Computer System Design, Memory Hierarchy is 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. The figure
below clearly demonstrates the different levels of the memory hierarchy.
Why Memory Hierarchy is Required in the System?
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.
Types of Memory Hierarchy
This Memory Hierarchy Design is divided into 2 main types:
 External Memory or Secondary Memory: 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.
 Internal Memory or Primary Memory: Comprising of Main Memory, Cache
Memory & CPU registers. This is directly accessible by the processor.
Memory Hierarchy Design

Memory Hierarchy Design

1. Registers

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.

2. Cache Memory

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.
3. Main Memory
Main memory, 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.

4. Secondary Storage

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.

5. Magnetic Disk

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.

6. Magnetic Tape

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.
Characteristics of Memory Hierarchy
 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.
Advantages of Memory Hierarchy
 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.
Associative Memory
An associative memory can be considered as a memory unit whose stored data can be
identified for access by the content of the data itself rather than by an address or
memory location.

Associative memory is often referred to as Content Addressable Memory (CAM).

When a write operation is performed on associative memory, no address or memory


location is given to the word. The memory itself is capable of finding an empty unused
location to store the word.

On the other hand, when the word is to be read from an associative memory, the
content of the word, or part of the word, is specified. The words which match the
specified content are located by the memory and are marked for reading.

The following diagram shows the block representation of an Associative


memory.

From the block diagram, we can say that an associative memory consists of a memory
array and logic for 'm' words with 'n' bits per word.

The functional registers like the argument register A and key register K each
have n bits, one for each bit of a word. The match register M consists of m bits, one
for each memory word.

The words which are kept in the memory are compared in parallel with the content of
the argument register.
The key register (K) provides a mask for choosing a particular field or key in the
argument word. If the key register contains a binary value of all 1's, then the entire
argument is compared with each memory word. Otherwise, only those bits in the
argument that have 1's in their corresponding position of the key register are
compared. Thus, the key provides a mask for identifying a piece of information which
specifies how the reference to memory is made.

The following diagram can represent the relation between the memory array and the
external registers in an associative memory.

The cells present inside the memory array are marked by the letter C with two
subscripts. The first subscript gives the word number and the second specifies the bit
position in the word. For instance, the cell Cij is the cell for bit j in word i.

A bit Aj in the argument register is compared with all the bits in column j of the array
provided that Kj = 1. This process is done for all columns j = 1, 2, 3......, n.

If a match occurs between all the unmasked bits of the argument and the bits in word i,
the corresponding bit Mi in the match register is set to 1. If one or more unmasked
bits of the argument and the word do not match, Mi is cleared to 0.
Virtual Memory
Virtual Memory is a storage scheme that provides user an illusion of having a very big
main memory. This is done by treating a part of secondary memory as the main
memory.

In this scheme, User can load the bigger size processes than the available main
memory by having the illusion that the memory is available to load the process.

Instead of loading one big process in the main memory, the Operating System loads
the different parts of more than one process in the main memory.

By doing this, the degree of multiprogramming will be increased and therefore, the
CPU utilization will also be increased.

How Virtual Memory Works?


In modern word, virtual memory has become quite common these days. In this
scheme, whenever some pages needs to be loaded in the main memory for the
execution and the memory is not available for those many pages, then in that case,
instead of stopping the pages from entering in the main memory, the OS search for
the RAM area that are least used in the recent times or that are not referenced and
copy that into the secondary memory to make the space for the new pages in the main
memory.

Since all this procedure happens automatically, therefore it makes the computer feel
like it is having the unlimited RAM.

Demand Paging
Demand Paging is a popular method of virtual memory management. In demand
paging, the pages of a process which are least used, get stored in the secondary
memory.

A page is copied to the main memory when its demand is made or page fault occurs.
There are various page replacement algorithms which are used to determine the pages
which will be replaced. We will discuss each one of them later in detail.
Cache Memory
Cache memory is a high-speed memory, which is small in size but faster than the main
memory (RAM). The CPU can access it more quickly than the primary memory. So, it is
used to synchronize with high-speed CPU and to improve its performance.

Cache memory can only be accessed by CPU. It can be a reserved part of the main
memory or a storage device outside the CPU. It holds the data and programs which
are frequently used by the CPU. So, it makes sure that the data is instantly available for
CPU whenever the CPU needs this data. In other words, if the CPU finds the required
data or instructions in the cache memory, it doesn't need to access the primary
memory (RAM). Thus, by acting as a buffer between RAM and CPU, it speeds up the
system performance.

Types of Cache Memory:


L1: It is the first level of cache memory, which is called Level 1 cache or L1 cache. In
this type of cache memory, a small amount of memory is present inside the CPU itself.
If a CPU has four cores (quad core cpu), then each core will have its own level 1 cache.
As this memory is present in the CPU, it can work at the same speed as of the CPU.
The size of this memory ranges from 2KB to 64 KB. The L1 cache further has two types
of caches: Instruction cache, which stores instructions required by the CPU, and the
data cache that stores the data required by the CPU.
L2: This cache is known as Level 2 cache or L2 cache. This level 2 cache may be inside
the CPU or outside the CPU. All the cores of a CPU can have their own separate level
2 cache, or they can share one L2 cache among themselves. In case it is outside the
CPU, it is connected with the CPU with a very high-speed bus. The memory size of this
cache is in the range of 256 KB to the 512 KB. In terms of speed, they are slower than
the L1 cache.

L3: It is known as Level 3 cache or L3 cache. This cache is not present in all the
processors; some high-end processors may have this type of cache. This cache is used
to enhance the performance of Level 1 and Level 2 cache. It is located outside the CPU
and is shared by all the cores of a CPU. Its memory size ranges from 1 MB to 8 MB.
Although it is slower than L1 and L2 cache, it is faster than Random Access Memory
(RAM).

You might also like