I am currently try to implement a simple RSC encoder in Matlab. As far as I know, this type of channel coding scheme require to reach an all-zero state in the encoder memory element(shift register). In other word, all of the bits store in all of the memory elements must all be zero.
I have do some research on this topic and see that in term of hardware implementation. A simple way to do so is to use the feedback bit as the encoder input, then the XOR of all those bits will be zero. Finally, the encoder will return to the all-zeros state after some B clock cycles (with B equal to the number of memory elements)
(Detail explanation for this zero termination scheme is on page 9/26 of this document:
Upon coming across this implement at https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/34878/versions/1/previews/doc/resources/rsc_encode.m/index.html
I do not know why the author use this command when he want to reach zero termination:
d_k = rem(G(1,2:L)*state.',2);
1/ Is this the same as the zero termination scheme that I have described above ?
2/ Also, will there be any different between rem(something,2) and mod(something,2) because I am not familiar with modulo arithmetic ?
I appreciate your consideration toward my question and looking for a positive response.