The decoding algorithm used in RBDS.c is based on error trapping. The program emulates the operation of the encoder and decoder of a binary cyclic codes, using bitwise shifts and xor for modulo g(x) operations.