Re: Ecc Size
- From: "Rufus V. Smith" <nospam@xxxxxxxxxx>
- Date: Mon, 29 Aug 2005 12:16:48 -0400
"Gromer" <osIndgy@xxxxxxxxx> wrote in message
news:1124893299.731162.52790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I was browsing thru the net and could find no documents on ECC
> implementation (algorithm) calculation of the size of ECC for a
> specific Nand Device.
>
> Like if i have a flash Device (nand) of 512MiB, then how is the ecc
> size calculated. Any pointers or PDFs or links would be highly
> appreciable.
>
> Thanks in advance,
> Gromer
>
Remember, when using an ECC code, the number of bits must be
twice as large as the number of bits required to provide a
"bit address" of a single bit error.
This is because the ECC is calculated basically as odd
parity bit for different groupings of bits in the data block.
One bit is the parity of all even-numbered bits
One bit is the parity all odd-numbered bits
One bit is the parity of all bits with bit address bit 1 = 0
One bit is the parity of all bits with bit address bit 1 = 1
One bit is the parity of all bits with bit address bit 2 = 0
One bit is the parity of all bits with bit address bit 2 = 1
etc..
The upshot of this, is that if you compare the ECC you generate
from the data to the ECC stored with the data, they should be
equal if the data has no error (never mind that multiple bit
errors could cause identical ECC's). If there is a single bit error
in the data, the XOR of the generated and read ECC's will return
a number with each pair of bits being 10 or 01 (The bad bit only
being present in one of the bit groupings). If you extract
all the odd number bits (or the complement of the even bits, same
thing) you will get the bit address of the bad bit. Neat, huh?
Additionally, if all bit pairs but one are 10 and 01, that tells
you the single bit error was in the ECC. (the bit in the bad bit
pair).
Other mismatches mean 2 or more bits are in error. Three bits
or more bad could look like no error or correctible one bit error.
So I guess your answer is: 2*n, where 2^n is the number of bits
in the data.
But you don't do an ECC over the entire chip, as the question
seems to indicate. Each block has it's own ECC. Errors are
much more prevalent than a single bit per chip.
256 byte data (2048 bits) has a 22 bit ECC. 2048=2^11. 2*11=22
512 byte data (4096 bits) has a 24 bit ECC. 4096=2^12. 2*12=24
Rufus
I don't have my links handy right now, I'll try to remember...
.
- Follow-Ups:
- Re: Ecc Size
- From: David Tweed
- Re: Ecc Size
- References:
- Ecc Size
- From: Gromer
- Ecc Size
- Prev by Date: Re: onboard EROM PXE programming in windows
- Next by Date: Re: can imperfect power reset damage flash programmable HC08 ?
- Previous by thread: Re: Ecc Size
- Next by thread: Re: Ecc Size
- Index(es):
Relevant Pages
|