What is ECC (error-correcting code)?

A scheme that adds redundant bits to data so that bit errors can be detected and corrected on readout. It is used in server memory, flash memory and inside DDR5 chips, among others.

Field: DRAM

Japanese name: ECC(誤り訂正符号)

From parity to SECDED

A single parity bit detects an odd number of flipped bits but cannot locate the error, and two flips cancel out. Hamming codes add several parity bits, each covering an overlapping subset of data bits; on readout the recomputed checks form a syndrome that points to a single erroneous bit so it can be flipped back. One more overall parity bit distinguishes a correctable single error from a detected-only double error: SECDED (single error correction, double error detection). Protecting 64 data bits takes 8 check bits, giving the familiar 72-bit memory word.

ECC in DRAM systems

ECC modules carry extra chips for the check bits: nine x8 chips form a 72-bit rank, and in DDR5 each 32-bit subchannel becomes 40 bits wide. The memory controller encodes on write and checks on read. DDR5 also adds on-die ECC, 8 check bits per 128 data bits inside each die, but it is invisible outside the chip and does not cover transfer errors, so it does not replace system ECC. Chipkill-type codes survive a whole failed chip, and controllers commonly scrub memory so single-bit errors are fixed before a second accumulates.

What ECC protects against

The classic target is the soft error: alpha particles from package materials or cosmic-ray neutrons generate charge that flips a bit without damaging the device, and neutron flux grows strongly with altitude. ECC also absorbs cells with variable retention time, occasional Rowhammer flips and stochastic STT-MRAM write failures. An error beyond the code's capability, such as a 2-bit error under SECDED, is reported as uncorrectable, and the system discards the data or moves to a safe state. Logging corrected errors helps spot failing parts early.

ECC beyond DRAM

NAND flash has much higher raw bit error rates, rising with program/erase wear and with more bits per cell, so controllers use stronger codes such as BCH or LDPC that correct many bits per block; Gray-coded state assignments keep a misread into a neighbouring state to one bit. Serial links use forward error correction (FEC) when signalling leaves little margin, as with PAM4 in PCI Express 6.0. In automotive chips the ECC logic is itself a safety mechanism, and a fault in it is a latent fault that BIST must find.

Try it: questions about ECC (error-correcting code)

What does an error-correcting code (ECC) used in memory do?

  1. ACompresses data to increase capacity
  2. BAdds redundant bits to data to detect and correct bit errors
  3. CEncrypts data
Show answer and explanation

Answer: B. Adds redundant bits to data to detect and correct bit errors

ECC adds check bits to data so errors can be detected and corrected on readout. Up to DDR4, server memory typically adds 8 bits to every 64, enabling single-error correction and double-error detection (SECDED); DDR5 modules add 8 bits (4 bits in some configurations) to each 32-bit subchannel. High-reliability servers go further with schemes such as Chipkill, which survives the failure of an entire chip. DDR5 also builds ECC into each DRAM die.

FAQ

What is the difference between ECC memory and DDR5 on-die ECC?

On-die ECC corrects single-bit errors inside each DRAM chip and outputs only corrected data, while ECC memory adds extra chips so the memory controller checks the whole word, including errors that occur on the bus. Servers rely on the latter even with DDR5.

Can SECDED ECC correct a 2-bit error?

No. It corrects any single-bit error and detects, but cannot correct, a 2-bit error, which is reported as uncorrectable. Stronger symbol-based codes such as Chipkill are needed to survive multi-bit failures from one chip.

How many check bits does ECC memory use for 64 bits of data?

Standard SECDED uses 8 check bits per 64 data bits, so each word is 72 bits wide. That is why an ECC module built from x8 chips has nine chips per rank instead of eight.

Questions that mention ECC (error-correcting code) (14)

ECC (error-correcting code) appears in 16 practice questions across 9 topics, including DRAM, Automotive Semiconductors and Functional Safety, Hardware Security.

  1. An automotive microcontroller's memory uses ECC (SEC-DED), which can correct 1-bit errors and detect 2-bit errors. What generally happens when read data contains a 2-bit error?
  2. What is wrong with the idea that "if ECC memory is used, there is no need to worry about Rowhammer"?
  3. When an even parity bit is added to the 7-bit data 1011001, what is the parity bit?
  4. Which correctly describes a soft error in memory?
  5. Which function, adopted in DDR5, corrects errors inside the DRAM chip?
  6. Some DRAM cells have a data retention time that irregularly switches between longer and shorter values over time. What is this phenomenon called?
  7. In multi-level (MLC or TLC) NAND flash, why are the bit patterns assigned to adjacent threshold-voltage states chosen to differ by only one bit?
  8. What design challenge arises from the probabilistic nature of writing in STT-MRAM?
  9. Which is the most appropriate example of a latent fault in ISO 26262?
  10. What is the main functional safety purpose of running logic BIST and memory BIST in an automotive microcontroller at power-up or before driving?
  11. In which environment is the rate of soft errors caused by cosmic-ray neutrons higher?
  12. Why does forward error correction (FEC) become more important with PAM4 than with NRZ?
  13. Which is a countermeasure against DRAM Rowhammer?
  14. Why is error correction (such as helper data) combined with PUFs when deriving keys?

Books on DRAM Ad

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary