Date: Mon, 31 Jan 2011 03:30:11 +0000
From: classiccmp at philpem.me.uk
To: cctalk at
classiccmp.org
Subject: Any error correction gurus in the audience?
Hi guys,
As the subject says: are there any EDC/ECC code experts hanging around
on the list?
I'm working on implementing the 4-byte (32-bit) ECC code Western Digital
used on the WD2010 Winchester HDD Controller IC. This appears to be an
implementation of the ECC scheme explained in section 7.6 of National
Semiconductor's "Disk Interface Design Guide and User's Manual"
(appnote
AN-413).
It looks like the ECC scheme is based on running a CRC forwards over the
data to produce a 32-bit CRC, which is used to validate the data in the
same way the 16-bit CRC validates the IDAM. Error correction apparently
operates by running the CRC in reverse using an "inverse polynomial". I
can't see how this could work -- isn't a CRC by its very nature a
one-way operation?
---snip---
Hi
The CRC operation is deterministic. That means one can play it forwards
and backward.
The are two main ways of doing the corrections. One is to break
it into its prime factors and use the part with the largest span of
zeros in the polynomial to determine the error mask and the other
partials to determine the offset, based on the Chinese remainder
theorum.
It is a little complicated to describe but is what most of the crc chips used.
The other method is what you are seeing, playing the crc backwards
with no data coming in ( zeros for the data ) until the eror mask is seen.
the applying that mask to the data.
What I mean by the error mask is that in the polynomial, there is
a span of zeros. If you play it backwards until there are zeros in
all but the center portion where the zeros are, you have found
the error mask. Shifting it until is would be at the input edge of the
polynomial would give you the offset.
When playing backwards, you are only un-inputting zeros.
To tell you how to do it, you do the shift and xor in reverse order.
Run a CRC with some data in the sum, with zeros as input data
forwardwards and you'll see how on one can run it backwards
by shift and xor to get the same values going backwards.
If you go beyond the data size backwards without finding
an error mask, the error burst was too large and could not
be corrected.
I hope this makes some sense?
Dwight