8B/10B coding is DC-balanced, meaning that the long-term ratio of 1s and 0s transmitted should be exactly 50%. To achieve this, the encoder always calculates the difference between the number of 1s transmitted and the number of 0s transmitted, and at the end of each character transmitted, makes the difference either +1 or –1. This difference is known as the running disparity.
To accommodate protocols that use disparity to send control information, the running disparity can not only be generated by the 8B/10B encoder, but it is also controllable through CH*_TXCTRL1 and CH*_TXCTRL0, as shown in the following table. For example, an idle character sent with reversed disparity might be used to trigger clock correction.
CH*_TXCTRL0 | CH*_TXCTRL1 | Outgoing Disparity |
---|---|---|
0 | 0 | Calculated by the 8B/10B encoder. |
1 | 0 | Inverts running disparity when encoding TXDATA. |
0 | 1 | Forces running disparity negative when encoding CH*_TXDATA. |
1 | 1 | Forces running disparity positive when encoding CH*_TXDATA. |