目录

Computer Organization and Architecture External Memory


Computer Organization and Architecture

External Memory

Outline

  • Magnetic Disk

  • RAID

  • Solid State Drives

  • Optical Memory

  • Magnetic Tape

Magnetic disk

  • A disk is a nonmagnetic circular platter coated with magnetizable material

  • Data are recorded to or read from the disk using the read/write head

  • Hard disks can have one platter, or more

  • Direct access storage

Access method

  • 顺序存取:数据以线性的方式存放在存储介质中。读取数据必须按照顺序的方式,从当前的位置按照顺序移动到数据所在的位置进行读取。典型的顺序存取是磁带

  • 直接存取:数据按块存储在介质中,并且每个块都有一个唯一的地址。存取时,先按照这个唯一地址到达所在的块,然后在块中,顺序搜索到数据。典型的直接存取是硬盘

  • 随机存取:每个存取单元都有一个唯一的地址,通过寻址机制可以直接找到这个位置,不依赖于之前的存取操作所在的位置。典型的随机存取是内存

  • 关联存取:关联存取是通过对字中的部分内容进行比较,如果匹配就进行存取操作。关联存取是对字的内容进行比较,不是地址寻址。典型的关联存取是cache

Read and write mechanism

  • Recording & retrieval via conductive coil called a head

    • May be single read/write head or separate ones

    • During read/write, head is stationary, platter rotates

  • Write

    • Current through coil produces magnetic field

    • Pulses sent to head

    • Magnetic pattern recorded on surface below

/img/Computer Organization and Architecture/chapter6-1.png
  • Read (traditional)

    • 磁头上有线圈,读的时候磁头不动,磁盘通过马达在旋转

    • 磁盘上的磁性物质被磁化成两个方向,表示0和1

    • 磁性物质在转动的时候,会在磁头的线圈上产生电流

    • 不同的磁化方向产生的电流方向不一样

    • 通过分析电流方向,就可以得到磁化方向,从而确定存储的是0还是1

    • Magnetic field moving relative to coil produces current

    • Coil is the same for read and write

    • Slow reading and writing speed

  • Read (contemporary)

    • Separate read head, close to write head

    • MR(magneto resistive): it senses the magnetization direction of upper disc

    • magnetization direction changes the resistance of the magneto resistive sensor

    • magnetization direction can be obtained by measuring the resistance value to determine the stored information

    • Set shield to prevent interference

    • High frequency operation,Higher storage density and speed

Terminology

/img/Computer Organization and Architecture/chapter6-2.png
  • A hard disk may have several platters, with information recorded magnetically on both surfaces

Data Organization and Formatting

  • Disk is divided into several concentric rings

    • Called track

    • Data is stored in the track

  • tracks

    • Gaps between tracks to prevent interference between different tracks

    • Reduce gap to increase capacity

    • Disc rotates at constant angular velocity

    • Same number of bits per track (variable packing density)

  • Tracks divided into sectors

    • The smallest unit of data storage

    • Each track generally contains several hundred sectors

    • Current sector size is 512 bytes

    • Data is written to or read from the disk in sectors

  • May have more than one sector per block

  • Gaps are also left between sectors to avoid interference between sectors

/img/Computer Organization and Architecture/chapter6-3.png

Disk velocity

  • Rotate disk at constant angular velocity (CAV)

  • Same number of sectors in different tracks

  • Different space between bits in different tracks

  • Storage density of the inner ring determines the capacity of disk

  • Can use zones to increase capacity

Disk layout methods diagram

/img/Computer Organization and Architecture/chapter6-4.png

Winchester disk

  • First disk storage system,305 RAMAC by IBM in 1956, 5MB

  • Hard disk 3340 Invented by IBM in 1973

  • Has several coaxial metal discs coated with magnetic material

  • Disk, magnetic head and drive mechanism are sealed in a box

  • The disk has two 30M storage units and the caliber and charge of “Winchester rifle” are also two 30, so it is named

  • Magnetic head is not in contact with the disk to improve the durability of the disk

  • In 1980, Seagate manufactured the first Winchester hard disk on a personal computer

  • Invention of high-sensitivity magnetic head makes it possible for high-density storage

  • Almost all mechanical hard disks are based on Winchester technology

  • Although the capacity of hard disk has increased many times, the principle is the same as before

