Magnetic Disks
Total Page:16
File Type:pdf, Size:1020Kb
Computer Organization & Assembly Language Programming CSE 2312 Lecture 7 Secondary Memory 1 Memory Hierarchies • Access time gets bigger – several ns, several 10 ns, 10ms, several s • Storage capacity – 128 bytes, several megabytes, 10-1000 megabytes, 1-10 gigabytes, budgets, budgets • No of bits per dollar increases – Change rapidly A five-level memory hierarchy. 2 Magnetic Disks • Magnetic Disk – Consists of one or more platters with a magnetizable coating – A disk head containing an induction coil floats just over the surface, resting on a cushion of air • Scheme – When a positive or negative current passes through the head, it magnetizes the surface just beneath the head, aligning the magnetic particles face right or left, depending on the polarity of the drive current – When the head passes over a magnetized area, a positive or negative current is induced in the head, making it possible to read back the previously stored bits • Track – The circular sequence of bits written as the disk makes a complete rotation called a track • Sector – Each track is divided into some sector with fixed length, typically, 512 bytes 3 Disk Track A portion of a disk track. Two sectors are illustrated. • Sector – Preamble: allow the head to be synchronized before reading or writing – Data bits – Error Correcting Code: either a Hamming code, or Reed-Solomon code • Intersector gap – Between consecutive sectors 4 Platter A disk with four platters. • Most disks – Consist of multiple platters stacked vertically – Each surface has its own arm and head. All arms are ganged together so they move to different radial positions all at once 5 Disk Performance • Seek – To read/write a sector, the arm must be moved to the right radial direction first – Seeking time: Average 5 – 10 ms • Rotational Latency – The delay until the desired sector rotates under the head once after the head is positioned radially – Average delay, 3- 6 ms, for disk rotation speed 5400RPM 7200RPM 10800RPM • Transfer Time – Depending on the linear density and rotation speed. – Dominated by the seek time and rotation latency • Disk Controller – A chip that controls the drive. It is associated with each drive – Task: accepting commands from software, such as read, write, format – Controlling the arm motion; detecting and correcting errors – Converting 8-bit bytes read from memory into a serial bit stream and vice versa 6 Strategy • Constant angular velocity – All magnetic disks rotate at a constant angular velocity, no matter where the head are • Strategy 1 – Each one occupied 20 degrees of arc, no matter which cylinder • Strategy 2 – The number of sectors per track is increased in each zone moving outward from the innermost track 7 Floppy/IDE/SCSI Disks • Floppy Disk – Its head actually touch the diskettes instead of float above the surface on a cushion of rapidly moving air • Integrated Drive Electronic (IDE) – The controller is closely integrated with the drives – 4 bits for head, 6 bits for sector, 10 bits for cylinder, the max drive could have 63 sector, 16 heads and 1024 cylinders – Total 1,032,192 sectors, capacity 504 MB=1032192*512 • Small Computer System Interface (SCSI) – Same organization of cylinders, tracks and sector ; – Different interface and much higher transfer rates – More than just a hard disk interface and it is a bus to which a SCSI controller and up to 7 devices can be attached, such as SCSI disk, scanner, tape units, and others – SCSI allows all the devices to run at once, improving performance – IDE allows only one active device at a time 8 SCSI Disk Some of the possible SCSI parameters. 9 RAID Redundant Array of Inexpensive Disks • RAID vs. SLED – Redundant Array of Inexpensive Disks – Single Large Expensive Disk • Idea behind RAID – Install a box full of disks next to the computer, typically a large server, replace the disk controller card with a RAID controller, copy the data over to RAID – RAID should look like a SLED to the operating system but have better performance and reliability – No software changes are required – Data are distributed over the drives to allow parallel operations 10 RAID 0-2 • RAID 0 – Striping: distribute data over multiple drives – No redundancy, not a really RAID • RAID 1 – Duplicate all disks – True RAID – “WRITE” the same – “READ” double – Good Fault tolterance • RAID 2 – On a word basis or a byte basis – 7-bit hamming code RAID levels 0 through 2. over 7 drives, 1 bit per Backup and parity disks are shown drive shaded. – Exactly synchronized 11 RAID 3-5 • RAID 3 – Simplified version of RAID level 2 – A single parity bit is computed for each data word and written to a parity drive • RAID 4 – Work with strips again – Not individual word with parity – Strip-to-Strip parity written onto the extra drive • RAID 5 – Distributed the parity bits uniformly over all drive – Eliminating the heavy load on the parity drive – Recovery is a complex in a drive RAID levels 3 through 5. crash Backup and parity disks are shown shaded. 12 Solid-State Disks A flash memory cell. NAND Type Flash Memory • Operations – Read / Write Page unit (Size of a page = Size of a sector (512B) in hard drive) – Erase: Block unit (a set of pages) • Characteristics – Not in-place update Erase an entire erase block for in-place update of page Original block Free block 1. Update page 0 2. Copy the rest of 3. Obsolete original in free block Pages (1,2,3,4) block 14 Compact Disc (CD) • CD Preparation – Use a high power infrared laser to burn 0.8-micron diameter holes in a coated glass master disk – Pit: depression in the polycarbonate substrate – Land: unburned areas – Pit/land or land/pit transition is 1 and otherwise 0 • Rotation Rate – Constant linear velocity, which different from magnetic disk with constant angular velocity Recording structure of a Compact Disk or CD-ROM. 15 CD-ROMs Logical data layout on a CD-ROM (Sector) • Mode 1 – 16 bytes preamble, 2048 bytes data, 288 bytes error-correcting code – It takes 98 frames of 588 bits (7203 bytes) to carry a single 2048-byte payload, an efficiency of only 28 percent. – Single Speed CD-ROM: 75 sectors/sec, so data rate: 75*2048=153,600 bytes/sec – 74 minutes audio CD: Capacity: 74*60*153,600=681,984,000 bytes ~=650 MB • Mode 2 – 2336 bytes data for a sector, 75*2336=175,200 bytes/sec 16 CD-Recordables Cross section of a CD-R disk and laser (not to scale). A CD-ROM has a similar structure, except without the dye layer and with a pitted aluminum layer instead of a reflective layer. 17 Exercise • Ex 1: TRUE OR FALSE, Why? – The Hamming distance between 00001001 and 10011001 is 3 – Answer: F – Reason: 2 18 Exercise • Ex 2: Which of following is true for the CD and magnetic disk? – (a) CD has constant linear velocity – (b) CD has constant angular velocity – (c) Magnetic Disk has constant linear velocity – (d) Magnetic Disk has constant angular velocity – Answer: [a, d] 19 Exercise • Ex 3: In a mode-1 CD-ROM, each sector includes a 16 bytes preamble, 1000 bytes data, and 108 bytes error-correcting code. – If the CD-ROM has speed 32 sectors/sec, so what is data rate? – Answer: – 32*1000=32,000 bytes/second 20 Exercise • Ex 4: In a mode-1 CD-ROM, each sector includes a 16 bytes preamble, 2000 bytes data, and 208 bytes error-correcting code. – If the CD-ROM has speed 100 sectors/sec, so what is data rate? – Answer: – 100*2000=200,000 bytes/second 21 Exercise • Ex 5: In a mode-1 CD-ROM, each sector includes a 16 bytes preamble, 2000 bytes data, and 208 bytes error-correcting code. – If this CD is a 100-minute audio CD and it has speed 100 sectors/sec, so what is its data capacity? – Answer: – 100*60*2000*100=1,200,000,000 bytes 22.