0% found this document useful (0 votes)
19 views

1memory Organization

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

1memory Organization

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

COMPUTER

ORGANIZATION
(PCO303C)
UNIT II
MEMORY ORGANIZATION
CONTENTS
 Computers Memory System Overview
 Characteristics of Memory System,
 The Memory Hierarchy, Semi-Conductor Main Memory types, Cache
Memory
 Associative Memory: Match Logic. Read Operation, Write Operation,
 Auxiliary Memory: Magnetic Disks, Magnetic Tape,
 Virtual Memory
INTRODUCTION
 Memory is the faculty of the brain by which data or information is encoded, stored, and
retrieved when needed.
 It is the retention of information over time to influence future action.
 Similar is the function of computer memory, and it has similarities with the human brain.
 But oversimplification in this regard will be hazardous because the human brain is a very
complicated and sophisticated piece of machinery.
 It has memory and processing, entwined together, along with the capability for feelings and
emotions which a computer system lacks.
 Here we will focus on the memory part of the brain alone (not physically, only functionally).
And try to use it as an analogy for understanding how computer memory works.
 Memory is often understood as an informational processing system with explicit and implicit
functioning that is made up of a sensory processor, short-term (or working) memory, and
long-term memory.
 This can be related to the computer memory systems as well.
 The sensory processor allows information from the outside world to be sensed. This is in the
form of chemical and physical stimuli.
 Working memory serves as an intermediate, for understating and retrieving for the brain to
process information.
 Information in the form of stimuli is encoded following explicit or implicit functions by the
working memory processor.
 The working memory also retrieves information from previously stored material.
 Finally, the function of long-term memory is to store data through various
categorical models or systems.
 The above three functions serve as an analogy to the computer memory
system.
 The Input from various input devices goes into the memory, which
is processed in the Main Memory (Primarily RAM), and the data is
stored in Secondary Memory (Auxiliary Storage) for present or
future processing.
 Apart from these three are ROM, the hard encoding of computer memory,
or the framework.
 That can be understood as the analogy of human habits, which slowly get
encoded in the behavior, and come naturally without conscious effort once
they are formed.
 Let us dive a bit deeper into the computer memory system, and let’s use
the human memory analogy deliberated above for understating it better.
CHARACTERISTICS OF
MEMORY SYSTEMS
The complex subject of computer memory is made more manageable if we classify memory
systems according to their key characteristics.
The most important of these are as follows:
1. Location: Location refers to whether memory is internal and external to the computer.
 Internal memory: internal memory is often equated with main memory.
 The processor requires its own local memory, in the form of registers
 The control unit portion of the processor may also require its own internal memory.
 Cache is another form of internal memory.
 External memory consists of peripheral storage devices, such as disk and tape, that are
accessible to the processor via I/O controllers.
2. Capacity :For internal memory, this is typically expressed in terms of bytes (1 byte = 8
bits) or words. Common word lengths are 8, 16, and 32 bits.
 External memory capacity is typically expressed in terms of bytes.

3. Unit of transfer: For internal memory, the unit of transfer is equal to the number of
electrical lines into and out of the memory Module.
 This may be equal to the word length, but is often larger, such as 64, 128, or 256 bits.
 For main memory, this is the number of bits read out of or written into memory at a time. The
unit of transfer need not equal a word or an addressable unit.
 For external memory, data are often transferred in much larger units than a word, and these
are referred to as blocks.
4. Access Methods
Sequential access: Start at the beginning and read through in order
 Access time depends on location of data and previous location
 The time to access an arbitrary record is highly variable (need high space to store data). e.g.
tape
Direct access: Individual blocks have unique address
 Access is by jumping to vicinity(the area near ) plus sequential search
 Access time depends on location and previous location e.g. disk

Random access: Each location has its own addressing mechanism


 Individual addresses identify locations exactly
 Access time is independent of location or previous access e.g. RAM

