5.5. ERROR CHECKING
Ensuring the integrity of data stored in memory is an important aspect of memory design. Two primary means of accomplishing this are parity and error correction code (ECC).
Historically, parity has been the most commonly used data integrity method. Parity can detect - but not correct - single-bit errors. Error Correction Code (ECC) is a more comprehensive method of data integrity checking that can detect and correct single-bit errors.
Fewer and fewer PC manufacturers are supporting data integrity checking in their designs. This is due to a couple of factors. First, by eliminating support for parity memory, which is more expensive than standard memory, manufacturers can lower the price of their computers. Fortunately, this trend is complemented by the second factor: that is, the increased quality of memory components available from certain manufacturers and, as a result, the relative infrequency of memory errors.
The type of data integrity checking depends on how a given computer system will be used. If the computer is to play a critical role - as a server, for example - then a computer that supports data integrity checking is an ideal choice. In general:
- Most computers designed for use as high-end servers support ECC memory.
- Most low-cost computers designed for use at home or for small businesses support non-parity memory.
PARITYWhen parity is in use on a computer system, one parity bit is stored in DRAM along with every 8 bits (1 byte) of data. The two types of parity protocol - odd parity and even parity - function in similar ways.
With normal parity, when 8 bits of data are written to DRAM, a corresponding parity bit is written at the same time. The value of the parity bit (either a 1 or 0) is determined at the time the byte is written to DRAM, based on an odd or even quantity of 1s. Some manufacturers use a less expensive "fake parity" chip. This chip simply generates a 1 or a 0 at the time the data is being sent to the CPU in order to accommodate the memory controller. (For example, if the computer uses odd parity, the fake parity chip will generate a 1 when a byte of data containing an even number of 1s is sent to the CPU. If the byte contains an odd number of 1s, the fake parity chip will generate a 0.) The issue here is that the fake parity chip sends an "OK" signal no matter what. This way, it "fools" a computer that's expecting the parity bit into thinking that parity checking is actually taking place when it is not. The bottom line: fake parity cannot detect an invalid data bit.
This table shows how odd parity and even parity work. The processes are identical but with opposite attributes.
ODD PARITY EVEN PARITY Step 1 The parity bit will be forced to 1 (or turned "on") if its corresponding byte of data contains an even number of 1's.
If the byte contains an odd number of 1's, the parity bit is forced to 0 (or turned "off ").
The parity bit is forced to 0 if the byte contains an even number of 1's.
The parity bit is forced to 1 if its corresponding byte of data contains an odd number of 1's.
Step 2 The parity bit and the corresponding 8 bits of data are written to DRAM. (Same as for odd parity) Step 3 Just before the data is sent to the CPU, it is intercepted by the parity circuit.
If the parity circuit sees an odd number of 1's, the data is considered valid. The parity bit is stripped from the data and the 8 data bits are passed on to the CPU.
If the parity circuit detects an even number of 1's, the data is considered invalid and a parity error is generated.
(Same as for odd parity)
Data is considered valid if the parity circuit detects an even number of 1's.
Data is invalid if the parity circuit detects an odd number of 1's.
Parity does have its limitations. For example, parity can detect errors but cannot make corrections. This is because the parity technology can't determine which of the 8 data bits are invalid.
Furthermore, if multiple bits are invalid, the parity circuit will not detect the problem if the data matches the odd or even parity condition that the parity circuit is checking for. For example, if a valid 0 becomes an invalid 1 and a valid 1 becomes an invalid 0, the two defective bits cancel each other out and the parity circuit misses the resulting errors. Fortunately, the chances of this happening are extremely remote.
ECCError Correction Code is the data integrity checking method used primarily in high-end PCs and file servers. The important difference between ECC and parity is that ECC is capable of detecting and correcting 1-bit errors. With ECC, 1-bit error correction usually takes place without the user even knowing an error has occurred. Depending on the type of memory controller the computer uses, ECC can also detect rare 2-, 3-, or 4-bit memory errors. While ECC can detect these multiple-bit errors, it cannot correct them. However, there are some more complex forms of ECC that can correct multiple bit errors.
Using a special mathematical sequence, algorithm, and working in conjunction with the memory controller, the ECC circuit appends ECC bits to the data bits, which are stored together in memory. When the CPU requests data from memory, the memory controller decodes the ECC bits and determines if one or more of the data bits are corrupted. If there's a single-bit error, the ECC circuit corrects the bit. In the rare case of a multiple-bit error, the ECC circuit reports a parity error.
|This is an original HTML version of THE ULTIMATE MEMORY GUIDETM reproduced by permission. This publication is the sole property of Kingston Technology and may not be copied or modified in part or in whole without the express permission of Kingston Technology. The original THE ULTIMATE MEMORY GUIDETM is © 2000 Kingston Technology Company, Inc. All rights reserved. All trademarks and registered trademarks are the property of their respective owners. --- Kingston Technology Company, 17600 Newhope Street, Fountain Valley, CA 92708 USA (714) 435-2600 Fax (714) 435-2699 --- Kingston Technology Europe, Inc., Kingston Court, Sunbury-on-Thames, Middlesex TW16 7EP, England.|