CHAPTER 13

CHAPTER 13 CHAPTER 13

scp.s.scptuj.mb.edus.si
from scp.s.scptuj.mb.edus.si More from this publisher
18.08.2013 Views

698 Chapter 13 Optical Storage Handling Errors Handling errors was a big part of the original Red Book CD standard. CDs use parity and interleaving techniques called cross-interleave Reed-Solomon code (CIRC) to minimize the effects of errors on the disk. This works at the frame level. When being stored, the 24 data bytes in each frame are first run through a Reed-Solomon encoder to produce a 4-byte parity code called “Q” parity, which then is added to the 24 data bytes. The resulting 28 bytes are then run though another encoder that uses a different scheme to produce an additional 4-byte partity value called “P” parity. These are added to the 28 bytes from the previous encoding, resulting in 32 bytes (24 of the original data plus the Q and P parity bytes). An additional byte of subcode (tracking) information is then added, resulting in 33 bytes total for each frame. Note that the P and Q parity bytes are not related to the P and Q subcodes mentioned earlier. To minimize the effects of a scratch or physical defect that would damage adjacent frames, several interleaves are added before the frames are actually written. Parts of 109 frames are cross-interleaved (stored in different frames and sectors) using delay lines. This scrambling decreases the likelihood of a scratch or defect affecting adjacent data because the data is actually written out of sequence. With audio CDs and CD-ROMs, the CIRC scheme can correct errors up to 3,874 bits long (which would be 2.6mm in track length). In addition, for audio CDs, only the CIRC can also conceal (through interpolation) errors up to 13,282 bits long (8.9mm in track length). Interpolation is the process in which the data is estimated or averaged to restore what is missing. That would of course be unacceptable on a CD-ROM data disc, so this applies only to audio discs. The Red Book CD standard defines the block error rate (BLER) as the number of frames (98 per sector) per second that have any bad bits (averaged over 10 seconds) and requires that this be less than 220. This allows a maximum of up to about 3% of the frames to have errors, and yet the disc will still be functional. An additional layer of error detection and correction circuitry is the key difference between audio CD players and CD-ROM drives. Audio CDs convert the digital information stored on the disc into analog signals for a stereo amplifier to process. In this scheme, some imprecision is acceptable because it would be virtually impossible to hear in the music. CD-ROMs, however, can’t tolerate any imprecision. Each bit of data must be read accurately. For this reason, CD-ROM discs have a great deal of additional ECC information written to the disc along with the actual stored information. The ECC can detect and correct most minor errors, improving the reliability and precision to levels that are acceptable for data storage. In the case of an audio CD, missing data can be interpolated—that is, the information follows a predictable pattern that enables the drive to guess the missing values. For example, if three values are stored on an audio disc, say 10, 13, and 20 appearing in a series, and the middle value is missing— because of damage or dirt on the CD’s surface—you could interpolate a middle value of 15, which is midway between 10 and 20. Although this might not be exactly correct, in the case of audio recording, it will not be noticeable to the listener. If those same three values appear on a CD-ROM in an executable program, there is no way to guess at the correct value for the middle sample. Interpolation can’t work because executable program instructions or data must be exact; otherwise, the program will crash or improperly read data needed for a calculation. Using the previous example with a CD- ROM running an executable program, to guess 15 is not merely slightly off, it is completely wrong. In a CD-ROM on which data is stored instead of audio information, additional information is added to each sector to detect and correct errors as well as to identify the location of data sectors more accurately. To accomplish this, 304 bytes are taken from the 2,352 that originally were used for audio data and are instead used for sync (synchronizing bits), ID (identification bits), ECC, and EDC information. This leaves 2,048 bytes for actual user data in each sector. Just as when reading an audio CD, on a 1x (standard speed) CD-ROM, sectors are read at a constant speed of 75 per second. This results in a standard CD-ROM transfer rate of 2,048 × 75 = 153,600 bytes per second, which is expressed as either 153.6KB/sec or 150KiB/sec.

What Is a CD-ROM? Chapter 13 699 CD Capacity Because a typical disc can hold a maximum of 74 minutes of data, and each second contains 75 blocks of 2,048 bytes each, you can calculate the absolute maximum storage capacity of a CD-ROM at 681,984,000 bytes—rounded as 682MB (megabytes) or 650MiB (mebibytes). Table 13.3 shows the structure and layout of each sector on a CD-ROM on which data is stored. Table 13.3 CD-ROM Sector Information and Capacity Each Data Sector (Mode 1): 74-minute 80-minute -------------------------------------------------------------------------------------------------- Q+P parity bytes 784 784 Subcode bytes 98 98 -------------------------------------------------------------------------------------------------- Sync bytes 12 12 Header bytes 8 8 ECC/EDC bytes 284 284 -------------------------------------------------------------------------------------------------- Data bytes 2,048 2,048 -------------------------------------------------------------------------------------------------- Bytes/sector RAW (unencoded) 3,234 3,234 Actual CD-ROM Data Capacity: -------------------------------------------------------------------------------------------------- B 681,984,000 737,280,000 KiB 666,000 720,000 KB 681,984 737,280 MiB 650.39 703.13 MB 681.98 737.28 B = Byte (8 bits) MiB = Mebibyte (1,048,576 bytes) KB = Kilobyte (1,000 bytes) ECC = Error correction code KiB = Kibibyte (1,024 bytes) MB = Megabyte (1,000,000 bytes) EDC = Error detection code This information assumes the data is stored in Mode 1 format, which is used on virtually all data discs. You can learn more about the Mode 1/Mode 2 formats in the section on the Yellow Book and XA standards later in this chapter. With data sectors, you can see that out of 3,234 actual bytes per sector, only 2,048 are actual CD-ROM user data. Most of the 1,186 other bytes are used for the intensive error detection and correction schemes to ensure error-free performance. Data Encoding on the Disc The final part of how data is actually written to the CD is very interesting. After all 98 frames are composed for a sector (whether audio or data), the information is then run through a final encoding process called EFM (eight to fourteen modulation). This scheme takes each byte (8 bits) and converts it into a 14-bit value for storage. The 14-bit conversion codes are designed so that there are never less than 2 or more than 10 adjacent 0 bits. This is a form of Run Length Limited (RLL) encoding called RLL 2,10 (RLL x,y where x = the minimum and y = the maximum run of 0s). This is designed to prevent long strings of 0s, which could more easily be misread, as well as to limit the minimum and maximum frequency of transitions actually placed on the recording media. With as few as 2 or as many as 10 0 bits separating 1 bits in the recording, the minimum distance between 1s is three bit