Associative: Each location has its own addressing mechanism


 Data is located by a comparison with contents of a portion of the store
 A word is retrieved based on a portion of its contents rather than its address
 Access time is independent of location or previous access e.g. cache
5. Performance:
Access time (latency): Time between presenting the address and getting the valid data
 For random-access memory, this is the time it takes to perform a read or write operation, that
is, the time from the instant that an address is presented to the memory to the instant that data
have been stored or made available for use.
 For non-random-access memory, access time is the time it takes to position the read–write
mechanism at the desired location.
Memory cycle time: Time may be required for the memory to “recover” before next access
 Cycle time = access time + recovery

Transfer rate: This is the rate at which data can be (moved) transferred into or out of a memory
unit
 For random-access memory, it is equal to 1/(cycle time).
6. Physical Types: A variety of physical types of memory have been employed.
 The most common today are semiconductor memory, magnetic surface memory, used for disk
and tape, and optical and magneto-optical.
7. Physical Characteristics:
 In a volatile memory, information decays naturally or is lost when electrical power is switched
off.
 In a nonvolatile memory, information once recorded remains without deterioration until
deliberately changed; no electrical power is needed to retain information. Magnetic-surface
memories are nonvolatile.
 Semiconductor memory (memory on integrated circuits) may be either volatile or nonvolatile.
 Nonerasable memory cannot be altered, except by destroying the storage unit. Semiconductor
memory of this type is known as read-only memory (ROM). Of necessity, a practical
nonerasable memory must also be nonvolatile.
8. Organization:
 For random-access memory, the organization is a key design issue.
 In this context, organization refers to the physical arrangement of bits to form words.
MEMORY HIERARCHY:
 To achieve greatest performance, the memory must be able to keep up with the processor.
 That is, as the processor is executing instructions, we would not want it to have to pause
waiting for instructions or operands.
 For a practical system, the cost of memory must be reasonable in relationship to other
components.
 As might be expected, there is a trade-off among the three key characteristics of memory:
capacity, access time, and cost.
 A variety of technologies are used to implement memory systems, and across this spectrum of
technologies, the following relationships hold:
 Faster access time, greater cost per bit
 Greater capacity, smaller cost per bit
 Greater capacity, slower access time
 A typical hierarchy is
illustrated in the
Figure . As one goes
down the hierarchy,
the following occur:
 Decreasing cost per
bit
 Increasing capacity

 Increasing access
time
 Decreasing
frequency of access
of the memory by
the processor
HOW COMPUTER PROCESSES INFORMATION
 This is one layout we all are very familiar with. It’s the most basic of the
computer layout which sacrifices some details for ease of understanding.
 If we follow the data flow, it comes as input from input devices and goes
straight into Memory, which Storage Unit represents.
1. Primary Storage
2. Secondary Storage
 The nomenclature creates a hierarchy, where one memory is superior to the
other.

 In computing, a device that is used to store information for immediate use in a


computer or related computer hardware device is commonly called as memory.

 It typically refers to semiconductor memory where data is stored within metal–


oxide–semiconductor (MOS) memory cells on a silicon integrated circuit chip.

 The term “memory” is often a colloquial short-hand with the term “primary
storage”. Secondary storage or memory is often called “storage”.
 The two “memories” of the processor, which are housed inside the Central
Processing Unit (CPU) are Registers and Cache.

 Though they are kind-of memories, but generally studied out of the
memory system.

 These are the most expensive, and fastest memory access to the CPU. Let
us have a look at them first.
THE MEMORY OF THE CPU
Registers:
 Registers are the small storage locations used by the CPU to store data and
instructions.

 They are built into the processor itself. Hence these memory locations can
be accessed by the processor directly.

 This makes them the fastest accessible memory.

 Registers are measured by the number of bits they can hold, for example,
an “8-bit register”, “32-bit register” or a “64-bit register”.
 32-bit and 64-bit are commonly used to describe processor architecture or
