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

Chap 04_Memory_System[1]

Chapter 4 discusses the computer memory system, including cache memory, internal memory, and external memory. It covers key characteristics of memory hierarchy, cache principles, mapping techniques, and various types of semiconductor memory like DRAM and SRAM, as well as storage solutions like SSDs and optical memory. The chapter also addresses performance parameters, RAID configurations, and the advantages of SSDs over traditional HDDs.

Uploaded by

leztwaper
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)
2 views

Chap 04_Memory_System[1]

Chapter 4 discusses the computer memory system, including cache memory, internal memory, and external memory. It covers key characteristics of memory hierarchy, cache principles, mapping techniques, and various types of semiconductor memory like DRAM and SRAM, as well as storage solutions like SSDs and optical memory. The chapter also addresses performance parameters, RAID configurations, and the advantages of SSDs over traditional HDDs.

Uploaded by

leztwaper
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/ 49

Chapter 4

Memory System

1
Contents
› Computer memory system
› Cache memory
› Internal memory
› External memory

2
Computer memory system
› Key characteristics:

3
Memory Hierarchy
As one goes down the hierarchy:
• Increasing capacity
• Increasing access time
• Decreasing cost per bit
• Decreasing frequency of access of
the memory by the processor

• Faster access time, greater cost per bit


• Greater capacity, smaller cost per bit
• Greater capacity, slower access time
4
Contents
› Computer memory system
› Cache memory
› Internal memory
› External memory

5
Cache memory principles
› A cache is a high speed memory that is located between CPU and
main memory and keeps a copy of the frequently used data
› When the CPU wants a data value from memory, it first looks in the
cache
› If the data is in the cache, it uses that data
› If the data is not in the cache, it copies a line of data from memory
to the cache and gives the CPU what it wants
› Cache hit: When the processor wants information at a given address
and that information is already in the cache
› Cache miss: If the processor wants information that is not already in
the cache

6
Cache memory principles

7
Cache line
› The CPU usually
accesses a word
of memory at a
time
› When memory
is copied from
the RAM to the
cache, it usually
copies a line of
data
Each line includes
› A line is usually a tag that
much larger identifies which
than a word, particular block is
often 4 to 16 currently being
words stored

8
Cache read operation

9
Elements of cache design

10
Cache addresses

11
Cache size
› Bigger is better
› Cache size is limited by:
▪ Space on the processor chip
▪ Manufacturing limitations
▪ Cost

12
Mapping
› Algorithm for mapping main memory blocks into
cache lines
› Mapping techniques:
▪ Direct: each address has a specific place in the cache
▪ Fully associative: search the entire cache for an address
▪ Set associative: each address can be in any of a small set of cache locations

13
Direct mapping
› The block j in main memory will be loaded to the line i of
the cache: i = j mode m

14
Direct mapping

15
Fully associative mapping
› A block in main memory can be load to any line of the
cache

16
Fully associative mapping

17
Set associative mapping

18
Set-Associative

19
Set-Associative
› 4.3.a Direct (Tag, Line, Word)
› 4.3.c Set Ass (Tag, Set. Word)
› Chỉ tính cho địa chỉ BBBBBB

20
Set-Associative

21
22
Replacement policy
› When a cache miss occurs, data is copied into some location in cache
› With Set Associative or Fully Associative mapping, the system must
decide where to put the data and what values will be replaced
› Cache performance is greatly affected by properly choosing data that
is unlikely to be referenced again
› Replacement algorithms:
▪ First In First Out (FIFO)
▪ Least Recently Used (LRU)
▪ Least Frequently Used (LFU)
▪ Random

23
Write policy
› When the processor changes a data item, it is changed in the cache.
If this line of cache is replaced, main memory needs to be updated
› Write through: cache and main memory are updated at the same
time whenever data is changed
› Write back: main memory is updated when the cache line is replaced

24
Line size
› A cache line is the amount of data copied into the cache at one time;
16 to 64 bytes is common
› When there is a cache miss, a line of memory is copied into the
cache
› The bigger the line size, the fewer lines in the cache
› Big lines will copy more nearby addresses
› The relationship between block size and hit ratio depends on the
locality characteristics of a particular program