698 Chapter <strong>13</strong> Optical Storage<br />

Handling Errors<br />

Handling errors was a big part of the original Red Book CD standard. CDs use parity and interleaving<br />

techniques called cross-interleave Reed-Solomon code (CIRC) to minimize the effects of errors on the disk.<br />

This works at the frame level. When being stored, the 24 data bytes in each frame are first run<br />

through a Reed-Solomon encoder to produce a 4-byte parity code called “Q” parity, which then is<br />

added to the 24 data bytes. The resulting 28 bytes are then run though another encoder that uses a<br />

different scheme to produce an additional 4-byte partity value called “P” parity. These are added to<br />

the 28 bytes from the previous encoding, resulting in 32 bytes (24 of the original data plus the Q and<br />

P parity bytes). An additional byte of subcode (tracking) information is then added, resulting in 33<br />

bytes total for each frame. Note that the P and Q parity bytes are not related to the P and Q subcodes<br />

mentioned earlier.<br />

To minimize the effects of a scratch or physical defect that would damage adjacent frames, several<br />

interleaves are added before the frames are actually written. Parts of 109 frames are cross-interleaved<br />

(stored in different frames and sectors) using delay lines. This scrambling decreases the likelihood of a<br />

scratch or defect affecting adjacent data because the data is actually written out of sequence.<br />

With audio CDs and CD-ROMs, the CIRC scheme can correct errors up to 3,874 bits long (which<br />

would be 2.6mm in track length). In addition, for audio CDs, only the CIRC can also conceal<br />

(through interpolation) errors up to <strong>13</strong>,282 bits long (8.9mm in track length). Interpolation is the<br />

process in which the data is estimated or averaged to restore what is missing. That would of course be<br />

unacceptable on a CD-ROM data disc, so this applies only to audio discs. The Red Book CD standard<br />

defines the block error rate (BLER) as the number of frames (98 per sector) per second that have any<br />

bad bits (averaged over 10 seconds) and requires that this be less than 220. This allows a maximum of<br />

up to about 3% of the frames to have errors, and yet the disc will still be functional.<br />

An additional layer of error detection and correction circuitry is the key difference between audio CD<br />

players and CD-ROM drives. Audio CDs convert the digital information stored on the disc into analog<br />

signals for a stereo amplifier to process. In this scheme, some imprecision is acceptable because it<br />

would be virtually impossible to hear in the music. CD-ROMs, however, can’t tolerate any imprecision.<br />

Each bit of data must be read accurately. For this reason, CD-ROM discs have a great deal of<br />

additional ECC information written to the disc along with the actual stored information. The ECC<br />

can detect and correct most minor errors, improving the reliability and precision to levels that are<br />

acceptable for data storage.<br />

In the case of an audio CD, missing data can be interpolated—that is, the information follows a predictable<br />

pattern that enables the drive to guess the missing values. For example, if three values are<br />

stored on an audio disc, say 10, <strong>13</strong>, and 20 appearing in a series, and the middle value is missing—<br />

because of damage or dirt on the CD’s surface—you could interpolate a middle value of 15, which is<br />

midway between 10 and 20. Although this might not be exactly correct, in the case of audio recording,<br />

it will not be noticeable to the listener. If those same three values appear on a CD-ROM in an<br />

executable program, there is no way to guess at the correct value for the middle sample. Interpolation<br />

can’t work because executable program instructions or data must be exact; otherwise, the program<br />

will crash or improperly read data needed for a calculation. Using the previous example with a CD-<br />

ROM running an executable program, to guess 15 is not merely slightly off, it is completely wrong.<br />

In a CD-ROM on which data is stored instead of audio information, additional information is added<br />

to each sector to detect and correct errors as well as to identify the location of data sectors more accurately.<br />

To accomplish this, 304 bytes are taken from the 2,352 that originally were used for audio data<br />

and are instead used for sync (synchronizing bits), ID (identification bits), ECC, and EDC information.<br />

This leaves 2,048 bytes for actual user data in each sector. Just as when reading an audio CD, on<br />

a 1x (standard speed) CD-ROM, sectors are read at a constant speed of 75 per second. This results in a<br />

standard CD-ROM transfer rate of 2,048 × 75 = 153,600 bytes per second, which is expressed as either<br />

153.6KB/sec or 150KiB/sec.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!