processor design. A 32-bit processor has a 32-bit register, which can store
2^32 or 4,294,967,296 values.

 A 64-bit processor has a 64-bit register, which can store 2^64 or


18,446,744,073,709,551,616 values.

 If you ever wondered, while installing software, what is the difference


between the 32-bit and 64-bit versions, now you know.
Cache Memory:

 Cache memory is not an original memory, but a copy of some parts of


“Main Memory” which is used frequently.

 Hence cache is a smaller, faster memory, located closer to a processor


core, which stores copies of the data from frequently used main memory.

 When trying to read from or write to a location in the main memory, the
processor first checks whether the data from that location is already in the
cache.
 If so, the processor will read from or write to the cache instead of the much
slower main memory.

 This helps to reduce the average cost (time or energy) to access data from
the main memory.

 The small memories which are closer to the CPU can operate faster than
the much larger main memory.

 Most CPUs since the 1980s have used one or more type of caches.
PRIMARY MEMORY (ALSO KNOWN AS MAIN MEMORY, INTERNAL MEMORY, OR PRIME MEMORY)

 Primary storage (also known as


main memory, internal
memory, or prime memory),
often referred to simply
as memory, is the only one
directly accessible to the CPU.
 The CPU continuously reads
instructions stored there and
executes them as required.
 Any data actively operated on
is also stored therein in a
uniform manner.
 This one diagram details it all.
The two kinds of Primary
Memory are ROM and RAM.
READ-ONLY MEMORY (ROM)
 This is a type of non-volatile memory used in computers and other electronic devices.

 Non Volatile means that no power is needed to keep the memory alive.

 The data stored in ROM cannot be electronically modified after the manufacture of
the memory device.

 Now almost every device comes with Factory Reset.

 Hence We will use this analogy to make understanding ROM easier.

 The memory of our computer, which is built-in into it, when the computer is being
manufactured/assembled in the factory, is the ROM.
 Data Stored in ROM is not alterable, non-modifiable easily.

 Hence, that software that is rarely changed during the life of the computer
system is stored in a ROM memory device.

 This kind of software is also known as Firmware. (Firmware is a very


common term, and computer or such systems reset to it when factory reset
applied. )
 Hence, consider it the most basic
and important memory.

 Basic because, we can only READ


it, but can’t WRITE anything on it.
 This memory space is not open to
the user. The BIOS of our computer
is one such example.
 Another example can be Video
Games Cartridges, which are plug
and play. They store the Game in
ROM.
 Many game consoles use
interchangeable ROM cartridges,
allowing for one system to play
multiple games.
 ROM comes before the Operating
System. And it allows the computer
to have its own Firmware.
 Everything else comes after that,
even the Operating system. Opened ROM cartridge for the Game Boy
MASK ROM
 The first ROM was hard-wired. They were made up of electronic components such as
Diodes or ICs, which cannot be altered after manufacture.
 These ROM ICs are also called Mask ROM Integrated Circuits.
 If there is any upgradation in ROM is to be made, it has to be replaced.
 A new ROM with new upgraded firmware can be installed, but old ROM and the firmware
cannot be changed.

In the Mask ROM IC, data is hard encoded, physically, during the manufacturing. So it can
be programmed only during the fabrication. This creates many hurdles:
1. Because each Mask ROM is programmed during manufacturing, its cost becomes very
high, since users must contract with a foundry to produce a custom design. It is only
possible to order it in large quantities.
2. Getting a ROM manufactured is time taking process, as each ROM is customized.
3. For R&D use, where the users have to do trial and error or modify and improve the
contents in the memory for refining a design, Mask ROM becomes impractical.
4. If ROM is faulty, and the product is shipped, it can’t be corrected without Total Recall.
PROGRAMMABLE ROM (PROM):

 These shortcomings created a


need for Programmable ROM
(PROM).
 It allows users to program its
contents exactly once by
physically altering its structure
with the application of high-
voltage pulses.
 This addressed problems 1 and