Hard disk – Winchester
  • Developed by IBM

  • Sealed unit

  • One or more platters (disks)

  • Heads fly on boundary layer of air as disk spins

  • Very small head to disk gap

  • Getting more robust

Winchester disk format Seagate

/img/Computer Organization and Architecture/chapter6-5.png

Characteristics of disk

  • Fixed (rare) or movable head
  • Removable or fixed
  • Single or double (usually) sided
  • Single or multiple platter
  • Head mechanism
    • Contact(Floppy)
    • Fixed gap
    • Flying(Winchester)

Floppy disk

  • Small capacity

  • Slow

  • Universal

  • Cheap

  • Obsolete

Multiple platter

  • Install multiple discs in vertical direction

  • One head per side

  • Heads are joined and aligned

  • Aligned tracks on each platter form cylinders

  • Data is striped by cylinder

    • Reduces head movement

    • Increases speed (transfer rate)

Cylinders

  • Platter has two heads

  • Multiple tracks at the same position is called cylinder

  • Data is stored according to cylinder rather than sequentially on a certain disk

  • Improve the reading and writing speed by reducing the movement of the magnetic head

Typical hard disk drive parameters

/img/Computer Organization and Architecture/chapter6-6.png

Timing of disk I/O transfer

  • 读写之前,首先要等待设备和通道空闲

  • 寻道时间:磁头从当前位置移动到数据所在的磁道的时间

  • 旋转延迟:数据所在的扇区旋转到磁头可以读写的位置

  • 数据传输:数据实际的传送阶段

  • 存取时间:寻道时间+旋转延迟

  • 传输时间:磁道定位后进行数据实际传输的时间

Transfer time ! ! !

  • $Transfer\ time - T\newline$

    • $T=\frac{b}{rN}\newline$
    • b = number of bytes to be transferred
    • N = number of bytes on a track
    • r = rotation speed, in revolutions per second
  • The total average access time (including transfer time)

  • $T_a=T_{total}=T_s+\frac{1}{2}r+\frac{b}{rN}\newline$

  • $T_s=seek\ time\newline$

  • $\frac{1}{2}r\ is\ the\ average\ Rotational\ latency\newline$

Conclusion

  • If the data is stored on the disk completely randomly

    • The read of each sector requires seek time + rotation delay + transmission

    • Most of the time is spent in seek track and sector, which is very time-consuming

  • Therefore, data is generally stored in adjacent tracks and sectors in sequence

    • Only one seek time and several sector seeking times are required

    • How data is organized is important

RAID

  • Redundant Array of Independent Disks

  • Redundant Array of Inexpensive Disks

  • Store data in multiple disks to improve I/O performance and increasing the disk‘s capacity

  • Parity information was used to prevent equipment failures

Characteristics

  • 7 levels in common use

  • Not a hierarchy,but 7 schemes

  • common characteristics

    • Set of physical disks viewed as single logical drive by OS

    • Data distributed across physical drives

    • Use redundant capacity to store parity information

RAID0

  • Can not be considered as a level in RAID

  • No redundancy,expanded storage space

  • Disks are striped

  • Data is stored in the adjacent physical disks in strip order

  • Increase speed

    • Multiple data requests probably not on the same disk

    • Disks seek in parallel 磁盘寻道并行化

    • A set of data is likely to be striped across multiple disks

/img/Computer Organization and Architecture/chapter6-7.png

Data mapping for RAID0

/img/Computer Organization and Architecture/chapter6-8.png

Advantages and disadvantages of RAID0

  • Advantages

    • I/O performance is greatly improved by spreading the I/O load across many channels and drives

    • Very simple design and easy to implement

  • Disadvantages

    • NOT fault-tolerant: the failure of just one drive will result in all data in an array being lost

Applications of RAID0

  • Not every application scenario requires high data reliability

  • In some scenarios,low cost is more important than reliability

  • Supercomputers in which

    • Performance and capacity are primary concerns
  • Video production and editing

    • A few data errors do not affect the overall effect

RAID1

  • Mirrored Disks

  • Data is striped across disks

  • 2 copies of each stripe on separate disks

  • Read from either

  • Write to both

  • Recovery is simple

    • Swap faulty disk & re-mirror

    • No down time

  • High reliability,expensive

/img/Computer Organization and Architecture/chapter6-9.png

