The fundamental formula for a Hamming coding is as below:


Where k = # of parity bits and n = data bits

In a DDR system with ECC feature, every data byte will generate an additional ECC bit which makes a byte data 9 bits long.

However, if simply applying the Hamming code formula here, 8 bits of data will require 4 parity bits which will make the encoded data 12 bits long.

In this case, how can the DDR ECC feature be realized with the Hamming coding scheme?

  • \$\begingroup\$ It's trivial to understand by using a venn diagram or a concept related to packing spheres, in this case. \$\endgroup\$
    – jonk
    Sep 27, 2020 at 12:41

3 Answers 3


The ECC is not performed on an individual byte basis.

Usually, 8 bytes are combined with one parity bit per byte. Giving a total of 72 bits.

Since only 7 parity bits are needed to correct single-bit errors and 8 are available the extra bit can be used to detect double bit errors, although not correct the error.

Hamming code

Hamming Codes With Additional Parity

  • \$\begingroup\$ So every additional bit generated from a byte data is simply a parity result from that particular 8 bits data? \$\endgroup\$
    – Learner
    Sep 27, 2020 at 13:06
  • 4
    \$\begingroup\$ @Learner - no. The parity bits have to come from a combination of bits among multiple bytes. \$\endgroup\$ Sep 27, 2020 at 13:09
  • \$\begingroup\$ Looking at the algorithm table from the Wikipedia, supposed 64 bits data only require 7 parity bits. Technically, can i say that the parity #8 in a DDR symbol is redundant? \$\endgroup\$
    – Learner
    Sep 27, 2020 at 13:26
  • 1
    \$\begingroup\$ @Learner - it adds the capability of detecting double-bit errors. \$\endgroup\$ Sep 27, 2020 at 19:43

DDR4 is not byte accessable. Each address has 64 bits or 8 bytes. The ECC makes each symbol 72 bits wide.

  • \$\begingroup\$ that's mean the 2^k≥n+k+1 formula still valid for this? 2^8 >= 64+8+1 \$\endgroup\$
    – Learner
    Sep 27, 2020 at 13:09
  • 3
    \$\begingroup\$ @Learner No, 2^7 ≥ 64+7+1. When ECC is used for DDR RAM, there are usually a multiple of 9 chips (usually 9 chips with 8 bits per chip). Thus, there are 72 bits available: 64 bits for the data, 7 bits for the Hamming code and 1 bit which is often used as a parity bit to detect double bit errors. \$\endgroup\$
    – Toothbrush
    Sep 27, 2020 at 22:22

as far as I know, ECC with DDRam only can correct single bit errors.

  • 5
    \$\begingroup\$ That's true for the usual SECDED scheme but there are others. \$\endgroup\$
    – user16324
    Sep 27, 2020 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.