Yes what you have said is correct.
The encoding starts with taking the bit 0 (D[0]) of input data and that becomes the bit 0 of result (Q[0]).
Then XOR the bit 0 of the result with bit 1 of input data. That becomes bit 1 of the result (Q
1).
Then XOR the bit 1 of the result with the bit 2 of input data.
That becomes bit 2 of the result (Q
2).
Then XOR the bit 2 of the result with bit 3 of input data. That becomes bit 3 of the result (Q
3).
Then XOR the bit 3 of the result with the bit 4 of input data.
That becomes bit 4 of the result (Q
4).
Then XOR the bit 4 of the result with bit 5 of input data. That becomes bit 5 of the result (Q
5).
Then XOR the bit 5 of the result with the bit 6 of input data.
That becomes bit 6 of the result (Q
6).
Then XOR the bit 6 of the result with bit 7 of input data. That becomes bit 7 of the result (Q
7).
Th bit 8 of the result is always 1 (which indicates that we used XOR to the receiver).
example
input data 1010 0101
output data 1 0110 0011