On the wikipedia page for 8b10b encoding (as of writing), the 3b4b table shows that if RD=-1, the outputs can have more 0's than 1's, and if RD=+1, it can have more 1's than 0's. This does not make sense to because if you already have too many 1's or 0's, you would not want to go more positive, or negative. Is this a mistake on the wikipedia page, or is my understanding of 8b10b wrong?
-
\$\begingroup\$ Maybe the RD is counting the number of extra zeroes? \$\endgroup\$– user253751Sep 20, 2018 at 0:01
-
\$\begingroup\$ @immibis, except the 5b/6b table is the way OP (and I) expect it to be. \$\endgroup\$– The PhotonSep 20, 2018 at 0:45
-
\$\begingroup\$ So if you have a RD- D.03.0, you would be more 0's than 1's and then go more negative. \$\endgroup\$– Eric JohnsonSep 20, 2018 at 3:25
-
\$\begingroup\$ In the same way it would be possible to get more 1's than 0's with a RD- D.15.3, so you could either get more positive or more negative. \$\endgroup\$– Eric JohnsonSep 20, 2018 at 3:28
2 Answers
The standard 8b/10b encoding for Ethernet is found in IEEE 802.3 clause 36, table 36-1a:
The disparity effect of the 6b/5b part of the code and the 4b/5b part of the code have to be considered together.
For example, for input code group D0.0, if running disparity is negative we use a 6b/5b code with +2 disparity and a 4b/5b code with -1 disparity to get an overall +1 disparity for the 8b/10b encoding. (and similarly -2 and +1 disparities if RD is positive)
But for code group D17.0, we have a balanced code for the 5b/6b part and for RD- we use a +2 disparity code for the 4b/5b part or -2 if RD is positive.
So sometimes the 4b/5b code acts to restore the overall running disparity, but other times it acts to increase the running disparity, but it's balanced by the 5b/6b code.
-
\$\begingroup\$ @Sparky256, from the background given in OP's question, I believe they already understand that. My main point in this answer is that the actual Ethernet spec is accessible and that to know the whole RD effect you need to consider the 5b6b and the 3b4b encodings together. \$\endgroup\$ Sep 20, 2018 at 2:25