Search

A technology, a device or an article

Why extra bits can repair an error—and what ECC cannot promise

One binary example explains extended Hamming coding, the exact SECDED guarantee, and the difference between a protected codeword and a trustworthy computer.

A botanical metaphor of repairing a damaged pattern to illustrate error correction.
A botanical metaphor of repairing a damaged pattern to illustrate error correction. Conceptual illustration created with AI.ITNWS · Original ITNWS AI-assisted editorial illustration

If only data bits are stored, a wrongly read zero looks exactly like a correct zero. The receiver has nothing against which to check it. Even a number implausible to a human remains a legitimate bit pattern. Detecting change requires giving up some freedom beforehand: the encoder must permit only sequences satisfying known relationships. Redundancy creates a distinction between an arbitrary sequence and one that could have come from the encoder. Correction requires something further: identifying which permitted word was originally sent. That is a mathematical problem with explicit assumptions, rather than a computer’s general ability to guess the intended contents of a document or calculation.

ECC means error-correcting code, a family of methods with different capabilities. SECDED promises single-bit correction and double-bit detection within a protected codeword. Intel’s ALTECC documentation describes encoding with check bits and producing a syndrome during decoding. We can demonstrate the reasoning without pretending that our small example reproduces a commercial memory device.

Parity alone knows too little

An even-parity bit is chosen to make the total number of ones in its group even. Changing one bit breaks that relationship. Parity alone cannot identify whether a data bit or the check bit changed, however. Two changes can restore even parity. Detecting a single change therefore does not establish the ability to correct it. XOR provides convenient notation: its result is one for an odd number of input ones. A valid even-parity group produces zero. Overlapping groups can be arranged so that each position participates in a unique combination of checks. Their combined results then identify the changed position, provided only one bit actually changed.

The unit here is a bit, not a chip. One physical device failure can affect several bits within the same word. SECDED’s single-error guarantee does not mean protection against any single faulty component. Discussing complete chip failure requires the actual data organisation and the particular system’s documented correction capability, rather than the acronym alone.

Constructing one small word

Our teaching example uses an extended Hamming code with four data bits and four check bits. It is not a DDR5 format. Take the payload 1011. Bit order matters here, rather than the sequence’s decimal value. Positions in the complete codeword will be numbered from left to right, starting at one. Place check bits p1, p2 and p4 at positions 1, 2 and 4. The data occupies positions 3, 5, 6 and 7 in its original order. Position 8 supplies overall even parity. Powers of two make useful check positions because their numbers correspond to individual binary address bits in the position number.

One teaching example: payload 1011
Position from the left Role Stored bit
1 p1 0
2 p2 1
3 First data bit 1
4 p4 0
5 Second data bit 0
6 Third data bit 1
7 Fourth data bit 1
8 Overall parity 0

Check p1 covers positions 1, 3, 5 and 7. Its data contains two ones, so p1 is zero. Check p2 covers 2, 3, 6 and 7: three data ones require p2 to be one. Check p4 covers 4, 5, 6 and 7, requiring zero. The first seven positions contain four ones, so overall parity is zero.

The resulting codeword is 01100110. Its checks are neither another complete copy of the payload nor a ready answer to every possible fault. They express relationships among positions. Changing data while retaining the old check values can violate those relationships. The extra storage creates evidence against which the received state can be examined.

A geometric composition about disrupted and restored integrity.
A geometric composition about disrupted and restored integrity. Conceptual illustration created with AI. — ITNWS · Original ITNWS AI-assisted editorial illustration

Now let position 6 change from one to zero. Check p1 excludes it and still passes; p2 and p4 include it and fail. Write their results in the order p4, p2, p1: the syndrome is 110, binary six. Overall parity fails too, consistent with an odd number of changes within the word. Under the single-error assumption, the decoder flips position 6 back and recovers the payload. It has not guessed anything about the file’s meaning. It has applied the code’s construction and the stated limit on changes. Notice that the syndrome’s written bit order was defined explicitly; it differs from listing the checks from left to right.

Detection is not correction

Suppose instead that two distinct bits change within that word. Overall parity remains even, while the overlapping checks reveal a discrepancy. The combination permits double-error detection but does not identify one uniquely recoverable original pair of positions. SECDED cannot promise to restore the payload in that case, despite providing useful evidence of damage. This boundary matters operationally. Blindly flipping the position indicated by a nonzero syndrome, without considering overall parity, can turn a double error into further damage. A correction algorithm has a defined domain. Beyond it, reporting that recovery is not guaranteed is preferable to confidently manufacturing a different incorrect word and presenting it as repaired data.

Hamming distance gives the general explanation: count positions in which two permitted words differ. Sufficient separation leaves a slightly damaged word closest to only one original. Single-error correction requires minimum distance at least three. Adding overall parity to this example produces distance four, enabling a decoder to distinguish single errors from double errors within the stated model. The guarantee concerns the specified number of changed bits in one word. A triple error can resemble a single error and trigger miscorrection. Some larger changes can turn one permitted word into another. “Double-error detecting” does not mean detecting every event containing two or more errors, and must not be silently expanded into that much stronger claim. Absence of a detected error is consequently different from proof that nothing changed. The code admits a particular set of words. If corruption produces another member of that set, this check alone cannot establish its history. A quiet log does not widen the mathematical guarantee beyond the error patterns that the code was designed to distinguish.

