0% found this document useful (0 votes)
22 views25 pages

Chapter 7

Chapter 7 discusses memory organization in computer architecture, covering characteristics, hierarchy, and types of memory including RAM and ROM. It explains the importance of cache memory for speed, the mapping process for data transfer, and auxiliary memory for backup storage. Additionally, it differentiates between logical and physical addresses and introduces the concept of virtual memory.

Uploaded by

melesew mossie
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)
22 views25 pages

Chapter 7

Chapter 7 discusses memory organization in computer architecture, covering characteristics, hierarchy, and types of memory including RAM and ROM. It explains the importance of cache memory for speed, the mapping process for data transfer, and auxiliary memory for backup storage. Additionally, it differentiates between logical and physical addresses and introduces the concept of virtual memory.

Uploaded by

melesew mossie
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/ 25

Computer organization and

architecture

Chapter 7:
memory organization
Outlines

2
Characteristics of Memory Systems
Memory unit is used for storage, and retrieval of data and instructions.
A typical computer system is equipped with a hierarchy of memory subsystems, some internal to
the system and some external.
Internal memory systems are accessible by the CPU directly and external memory systems are
accessible by the CPU through an I/O module.
Memory systems are classified according to their key characteristics. The most important are
listed below:
Location
The classification of memory is done according to the location of the memory as:
Registers: The CPU requires its own local memory in the form of registers.
Internal (main): is often equated with the main memory (RAM)
External (secondary): consists of peripheral storage devices like Hard disks, magnetic tapes, etc.

3
Unit of Transfer
Word: For internal memory, unit of transfer is equal to the number of data lines into and out of the
memory module.
Block: For external memory, data are often transferred in much larger units than a word, and these
are referred to as blocks.
Access Method
Sequential: Tape units have sequential access.
Data is accessed sequentially; the records may be passed (or rejected) until the record that is
searched is found.
Random: Each addressable location in memory has a unique addressing mechanism.
Any location can be selected at random and directly addressed and accessed. Main memory and
cache systems are random access.
Physical Characteristics
Volatile/nonvolatile: In a volatile memory, information decays naturally or is lost when electrical
power is switched off.
Erasable/non-erasable: Nonerasable memory cannot be altered (except by destroying the storage
unit). ROM’s are non-erasable.
4
Memory Hierarchy
Memory is used for storing programs and data that are required to perform a
specific task.
For CPU to operate at its maximum speed, it required an uninterrupted and high
speed access to these memories that contain programs and data.
Some of the criteria need to be taken into consideration while deciding which
memory is to be used:
 Cost
 Speed
Memory access time
 Data transfer rate
Reliability
Figure below shows the hierarchy of memory in a typical memory with a trend in
access time, amount of storage, and cost per byte.

5
Memory Hierarchy
 Memory Hierarchy is to obtain the highest possible access speed while minimizing
the total cost of the memory system
Auxiliary memory
Magnetic
tapes I/O Main
processor memory
Magnetic
disks

CPU Cache
memory

Register Memory hierarchy in a computer system :


Main Memory : memory unit that
Cache communicates directly with the CPU (RAM)
Auxiliary Memory : device that provide backup
Main Memory storage (Disk Drives)
Cache Memory : special very-high-speed
memory to increase the processing speed (Cache
Magnetic Disk
RAM)

Magnetic Tape
6
Memory Hierarchy cont...d

7
Main Memory
Due to its direct connection with the CPU, it is also known as central memory.
The main memory holds the data and the programs that are needed by the CPU.
The main memory mainly consists of RAM, which is available in static and
dynamic mode.
Large memory
Made up of Integrated chips
Types:
1. RAM (Random access memory)
2. ROM (Read only memory)

8
RAM (Random Access Memory)
Random access memory (RAM) is the best known form of computer memory.
RAM is considered "random access" because you can access any memory cell
directly if you know the row and column that intersect at that cell.
Types of RAM:-
1. Static RAM (SRAM)
 a bit of data is stored using the state of a flip-flop.
Retains value indefinitely, as long as it is kept powered.
Mostly uses to create cache memory of CPU.
Faster and more expensive than DRAM.
2. Dynamic RAM (DRAM)
Each cell stores bit with a capacitor and transistor.
Large storage capacity
Needs to be refreshed frequently.
Used to create main memory.
Slower and cheaper than SRAM.
9
ROM
ROM is used for storing programs that are Permanently resident in the computer and for
tables of constants that do not change in value once the production of the computer is
completed
The ROM portion of main memory is needed for storing an initial program called bootstrap
loader,
Bootstrap Loader:- A program whose function is to start the computer software operating
when power is turned on.
There are five basic ROM types:
ROM - Read Only Memory
PROM - Programmable Read Only Memory
EPROM - Erasable Programmable Read Only Memory
EEPROM - Electrically Erasable Programmable Read Only Memory

10
RAM and ROM Chips
A RAM chip is better suited for communication with the CPU if it has one or more
control inputs that select the chip when needed
The Block diagram of a RAM and ROM chip is shown figure below, the capacity of the
memory is 128 words of 8 bits (one byte) and 512 words of 8 bits per word respectively.

Typical RAM chip:- 128 X 8 RAM : 27 = 128 (7 bit address lines)

Chip select 1 CS1


Chip select 2 CS2
Read RD 128 x 8 8-bit data bus
RAM
Write WR
7-bit address AD 7

