软件计算结果:
原理参考下面的文章:
https://www.cnblogs.com/esestt/archive/2007/08/09/848856.html
https://blog.csdn.net/weixin_44256803/article/details/105805628
https://blog.csdn.net/d_leo/article/details/73572373
手算过程如下:
MODBUS:16位CRC,初始值0xFFFF,多项式0x8005,输入取反,输出取反。
第一步:原始数据 = "00010001 00100010 00110011 01000100 01010101 01100110 01110111 0000 0000 0000 0000";(就是十六进制11 22 33 44 55 66 77转成二进制,再在尾部增加16位0)。
第二步:按字节取反(输入取反) = "10001000 01000100 11001100 00100010 10101010 01100110 11101110 0000 0000 0000 0000";
第三步:前16位与初始值0xFFFF做异或运算:
然后运算过程如下:长的是被除数,短的是除数(多项式0x8005)
c
011101111011101111001100001000101010101001100110111011100000000000000000(前16位与初始值做了异或运算)
11000000000000101(多项式0x8005)
000101111011101010001100001000101010101001100110111011100000000000000000
11000000000000101
000011111011101011011100001000101010101001100110111011100000000000000000
11000000000000101
000000111011101011110100001000101010101001100110111011100000000000000000
11000000000000101
000000001011101011111110001000101010101001100110111011100000000000000000
11000000000000101
000000000111101011111100101000101010101001100110111011100000000000000000
11000000000000101
000000000001101011111101111000101010101001100110111011100000000000000000
11000000000000101
000000000000001011111101101100101010101001100110111011100000000000000000
11000000000000101
000000000000000111111101101110001010101001100110111011100000000000000000
11000000000000101
000000000000000001111101101111011010101001100110111011100000000000000000
11000000000000101
000000000000000000011101101111001110101001100110111011100000000000000000
11000000000000101
000000000000000000000101101111001011101001100110111011100000000000000000
11000000000000101
000000000000000000000011101111001010111001100110111011100000000000000000
11000000000000101
000000000000000000000000101111001010010001100110111011100000000000000000
11000000000000101
000000000000000000000000011111001010011011100110111011100000000000000000
11000000000000101
000000000000000000000000000111001010011110100110111011100000000000000000
11000000000000101
000000000000000000000000000001001010011111110110111011100000000000000000
11000000000000101
000000000000000000000000000000101010011111100010111011100000000000000000
11000000000000101
000000000000000000000000000000011010011111101000111011100000000000000000
11000000000000101
000000000000000000000000000000000010011111101101111011100000000000000000
11000000000000101
000000000000000000000000000000000001011111101101010011100000000000000000
11000000000000101
000000000000000000000000000000000000111111101101000111100000000000000000
11000000000000101
000000000000000000000000000000000000001111101101001101100000000000000000
11000000000000101
000000000000000000000000000000000000000011101101001111000000000000000000
11000000000000101
000000000000000000000000000000000000000000101101001111101000000000000000
11000000000000101
000000000000000000000000000000000000000000011101001111100010000000000000
11000000000000101
000000000000000000000000000000000000000000000101001111100111000000000000
11000000000000101
000000000000000000000000000000000000000000000011001111100110010000000000
11000000000000101
000000000000000000000000000000000000000000000000001111100110111000000000
11000000000000101
000000000000000000000000000000000000000000000000000011100110111010100000
11000000000000101
000000000000000000000000000000000000000000000000000000100110111010001000
11000000000000101
000000000000000000000000000000000000000000000000000000010110111010000010
11000000000000101
000000000000000000000000000000000000000000000000000000001110111010000111
最后16位取反(输出取反),得0xE177。