CRC除数计算
我试图理解 CRC,但我对如何计算“除数”感到困惑。
在 wikipedia 上的示例中,输入 11010011101100 时除数为 11 (1011
11010011101100 000 <--- input left shifted by 3 bits
1011 <--- divisor (4 bits) = x³+x+1
------------------
01100011101100 000 <--- result
)除数计算?在这个例子中 (x3+x+1) x 是 2? 2从哪里来?
Im trying to understand CRC and I'm getting confused as how to calculate the 'divisor'.
In the example on wikipedia the divisor is 11 (1011) for input of 11010011101100
11010011101100 000 <--- input left shifted by 3 bits
1011 <--- divisor (4 bits) = x³+x+1
------------------
01100011101100 000 <--- result
How is the divisor calculated? In this example (x³+x+1) x is 2? Where did the 2 come from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从同一个维基百科的“CRC 数学”部分开始,“对这种除法过程的数学分析揭示了如何选择保证良好错误检测特性的除数。”这是关键。有些除数比其他除数更好,因此您只需找到一个标准除数并通常使用即可。
该页面的底部描述了所使用的一些不同的 CRC 以及定义其除数的多项式。
From the "Mathematics of CRC" section of that same wikipedia it starts "Mathematical analysis of this division-like process reveals how to pick a divisor that guarantees good error-detection properties." This is the key to it. Some divisors are better than others so you just find a standard one and use that usually.
The bottom of that page describes some of the different CRCs used and the polynomial that defines their divisors.
它写在下一句话@wikipedia:
这意味着:
It's written in the next sentence @wikipedia:
Which means:
二进制的除数就是其多项式的系数。 x^3 + x + 1 = 1x^3 + 0x^2 + 1x +11;读出系数得到 1 0 1 1
The divisor in binary is just the coefficients of its polynomial. x^3 + x + 1 = 1x^3 + 0x^2 + 1x +11; read off the cofficients to get 1 0 1 1