Advantages and disadvantages of RAID1

  • Advantages

    • 100% redundancy of data: no rebuild is necessary in case of a disk failure, just a copy to the replacement disk

    • Fault recovery is simple. No down time

    • Simplest implementation

    • May improve read performance

  • Disadvantages

    • Expensive!

Applications of RAID1

  • Applications: Any applications that request a high reliability

    • Accounting

    • Payroll

    • Financial

    • ……

RAID2

  • Using the parallel access technology, all disks participate in the execution of each I/O request. All disks are synchronized

  • Very small stripes,often single byte/word

  • Calculate error correction code, and then the data and check code are stored on different disks in the disk array

  • Hamming code is often used to correct error

  • All disks need to be read at the same time

  • All disks need to participate in the write, and the error correction code needs to be calculated

  • Lots of redundancy

    • Expensive
    • Not often used
/img/Computer Organization and Architecture/chapter6-10.png

RAID3

  • Similar to RAID 2,parallel storage and check bit used

  • Only one redundant disk, no matter how large the array

  • Simple parity bit for each set of corresponding bits

  • Data on failed drive can be reconstructed from surviving data and parity info

  • Very high transfer rates

/img/Computer Organization and Architecture/chapter6-11.png

RAID4

  • Each disk operates independently

  • Good for high I/O request rate

  • Large stripes

  • Bit by bit parity calculated across stripes on each disk

  • Parity stored on parity disk

  • Update parity when writing data

/img/Computer Organization and Architecture/chapter6-12.png

RAID5

  • Like RAID 4

  • Parity striped across all disks

  • Round robin allocation for parity stripe

  • Avoids RAID 4 bottleneck at parity disk

  • Commonly used in network servers

/img/Computer Organization and Architecture/chapter6-13.png

RAID6

  • For higher fault tolerance

  • Two parity calculations

  • Stored in separate blocks on different disks

  • User requirement of N disks needs N+2

  • High data availability

    • Three disks need to fail for data loss
  • Significant write penalty

    • Two parity disks need to be updated every time data is written
/img/Computer Organization and Architecture/chapter6-14.png

RAID comparison

/img/Computer Organization and Architecture/chapter6-15.png

Solid State Drives

  • A solid state drive is a memory device made with solid state components that can be used as a replacement to a hard disk drive

  • A type of EEPROM

  • Include interface module, controller, address module, data buffer, error correction module and storage module

Example

  • CF、SD、MiniSD、MicroSD

  • 固态移动硬盘

  • 电脑中的固态硬盘

  • U盘

Types of SSD

  • Flash Based SSD

    • Flash chip as storage medium, often called SSD

    • Movable

    • No need power supply

    • Commonly used in notebook, micro hard disk, memory card, U disk, etc.

    • Long life and high reliability

      • SLC P/E more than 10000 times

      • MLC can reach more than 3000 times

      • TLC can also reach about 1000 times

      • QLC can also ensure 300 times

  • DRAM Based SSD

    • DRAM as storage medium, application range is narrow

    • High performance, theoretically unlimited write

    • Independent power supply is needed

  • 3D Xpoint SSD

    • Based on 3D xpoint, close to DRAM

    • Nonvolatile storage

    • Low read delay ,1% of the existing SSD

    • unlimited storage life

    • Density is relatively low and cost is very high

Compare of NOR and NAND

  • Flash memory include NOR Flash and NAND FLASH

  • NOR

    • Developed by Intel in 1988

    • With dedicated address and data line (similar to SRAM), read and write in byte mode

    • Fast access speed and small storage capacity

    • Data can be read randomly by byte

    • Program can be executed in the NOR

    • Speed of writing and erasing is not fast, which affects its performance

    • Suitable for program storage, such as BIOS

  • NAND

    • Reading and writing in blocks

    • Slower in reading, but much faster in writing and erasing than NOR

    • Smaller volume and higher storage density than NOR flash memory

    • Suitable for storing large amount of data

    • Including four types: SLC(Single-Level Cell),MLC(Multi-Level Cell),TLC(Trinary-Level Cell),QLC(Quad-Level Cell)

NAND Flash Storage unit

/img/Computer Organization and Architecture/chapter6-16.png

NAND Flash Diagram

/img/Computer Organization and Architecture/chapter6-17.png /img/Computer Organization and Architecture/chapter6-18.png

