8b/10b编码
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
提示:以下是本篇文章正文内容,下面案例可供参考
一、为什么要编码?
由于串行链路中会有交流耦合电容,理想电容的阻抗公式是Zc=1/2πf*C。因此信号频率越高,阻抗越低,反之频率越低,阻抗越高。当码型是为“0”、“1”交替出现时,码型的频率,则电容阻抗低,信号基本上可以不损耗的传输过去;但是当码型为连续“0”或者“1”的情况时,码型的频率低,则电容阻抗大,导致信号幅度不断降低,带来的严重后果是无法识别到底是“1”还是“0”。因此编码就是为了尽量把低频的码型优化成较高频的码型,从而保证低损耗的传输过去。
随笔:这是我第一次看到从硬件角度说明为什么要编码,豁然开朗的感觉。
二、8b/10b的编码方式
1.简介
通俗地说,8b/10b是把8bit的实际数据扩展为10bit,那开销就是20%,效率就只有80%了,更通俗来说就是增加了20%的非实际数据的传输 。
2.编码中的两个术语:不均等性(disparity)和极性偏差(running disparity,RD)
不均等性是指编码后的码型数据是“1”多还是“0”多。
极性偏差:
The Running Disparity (or RD) is defined as the difference between the number of logic 1 bits and logic 0 bits between the start of a data sequence and a particular instant in time during its transmission.
In other words, the RD for a character is the difference between the number of logic 1 bits and logic 0 bits in that character.
1)if there are more logic 1 bits than logic 0 bits (within a character or string of consecutive bits) then we can state that the RD is positive.
2)If there are more logic 0 bits than logic 1 bits then we can state that the RD is negative.
3)if the number of logic 1 and logic 0 bits are the same, then we can state that the RD is neutral or zero.
RD表示为整数:
RD = (Number of Logic 1 bits in the character or string) – (Number of Logic 0 bits in the character or string)
RD表示为比值:
Number of Logical 1s (in character/string) : Number of Logical 0s (in character/string)
那么,定义+-RD有什么意义?+-RD代表着同一个码型的两种编码方式。编码的目标本身就是为了缓解长“0”或长“1”的影响,因此在编码后如果“1”多的话,我们下一次的编码就要把这种码型做一个修正,从-RD码型变成+RD码型。如果是“0”和“1”一样多,极性则不用变,如下图:
3.编码实现方法与编码表
http://sierrahardwaredesign.com/basic-networking/running-disparity-rd/
转载于: