The correct CRC-4 example should be with the polynomial 0xB (1101 in binary) divided by the data 0xD (1101 in binary).
Here is the corrected example:
CRC-4 Example with Binary Polynomial 0xB (1101) and Data 0xD (1101)
Step 1: Initialize Checksum
The checksum is initialized to zero: 0000
Step 2: XOR with First Bit of Data
Data Bit 3: 1
Polynomial Bit 3: 1
Result Bit 3: XOR of Data Bit 3 and Polynomial Bit 3 = 0
Checksum: 0000
Data Bit 2: 1
Polynomial Bit 2: 1
Result Bit 2: XOR of Data Bit 2 and Polynomial Bit 2 = 0
Checksum: 0000
Data Bit 1: 0
Polynomial Bit 1: 1
Result Bit 1: XOR of Data Bit 1 and Polynomial Bit 1 = 1
Checksum: 1000
Data Bit 0: 1
Polynomial Bit 0: 1
Result Bit 0: XOR of Data Bit 0 and Polynomial Bit 0 = 0
Checksum: 1000
Step 3: Shift Checksum 4 bits to the Left
The checksum is shifted 4 bits to the left: 10000
Step 4: XOR with Second Bit of Data
Data Bit 3: 1
Polynomial Bit 3: 1
Result Bit 3: XOR of Data Bit 3 and Polynomial Bit 3 = 0
Checksum: 10000
Data Bit 2: 1
Polynomial Bit 2: 1
Result Bit 2: XOR of Data Bit 2 and Polynomial Bit 2 = 0
Checksum: 10000
Data Bit 1: 0
Polynomial Bit 1: 1
Result Bit 1: XOR of Data Bit 1 and Polynomial Bit 1 = 1
Checksum: 10000
Data Bit 0: 1
Polynomial Bit 0: 1
Result Bit 0: XOR of Data Bit 0 and Polynomial Bit 0 = 0
Checksum: 10000
Step 5: Shift Checksum 4 bits to the Left
The checksum is shifted 4 bits to the left: 100000
Step 6: XOR with Third Bit of Data
Data Bit 3: 1
Polynomial Bit 3: 1
Result Bit 3: XOR of Data Bit 3 and Polynomial Bit 3 = 0
Checksum: 100000
Data Bit 2: 1
Polynomial Bit 2: 1
Result Bit 2: XOR of Data Bit 2 and Polynomial Bit 2 = 0
Checksum: 100000
Data Bit 1: 0
Polynomial Bit 1: 1
Result Bit 1: XOR of Data Bit 1 and Polynomial Bit 1 = 1
Checksum: 100000
Data Bit 0: 1
Polynomial Bit 0: 1
Result Bit 0: XOR of Data Bit 0 and Polynomial Bit 0 = 0
Checksum: 100000
Step 7: Shift Checksum 4 bits to the Left
The checksum is shifted 4 bits to the left: 1000000
Step 8: XOR with Fourth Bit of Data
Data Bit 3: 1
Polynomial Bit 3: 1
Result Bit 3: XOR of Data Bit 3 and Polynomial Bit 3 = 0
Checksum: 1000000
Data Bit 2: 1
Polynomial Bit 2: 1
Result Bit 2: XOR of Data Bit 2 and Polynomial Bit 2 = 0
Checksum: 1000000
Data Bit 1: 0
Polynomial Bit 1: 1
Result Bit 1: XOR of Data Bit 1 and Polynomial Bit 1 = 1
Checksum: 1000000