How many positions can checks distinguish?

A collection of r binary checks has 2^r possible outcomes. Reserve one for no detected error; the others must distinguish every possible single-error position. With m data bits and r check bits, there are m + r positions. A necessary condition for this construction is therefore 2^r ≥ m + r + 1. For four data bits, three basic checks provide exactly eight syndromes: no single error and seven possible positions. Overall parity is added for a different distinction. It separates situations that the original checks cannot separate. More check bits without an appropriate arrangement would not suffice; their relationships with the data are the substance of the code. This arithmetic does not require a neighbouring check bit for every data bit. The number of possible check outcomes grows exponentially. Longer codes can therefore have lower relative redundancy. Their implementation, latency and protected error patterns still matter. The inequality alone cannot identify an optimal memory code or establish every practical feature of its decoder. Even overhead percentages require a denominator. Four additional bits per four data bits constitute 100% extra storage relative to the payload. Those checks occupy 50% of the complete eight-bit word. Both statements are correct, because their denominators differ. Confusing them would distort a discussion of usable capacity, storage overhead or the cost of implementing protection.

A syndrome is a result of relationships, rather than an unconditional address of a fault. For one changed bit, our check construction made it coincide with that position. Multiple errors combine through XOR and can point elsewhere. That is why additional information and assumptions about error count are essential before a decoder chooses to modify received data.

“Codeword” must also remain in the SECDED definition. Two errors in separate words can be independently correctable single errors. Two in the same word require detection without a recovery promise. The same total count of changed bits can therefore produce different outcomes. Which positions were protected together is part of the technical question, rather than an optional detail. Word size and placement connect the abstract code to physical memory. A defect affecting several positions may break the single-error assumption. Its consequences differ if those bits belong to separate protected words. A bit and a chip cannot be substituted for each other in a guarantee simply because both describe one item at their respective scales.

Redundancy does not provide a timestamp or a physical explanation. Our code checks the received state without identifying when or why it changed. Hardware and system observations address those questions. Mathematics describes distinguishability between words; diagnostics investigates events. Their conclusions complement one another while retaining different evidential limits and different requirements for establishing a cause.

DDR5 makes a specific promise

The teaching example stores as many checks as data bits. Real implementations use longer words and different arrangements. Neither its overhead percentage nor its p1, p2, p4 layout should be transferred to a DIMM specification. These choices make the reasoning visible; they are not a drawing of a production chip or controller. Micron describes DDR5 on-die ECC as SEC over 128 data bits plus eight check bits. SEC means single-error correction; DED cannot automatically be appended. Correction within the die is a narrower claim than protection of the complete exchange between memory and processor. A shared acronym does not erase that difference in scope. Protection operates where data was encoded, redundancy retained and decoding performed. A fault outside that region does not become detectable by the chip’s internal code merely because it happened in a memory system. Kingston’s DDR5 overview treats on-die correction separately from system ECC support. Their names overlap; their protected boundaries do not automatically coincide.

System protection requires compatible controller, module and platform support. Micron lists a DDR5 RDIMM as x80 ECC, for example. That documents one product; it does not authorise its use in every DDR5 socket. The supported configuration and actually enabled mode determine what a particular system can claim.

The same reasoning explains a software limit. If an application submits the wrong value and the encoder correctly generates checks for it, the result is a valid codeword. ECC protects representation within its defined scope. It does not know the intended accounting total or simulation result. Program correctness needs evidence that parity relationships cannot supply.

What a correction report establishes

Linux EDAC documentation distinguishes corrected and uncorrected events. A corrected event reports handling by the available hardware mechanism. It does not uniquely identify the physical cause or justify condemning one module from one message. Error correction and fault attribution remain different operations, even when presented within the same monitoring interface. Repetition, addresses, component labels and operating circumstances inform further analysis. Reports also depend on what controllers and drivers expose. A zero counter does not prove absence of every possible memory error; it may describe absence of registered events within one available observation mechanism. Interpreting it requires knowing what that mechanism actually observes.

An uncorrected event need not mean an immediate whole-system crash. Consequences depend on the affected information and platform and OS capabilities. Preserve the message’s precise meaning rather than replacing it with “healthy” or “dead.” The decoder’s mathematical limit and the operating system’s response are related facts, but neither can substitute for the other.

Return to the indistinguishable zeros. ECC adds information that makes specific conclusions possible. Its value rests in that precision: correcting what it can distinguish within its scope, reporting some failures it cannot repair, and leaving everything else outside the proof. Calling that bounded promise limited does not diminish it; it explains why the promise can be trusted.

Sources & documentation

  1. Intel ALTECC: SECDED encoder and decoder ↗
  2. Micron: DDR5 SDRAM features ↗
  3. Kingston: DDR5 memory overview ↗
  4. Linux kernel: EDAC devices ↗
  5. Micron: 64GB x80 ECC RDIMM specification ↗