Advantages of SSD

  • Read and write fast Continuous R/W over 500MB / s, access time less than 0.1ms (mechanical hard disk generally in 12~14ms)

  • Shockproof and fall Resistant

  • Low power consumption

  • No noise

  • Wide working temperature range, -10 ~ 70 ℃ (mechanical hard disk generally in 5 ~ 55 ℃)

  • Light

Disadvantages of SSD

  • Smaller capacity than mechanical hard disk

  • Life limit

    • Limit the number of erasures. SLC about 10000 times, MLC about 3000 times, TLC about 1000 times, QLC only 300 times

    • Through the balanced algorithm to manage the storage unit, reduce the unnecessary amount of writing, improve the service life

  • Expensive than mechanical hard disk

  • Data storage time is limited. SLC is about 10 years, MLC is shorter

Optical Memory

Optical storage CD-ROM

  • CD—Compact Disk

  • Invented in 1983

  • Originally for audio,later used to store data

  • 650Mbytes giving over 70 minutes audio,about 15 songs

  • Polycarbonate coated with highly reflective coat, usually aluminium

  • Data stored as pits

  • Read by reflecting laser

  • Surface area of the optical disc is large. In order to store more data, hard disk storage cannot be used

  • A spiral that rotates outward from the center to the outermost edge

  • Length of the innermost and outermost sectors is the same

  • Constant packing density,no loss of capacity

  • Constant linear velocity,variable speed rotation

/img/Computer Organization and Architecture/chapter6-19.png

CD-ROM Drive Speeds

  • Constant linier velocity, not like hard disk

  • Audio is single speed

    • 1.2 m/s

    • Track (spiral) is 5.27km long

    • Gives 4391 seconds = 73.2 minutes

  • For data CD, can be rotated in high multiples for faster data reading

    • e.g. 24x

    • Quoted figure is maximum drive can achieve

CD-ROM format

  • 数据按照块(扇区)的方式组织在光盘上

  • 块的开头是12个字节的同步标识,采用了特殊的字符,开头和结尾的1个字节全为0,中间10个字节全为1

  • 同步标识后面是4个字节的块头,包含块(扇区)地址和模式。模式0表示是空的,没有数据。模式1表示后面是2048个字节的数据和288位的纠错码。模式2表示后面是2336个字节的数据,没有纠错码

  • 数据域,是用户的数据

Advantages & Disadvantages of CD-ROM

  • Large capacity(once)

  • Easy to mass produce

  • Removable

  • Robust

  • Expensive for small runs

  • Read only

  • Slow

Other Optical Storage

  • CD-Recordable (CD-R)

    • Disc is coated with a dye layer that can be activated by laser

    • Write only once

    • Now affordable

    • Applicable to document archiving

    • Compatible with CD-ROM drives

  • CD-RW

    • Erasable

    • Getting cheaper

    • Can be used as a secondary storage device

    • Mostly CD-ROM drive compatible

DVD

  • DVD invented to increase storage capacity

  • Digital Video Disk

    • Used to indicate a player for movies

    • Only plays video disks

  • Digital Versatile Disk

    • Used to indicate a computer driver

    • Will read computer disks and play video disks

DVD technology

  • Very high capacity (4.7G per layer)

  • Full length movie on single disk

    • Using MPEG compression

    • Finally standardized (honest!)

    • Movies carry regional coding

    • Players only play correct region films

  • Multi-layer,double-side

  • Content can be fixed

DVD – writable

  • Loads of trouble with standards

  • First generation DVD drivers may not read first generation DVD-W disks

  • First generation DVD drivers may not read CD-RW disks

  • Wait for it to settle down before buying!

/img/Computer Organization and Architecture/chapter6-20.png

High Definition Optical Disks

  • Designed for high definition videos

  • Much higher capacity than DVD

/img/Computer Organization and Architecture/chapter6-21.png

Magnetic Tape

/img/Computer Organization and Architecture/chapter6-22.png
  • Two types of recording

    • Parallel recording

    • Serial recording

  • Earlier tapes used nine tracks – parallel recording

  • Modern systems use serial recording, referred to as serpentine recording

Characteristics of tape

  • Serial access

  • Slow

  • Very cheap

  • Backup and archive

  • Linear Tape-Open (LTO) Tape Drives LTO

    • Developed late 1990s

    • Open source alternative to proprietary tape systems