2 of Mask ROM, since a
company can simply order a
large batch of fresh PROM chips
and program them with the
desired contents at its
designers’ convenience.
However, this is also possible
one time only.
ERASABLE
PROGRAMMABLE ROM
(EPROM):

 In 1971, Dov Frohman of Intel


invented Erasable
Programmable Read-Only
Memory (EPROM).
 This new ROM, known as
EPROM essentially solved the
PROM problem, since EPROM
(unlike PROM) can be
repeatedly reset to its un-
programmed state by exposure
to strong ultraviolet light.
 It’s worth noting that it is still
nearly impossible for a user to
erase the ROM (Which is
exactly as intended), and
rewrite it. It only solved
problems for well-equipped
labs and R&D centers.
ELECTRICALLY ERASABLE PROGRAMMABLE ROM
(EEPROM):
 EEPROM could be
programmed even at a
remote location (using
just a computer and
serial cable). This helped
the computing industry
cross the 4th hurdle as
well.
 Now faulty ROM could be
reprogrammed at the
consumer’s or user’s
place, without the need
to bringing the entire
device back to the
manufacturer.
FLASH MEMORY:
 Going forward, Toshiba invented Flash Memory in the early 1980s and commercialized it in
the late 1980s.
 Flash Memory is a form of EEPROM.
 This uses the chip area very efficiently and can be erased, programmed, and reprogrammed
thousands of times without any damage.
 But it’s one of the groundbreaking advancement was that now any specific part of the device
could be erased. (Earlier ROMs needed to be deleted in totality). This can be done at high
speed, hence the name “flash”.
 After the advent of Flash Memories as ROMs, the entire ROM scenario has changed from
“One-time Programmable” to “Regular Updation of ROM”.
 The best example of the same is regular
updates of the firmware of various
computer systems.
 Earlier, the firmware was not easy to
change or upgrade. Now in mobile
devices, companies push remote
upgrades of the firmware, and the user
downloads and updates the same.
WHY DO WE STILL HAVE EPROM AND
MASK ROM?
 A natural question comes to mind, that after all the advantages of EEPROM, why do we still
have the old and less functional types of ROMs?
 The answer is simple. COST.
 All the advanced technologies increased the flexibility of the ROM chip, but there is a
downside of it as well.
 The technology comes at a very high cost per chip.
 Many systems do not need ROM to upgrade for their life, making the additional cost burden
unnecessary.
 Hence, as long as the large quantity MASK ROMs are cheaper (economy of scale), they will
remain the ROM of choice for many devices for years.
RAM (RANDOM ACCESS
MEMORY)
 Random Access Memory is the Volatile Memory of the computer.

 It means it forgets when the power is switched off.

 RAM is expensive; hence, in normal computing devices, it varies from 512


MB to 12 GB (Some expensive devices, both PC and Mobile, also have
much higher RAM).

 More RAM is associated with the faster working of the computer.


 RAM is essentially super-fast, high-speed storage that the computer
and its applications utilize to store and access temporary data.

 It can be thought of like a computer’s short-term memory.

 When a program starts ( for example, Google Chrome browser or


Microsoft Excel file), its data is stored on RAM.

 As RAM is much faster than a hard drive (Secondary Memory), the


program runs faster by having data directly accessible from RAM.

 As soon as the program ends (you close the browser or file), the RAM gets
free from its data.
 Hence, the larger the RAM, the faster the computer works with more
number of simultaneous programs.

 Computers with lesser RAM can’t do many things at once.

 Say, for example you are working on multiple video files and at the same
time, open many web browsers.

 The RAM requirement goes up with each new program being opened.

 What happens when the amount of “Temporary Memory”


requirement of a computer exceeds the RAM?

 Modern computers use a memory management technique called Virtual


Memory.
 This is a method to expand the RAM
capacity.
 A portion of the computer’s hard
