是否可以使用CRC进行基本的纠错? [英] Is it possible to do rudimentary error correction with CRC?

查看:61
本文介绍了是否可以使用CRC进行基本的纠错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道使用CRC的全部目的是进行错误检测,但是我听说有人指出,除了错误检测之外,它还可以用于进行基本的错误校正.我很好奇,如果是这样,那么它有多强大?我的意思是,我们通常将CRC称为能够执行x位检测的对象,但我很好奇它是否能够执行x位校正.如果是这样,这是如何工作的?谢谢.

I know the whole intention of using CRC is to do error detection, but I heard someone state that it can be used to do basic error correction in addition to error detection. I was curious if this was the case, and if so, how powerful is it? I mean, we usually refer to CRC as capable of performing x-bit detection, but I'm curious if it is capable of performing x-bit correction. If so, how does this work? Thanks.

推荐答案

可以通过CRC进行单比特纠错.假设其中一个具有CRC寄存器",并且具有一次仅向前和向后运行CRC算法一次的功能,而忽略传入数据

It is possible to do single-bit error correction with a CRC. Assume one has a CRC "register" and has functions to run the CRC algorithm forward and backward a bit at a time, ignoring incoming data


int crc_forward(int old_value, int data_bit)
{
  if (old_value & 0x8000)
    return ((old_value ^ 0x8000) SHL 1) ^ 0x1021 ^ data_bit;
  else
    return (old_value SHL 1) ^ data_bit;
}

int crc_reverse(int old_value)
{
  if (old_value & 1)
    return (old_value SHR 1) ^ 0x8810;
  else
    return old_value SHR 1;
}

假定有一个计算得出的数据包,因此将crc初始化为某个值并为每个位运行crc_forward(首先是MSB)应产生零.如果一个人获得的CRC值不为零,则可以反向运行该算法(忽略数据位),直到计算出的CRC值为1.这就是错误位的位置.

Suppose one has a packet which is computed so that initializing the crc to some value and running crc_forward for each bit (MSB first) should yield zero. If one gets a CRC value other than zero, one can run the algorithm in reverse (ignoring data bits) until the computed CRC value is 1. That's the location of the incorrect bit.

请注意,这种方法对于NAND闪存之类的软件错误校正可能就足够了.为了将其有效地用于硬件纠错,必须要么能够将读取操作延迟到可以处理ECC之前,要么需要一个综合症"值和位位置的表.

Note that this approach may be adequate for software error correction in things like NAND flash. To usefully employ it for hardware error correction, one would have to either be able to delay read operations until the ECC could be processed, or else one would need a table of 'syndrome' values and bit positions.

这篇关于是否可以使用CRC进行基本的纠错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