Typical ROM chip:- 512 X 8 ROM : 29 = 512 (9 bit address lines

Chip select 1 CS1


Chip select 2 CS2
512 x 8 8-bit data bus
ROM
9-bit address AD 9
11
Memory Address Map
It is a pictorial representation of assigned address space for each chip in the system
The RAM have 128 byte and need 7 address lines, where the ROM have 512 bytes and need 9
address lines
there are 16 lines in the address bus, the table shows only 10 lines because the other 6 are not
used in this example and are assumed to be zero.
The small x's under the address bus lines designate those lines that must be connected to the
address inputs in each chip.
• lines 1 through 7 for the RAM and lines 1 through 9 for the ROM is to be assigned.
• TABLE 1 Memory Address Map for Microprocomputer

 Line 8 and 9 represent four distinct binary combination


to specify which RAM we chose
 When line 10 is 0, CPU selects a RAM And when it’s 1,
it selects the ROM

12
Memory connection to the CPU
 Memory Configuration : 512 bytes RAM + Address bus CPU
512 bytes ROM 16-11 10 9 8 7-1 RD WR Data bus
• 1 x 512 byte ROM + 4 x 128 bytes RAM
• Memory Address Map : Decoder
• Address line 9 8 3 2 1 0
CS1
• RAM 1 0 0 : 0000 - 007F CS2

Data
128 x 8
• RAM 2 0 1 : 0080 - 00FF RD
WR
RAM 1
• RAM 3 1 0 : 0100 - 017F AD7
• RAM 4 1 1 : 0180 - 01FF CS1
• Address line 10 CS2

Data
RD 128 x 8
• ROM 1 : 0200 - 03FF WR
RAM 2

• Memory Connection to CPU : AD7

• 2 x 4 Decoder : RAM select (CS1) CS1


CS2
• Address line 10

Data
RD 128 x 8
RAM 3
• RAM select : CS2 WR
AD7
• ROM select : CS2 의 Invert
CS1
CS2

Data
RD 128 x 8
RAM 4
WR
AD7

CS1
CS2

Data
1- 7 512 x 8
8
9 } AD9 ROM
13
Cache memory
If the active portions of the program and data are placed in a fast small memory, the average
memory access time can be reduced
Thus reducing the total execution time of the program
Such a fast small memory is referred to as cache memory
The cache is the fastest component in the memory hierarchy and approaches the speed of
CPU component
When CPU needs to access memory, the cache is examined
If the word is found in the cache, it is read from the fast memory
If the word addressed by the CPU is not found in the cache, the main memory is accessed to
read the word
Hit Ratio :-the ratio of the number of hits divided by the total CPU references (hits + misses)
to memory
hit : the CPU finds the word in the cache
miss : the word is not found in cache (CPU must read main memory)
14
Structure of Cache and Main Memory
Slot number Memory address
Tag Block
0 0
1 1
2 Block
. 3
(K words)

.
C-1 . .
Block length
(K words) .
(a) Cache
.

Block

2n-1
Word
length
Figure: The structure of the cache
and main memory (b) Main memory

15
mapping process
The transformation of data from main memory to cache memory is referred to as a
mapping process,
The basic characteristic of cache memory is its fast access time
Therefore, very little or no time must be wasted when searching the words in the cache
there are three types of mapping:
1. Associative mapping
2. Direct mapping
3. Set-associative mapping
To understand the mapping procedure, we have the following example:

16
Replacement Algorithms of Cache Memory
When a miss occurs in a set-associative cache and the set is full, it is necessary to replace one
of the tag-data items with a new value. The most
common replacement algorithms used are:
1. random replacement:- With the random replacement policy the control chooses one tag-
data item for replacement at random.
2. first-in, first out (FIFO):- procedure selects for replacement the item that has been in the
set the longest.
3. least recently used (LRU): The LRU algorithm selects for replacement the item that has
been least recently used by the CPU.
Both FIFO and LRU can be implemented by adding a few extra bits in each word of cache.

17
Auxiliary memory
Devices that provide backup storage are called auxiliary memory.
They are used for storing system programs, large data files, and other backup
information.
 The transfer rate is the number of characters or words that the device can transfer per
second, after it has been positioned at the beginning of the record.
• Magnetic Disk
A disk is a circular platter constructed of metal or of plastic coated with a
magnetic material.
Data are recorded on and later retrieved from the disk via a conducting coil
named the head.
During a read or write operation, the head is stationary while the platter rotates
beneath it.
Writing is achieved by producing a magnetic field which records a magnetic
pattern on the magnetic surface.
18
Data Organization and Formatting of Magnetic
disk
Figure below depicts the data layout of a disk.
The head is capable of reading or writing from a portion of the platter rotating beneath it.
This gives rise to organization of data on the platter in a concentric set of rings called
Tracks.
Each track is the same width as the head. Adjacent tracks are separated by gaps that
minimize errors due to misalignment of head.
 Data is transferred to and from the disk in blocks. And the block is smaller than the
capacity of a track.
Data is stored in block regions which is an angular part of a track and is referred to as a
sector.
Typically 10-100 sectors are there per track. These may be either of fixed or variable
length.

19
Figure : Disk data layout

RAID (Redundant Array of Independent Disks)


1. RAID is a set of physical disk drives viewed by the operating system as a single logical drive.
2. Data are distributed across the physical drives of an array.
3. Redundant disk capacity is used to store parity information, which guarantees data recoverability in case of a
disk failure.

o Optical Memory & Magnetic Tape are other two external memories. 20
physical address vs logical address
Address uniquely identifies a location in the memory.
two types of addresses that are logical address and physical address.
 The logical address is a virtual address and can be viewed by the user.
 The user can’t view the physical address directly.
The logical address is used like a reference, to access the physical address.
The fundamental difference between logical and physical address is that
 logical address is generated by CPU during a program execution whereas,

 the physical address refers to a location in the memory unit.

21
Virtual memory
 It is a memory management technique that provides an "idealized abstraction of the storage
resources that are actually available on a given machine" which "creates the illusion to users of a
very large memory."

22
23
24
thank you!!!!!!!

25

You might also like