drive is set aside for a paging file,
and now the total of the RAM and
Paging file becomes the total
“Temporary Memory”.
 However, there is a catch.
 The hard drive is much slower than
the RAM.
 And every time the computer relies on to take data from the paging file
from the hard drive, it gets a slower response than the RAM would offer.
 Hence, the higher the RAM, the faster the computer operations become.
 Now the natural question arises again. Why the RAM is in the range of 1
to 8 GB (or at times somewhat higher) but the hard drives are in range of
512 GBs to 2 TBs (Terrabyte = 1024 GB)?
When RAM is so important, why not have higher RAM?

 The answer is, again, the COST.

 Thetwo main types of volatile random-access memory are Static


random-access memory (SRAM) and Dynamic random-access
memory (DRAM).
Static random-access memory (SRAM)
 InStatic RAM, data is stored in a six-transistor (one kind of
semiconductor) memory cell, which requires a constant flow of power.

 Because the power flow is constant, it doesn’t need refreshing the


memory to remember the data being stored.

 This is called static because no change is needed ( no refreshing needed)


to keep the data intact. It is used in cache memory.

 This requires lesser power and gives faster access and speed.

 But simultaneously, it’s less dense in memory (lesser memory in the


same size) and has a higher cost.
Dynamic random-access memory (DRAM)

 In Dynamic RAM, data is stored in a transistor and capacitors (Made of


metal and not a semiconductor) pair memory cell.

 Capacitors discharge energy slowly.

 And hence data (which is stored in the form of energy) is also lost.
Therefore a periodic refresh of power is required to keep it functioning.

 DRAM is called dynamic as it needs a constant change of power


(refreshing) to keep the data intact.

 This requires higher power consumption and slower access to data than
SRAM.
 But simultaneously, it’s denser in memory (more memory in the same size)
and hence has a lower cost.

 Many computer systems have a memory hierarchy consisting of processor


registers, SRAM caches, external caches, DRAM, paging systems, and
virtual memory on a hard drive.

 This entire memory pool may be called “RAM”.


RAM CAPACITY AND
ADDRESSING
 RAM is organized into individual storage locations called memory cells.
 Each memory cell has a unique address the CPU uses to read from or write to that location.
 The total capacity of RAM is determined by the number of memory cells it contains and the
amount of data each cell can hold.
 The most common unit of memory capacity is bytes.

Numerical Example 1: Calculating RAM Capacity:


Suppose a computer has RAM chips where each memory cell can store 8 bits (1 byte). If the
computer has 4 RAM chips, each containing 1 million (10^6) memory cells, what is the total
RAM capacity in bytes?
Solution:

 Number of RAM chips: 4


 Memory cells per chip: 1 million (10^6)
 Data per memory cell: 8 bits (1 byte)
 Total RAM capacity = Number of chips × Cells per chip × Data per cell
 Total RAM capacity = 4 × 10^6 × 1 = 4 × 10^6 bytes
Numerical Example 2: Addressable Memory Range:
Each memory cell in RAM has a unique address. The number of unique
addresses corresponds to the range of memory that the CPU can access.
Suppose a computer's RAM has an address bus that can address up to 16
bits. Calculate the maximum addressable memory range.
Solution:
 Number of address bits: 16
 Maximum addressable memory range = 2^(Number of address bits)
 Maximum addressable memory range = 2^16 = 65536 memory cells
 Each memory cell stores a certain amount of data (e.g., 1 byte), so the
total addressable memory capacity is the addressable memory range
multiplied by the data size.
Numerical Example 3: Addressable Memory Range with Data Size:
Using the previous example, if each memory cell stores 4 bytes of data,
calculate the maximum addressable memory capacity in bytes.
Solution:

 Data size per cell: 4 bytes


 Maximum addressable memory range = 65536 memory cells
 Maximum addressable memory capacity = Addressable memory range ×
Data size per cell
 Maximum addressable memory capacity = 65536 × 4 = 262144 bytes

You might also like