Trying to understand crc8
. This is my calculations:
poly 100110001 # OneWire
bin 00000001 # 1
1. 000000010 << 1 = 000000100
2. 000000100 << 1 = 000001000
3. 000001000 << 1 = 000010000
4. 000010000 << 1 = 000100000
5. 000100000 << 1 = 001000000
6. 001000000 << 1 = 010000000
7. 010000000 << 1 = 100000000
8. 100000000 ^ 100110001 = 000110001 << 1 = 001100010 == 00110001 # 8 digits
crc8 = 0x31 # online calc true
bin 01000001 # 41
1. 010000010 << 1 = 100000100
2. 100000100 ^ 100110001 = 000110101 << 1 = 001101010
3. 001101010 << 1 = 011010100
4. 011010100 << 1 = 110101000
5. 110101000 ^ 100110001 = 010011001 << 1 = 100110010
6. 100110010 ^ 100110001 = 000000011 << 1 = 000000110
7. 000000110 << 1 = 000001100
8. 000001100 << 1 = 000011000 == 00001100
crc8 = 0xC # online calc true
Now need crc8
of 141
The first one plus the second. Using online calculator https://ghsi.de/CRC/index.php?Polynom=100110001&Message=141 I see that crc8
of 141
must be 0xF8
. But 0x31 + 0xC
will be 3D
. Where is the error?