error detection and correction. Each byte in a memory system may have a
parity bit associated with it that records whether the numbers of bits in the
byte that are set to 1 is even (parity = 0) or odd (parity = 1). If one of the bits
in the byte gets damaged (either a 1 becomes a 0, or a 0 becomes a 1), the
parity of the byte changes and thuswill not match the stored parity. Similarly,
if the stored parity bit gets damaged, it will not match the computed parity.
Thus, all 1-bit errorswill be detected by the memory system. Error-correcting
schemes store 2 or more extra bits, and can reconstruct the data if a single bit
gets damaged.
The idea of error-correcting codes can be used directly in disk arrays by
striping bytes across disks. For example, the first bit of each byte could be
stored in disk 0, the second bit in disk 1, and so on until the eighth bit is
stored in disk 7, and the error-correction bits are stored in further disks.
Figure 10.3c shows the level 2 scheme. The disks labeled P store the errorcorrection
bits. If one of the disks fails, the remaining bits of the byte and the
associated error-correction bits can be read fromother disks, and can be used
to reconstruct the damaged data. Figure 10.3c shows an array of size 4; note
RAID level 2 requires only three disks’ overhead for four disks of data, unlike
RAID level 1, which required four disks’ overhead.