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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.