25
Number of caches
› Multi-level cache:
▪ Most systems have two or three cache levels
▪ Higher level caches are usually larger
› Unified vs. split caches
▪ Unified cache: a single cache used to store references to both data and
instructions
▪ Split caches: the cache is split into two, one dedicated to instructions and one
dedicated to data

26
Contents
› Computer memory system
› Cache memory
› Internal memory
› External memory

27
Semiconductor Main Memory
› Basic element of a semiconductor memory is the memory cell.
› Cell properties:
▪ They exhibit two stable (or semistable) states, which can be used to
represent binary 1 and 0.
▪ They are capable of being written into (at least once), to set the state.
▪ They are capable of being read to sense the state
– Memory cell operation:

28
Semiconductor Memory Types

29
DRAM and SRAM
DRAM (Dynamic RAM) SRAM (Static RAM)
Digital device that uses the same
Made with cells that store data as
logic elements used in the
charge on capacitors
processor
Presence or absence of charge in a Binary values are stored using
capacitor is interpreted as a binary traditional flip-flop logic gate
1 or 0 configurations

Require periodic charge refreshing Hold its data as long as power is


to maintain data storage supplied to it

Smaller, cheaper but slower Faster but bigger and more costly

Often used for main memory Often used for cache


30
Memory Organization

31
Memory Organization

32
Advanced DRAM Organization
› SDRAM (Synchronous DRAM ): exchanges data with the
processor synchronized to an external clock signal and running
at the full speed of the processor/memory bus without
imposing wait states.
› RDRAM (Rambus DRAM): delivers address and control
information using an asynchronous block-oriented protocol.
› DDR DRAM (Double Data Rate DRAM): can send data twice per clock
cycle, once on the rising edge of the clock pulse and once on the falling
edge.

