I'd like to confirm whether I grasped the concept of CRC calculations correctly. I'll provide two examples, the first is calculating the remainder using normal subtraction, the second uses this weird XOR stuff.
Data bits: D = 1010101010.
Generator bits: G = 10001.
1) Subtraction approach to calculate remainder:
10101010100000
10001|||||||||
-----|||||||||
10001|||||||
10001|||||||
-----|||||||
000000100000
10001
-----
1111
R = 1111.
2) XOR approach:
10101010100000
10001|||||||||
-----|||||||||
10001|||||||
10001|||||||
-----|||||||
00000010000|
10001|
------
000010
R = 0010.