33
Contents
› Computer memory system
› Cache memory
› Internal memory
› External memory
–Cấu trúc đĩa cứng
–Đặc tính kỹ thuật (tốc độ truyền, quay đọc, công nghệ
sản xuất,…
–Các cơ chế sao lưu RAID 0 đến RAID 6
–Các công cụ, tiện ích đọc thông tin phần cứng, kiểm
tra,…

34
Magnetic Disk
› A disk is a circular platter constructed of nonmagnetic
material, called the substrate, coated with a magnetizable
material
▪ Traditionally the substrate has been an aluminium or
aluminium alloy material
▪ Recently glass substrates have been introduced
› Benefits of the glass substrate:
▪ Improvement in the uniformity of the magnetic film surface
to increase disk reliability
▪ A significant reduction in overall surface defects to help
reduce read-write errors
▪ Ability to support lower fly heights
▪ Better stiffness to reduce disk dynamics
▪ Greater ability to withstand(anti) shock and damage

35
Magnetic Read and Write Mechanisms
› Data are recorded on and later retrieved from the disk via a
conducting coil named the head
▪ On many systems, there are two heads, a read head and a write head.
▪ During a read or write operation, the head is stationary while the platter
rotates beneath it.
› Write mechanism: electricity flowing through a coil produces a
magnetic field.
▪ Electric pulses are sent to the write head, and the resulting magnetic
patterns are recorded on the surface below, with different patterns for
positive and negative currents.
› Read mechanism: a magnetic field moving relative to a coil
produces an electrical current in the coil.
▪ When the surface of the disk passes under the head, it generates a
current of the same polarity as the one already recorded.
36
Data Organization and Formatting
› Data on the platter is organized in
a concentric set of rings, called
tracks.
▪ Each track is the same width as the
head.
▪ There are thousands of tracks per
surface.
› Adjacent tracks are separated by
inter-tract gaps which prevent or
minimize errors
› Data are transferred to and from
the disk in sectors.
▪ There are hundreds of sectors per
track, either fixed or variable length.
▪ Adjacent sectors are separated by
intra-track (inter-sector) gaps.

37
Physical Characteristics

38
Disk Performance Parameters
› Seek time: time it takes to position the head at the track on a
movable–head system
› Rotational delay (rotational latency): time it takes for the
beginning of the sector to reach the head
› Access time : the time it takes to get into position to read or
write; sum of the seek time and the rotational delay
› Transfer time: time required for the data transfer portion of
the operation

39
RAID
› Redundant Array of Independent Disks/ Redundant Array of
Inexpensive Disks
› Consist of 7 levels
› Levels do not imply a hierarchical relationship but designate
different design architectures that share three common
characteristics:
▪ Set of physical disk drives viewed by the operating system as a single
logical drive
▪ Data are distributed across the physical drives of an array in a scheme
known as striping
▪ Redundant disk capacity is used to store parity information, which
guarantees data recoverability in case of a disk failure

40
RAID Levels

41
RAID Levels

42
RAID Levels

43
Solid State Drives (SSD)
› A SSD is a memory device made with solid state components
that can be used as a replacement to a hard disk drive (HDD)
› Flash-memory-based SSD
› NOR flash memory
▪ Reads and writes in bytes
▪ Used to store cell phone operating system code and on Windows
computers for the BIOS program that runs at start-up
› NAND flash memory
▪ Reads and writes in small blocks
▪ Used in USB flash drives, memory cards, and in SSDs

44
SSD compared to HDD
› SSDs have the following advantages over HDDs:
▪ High-performance input/output operations per second (IOPS):
Significantly increases performance I/O subsystems.
▪ Durability: Less susceptible to physical shock and vibration.
▪ Longer lifespan: SSDs are not susceptible to mechanical wear.
▪ Lower power consumption: SSDs use as little as 2.1 watts of power per
drive, considerably less than comparable-size HDDs.
▪ Quieter and cooler running capabilities: Less floor space required, lower
energy costs, and a greener enterprise.
▪ Lower access times and latency rates: Over 10 times faster than the
spinning disks in an HDD.
› Currently, HDDs enjoy a cost per bit advantage and a capacity
advantage, but these differences are shrinking.

45
SSD Organization
› Interface to host system
› Controller: Provides SSD device level
interfacing and firmware execution.
› Addressing: Logic that performs the
selection function across the flash
memory components.
› Data buffer/cache: High speed RAM
memory components used for speed
matching and to increased data
throughput.
› Error correction: Logic for error
detection and correction.
› Flash memory components:
Individual NAND flash chips.

46
Practical Issues
› SDD performance has a tendency to slow down as the device is used
▪ Files are stored on disk as a set of pages, typically 4 KB in length;
however, flash memory is accessed in blocks, with a typically block size of
512 KB
▪ The entire block must be read from the flash memory and placed in a
RAM buffer. Then the appropriate page in the RAM buffer is updated.
▪ Before the block can be written to flash memory, the entire block of flash
memory must be erased.
▪ The entire block from the buffer is now written back to the flash memory.
› Flash memory becomes unusable after a certain number of writes,
typical limit is 100,000 write
› Most flash devices estimate their own remaining lifetimes so systems
can anticipate failure and take preemptive action

47
Optical memory
› CD (Compact Disk): A nonerasable disk that stores digitized audio
information. The standard system uses 12-cm disks and can record
more than 60 minutes of uninterrupted playing time.
› CD-ROM (Compact Disk Read-Only Memory): A nonerasable disk
used for storing computer data. The standard system uses 12-cm
disks and can hold more than 650 Mbytes.
› CD-R (CD Recordable): Similar to a CD-ROM. The user can write to
the disk only once.
› CD-RW (CD Rewritable): Similar to a CD-ROM. The user can erase and
rewrite to the disk multiple times.

48
Optical memory
› DVD (Digital Versatile Disk): A technology for producing digitized,
compressed representation of video information, as well as large
volumes of other digital data. Both 8 and 12 cm diameters are used,
with a double-sided capacity of up to 17 Gbytes. The basic DVD is
read-only (DVD-ROM).
› DVD-R (DVD Recordable): Similar to a DVD-ROM. The user can write
to the disk only once. Only one-sided disks can be used.
› DVD-RW (DVD Rewritable): Similar to a DVD-ROM. The user can
erase and rewrite to the disk multiple times. Only one-sided disks can
be used.
› Blu-ray DVD (High-definition video disk.): Provides considerably
greater data storage density than DVD, using a 405-nm (blue-violet)
laser. A single layer on a single side can store 25 Gbytes.

49

You might also like