CN101764617B - Coding method of 9B/10B code - Google Patents
Coding method of 9B/10B code Download PDFInfo
- Publication number
- CN101764617B CN101764617B CN2009102436809A CN200910243680A CN101764617B CN 101764617 B CN101764617 B CN 101764617B CN 2009102436809 A CN2009102436809 A CN 2009102436809A CN 200910243680 A CN200910243680 A CN 200910243680A CN 101764617 B CN101764617 B CN 101764617B
- Authority
- CN
- China
- Prior art keywords
- codeword
- code
- polarity
- bit
- 10bit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
本发明公开了一种9B/10B码的编码方法,包括以下步骤:将9bit码字划分为三个码段,并进行映射得到负极性10bit码字;计算负极性10bit码字的不平衡度,并根据不平衡度计算正极性10bit码字;计算当前信道码流极性,并根据极性选择负极性10bit码字或正极性10bit码字输出,以实现直流均衡。该方法利用正负极性偏差的跳转,实现编码的直流控制,具有编码效率高、直流特性好的优点。
The invention discloses a coding method of a 9B/10B code, comprising the following steps: dividing a 9bit codeword into three code segments, and performing mapping to obtain a negative polarity 10bit codeword; calculating the unbalance degree of the negative polarity 10bit codeword, And calculate the positive polarity 10bit code word according to the unbalance degree; calculate the polarity of the current channel code stream, and select the negative polarity 10bit code word or the positive polarity 10bit code word output according to the polarity to achieve DC balance. The method utilizes the jump of positive and negative polarity deviations to realize the direct current control of encoding, and has the advantages of high encoding efficiency and good direct current characteristics.
Description
技术领域 technical field
本发明涉及通信技术领域,具体地涉及一种9B/10B码的编码方法,其具有直流均衡特性。The invention relates to the technical field of communication, in particular to a coding method of a 9B/10B code, which has a DC equalization characteristic.
背景技术 Background technique
随着通信技术的迅猛发展,数据传输的速率和数据量都得到了极大的提高,因此对数据传输的可靠性也提出了更高的要求。由于传输距离的增加和传输速率的提高,信号衰减变得十分严重,波形也容易发生明显畸变,从而导致数据可靠性明显下降。为了增加数据传输的可靠性和稳定性,需要对数字信号进行编码调制,使信号频谱与传输媒质相匹配,以实现对传输媒质的充分利用。With the rapid development of communication technology, the rate and data volume of data transmission have been greatly improved, so higher requirements are put forward for the reliability of data transmission. Due to the increase of the transmission distance and the increase of the transmission rate, the signal attenuation becomes very serious, and the waveform is also prone to obvious distortion, which leads to a significant decline in data reliability. In order to increase the reliability and stability of data transmission, it is necessary to code and modulate the digital signal to match the signal spectrum with the transmission medium, so as to realize the full utilization of the transmission medium.
光纤数字传输系统相对于普通有线通信系统具有损耗低、带宽比较宽、电磁干扰小和安全性高等优点,越来越多地被应用到通信系统中。mB/nB调制码是光纤数字传输系统中最常用的一种编码,其本质是一种分组码,可以根据传输特性的要求预先设定一种编码速度和效率都比较高的映射规则,适于硬件实现。mB/nB调制码具有信号频谱特性较好、基线漂移小、误码率低等优点。Compared with ordinary wired communication systems, optical fiber digital transmission systems have the advantages of low loss, wide bandwidth, low electromagnetic interference and high security, and are more and more used in communication systems. The mB/nB modulation code is the most commonly used code in optical fiber digital transmission systems. It is essentially a block code. A mapping rule with high coding speed and efficiency can be preset according to the requirements of transmission characteristics. It is suitable for hardware implementation. The mB/nB modulation code has the advantages of better signal spectrum characteristics, small baseline drift, and low bit error rate.
mB/nB编码的主要原理是把输入的二进制原始码流进行分组,每组有m个二进制码,记为mB,称为一个码字,然后把一个码字变换为n个二进制码,记为nB,并在同一个时隙内输出。m和n都是正整数,n>m,一般选取n=m+1,其中,1B/2B、2B/3B、3B/4B等主要应用于低速率光纤数字传输,5B/6B、5B/7B、6B/8B、7B/8B等主要应用于高速率光纤数字传输,但是最高也只能达到上百兆bits/s,依然无法满足实际传输的需要。The main principle of mB/nB encoding is to group the input binary original code stream, and each group has m binary codes, denoted as mB, which is called a codeword, and then transforms a codeword into n binary codes, denoted as nB, and output in the same time slot. Both m and n are positive integers, n>m, generally select n=m+1, among them, 1B/2B, 2B/3B, 3B/4B, etc. are mainly used in low-speed optical fiber digital transmission, 5B/6B, 5B/7B, 6B/8B, 7B/8B, etc. are mainly used in high-speed optical fiber digital transmission, but the highest can only reach hundreds of megabits/s, which still cannot meet the needs of actual transmission.
目前1000BASE-X标准的千兆以太网主要采用的是传输带宽小、转换密度高以及码字游程长度受限和具有直流平衡特性的8B/10B调制码。但是,8B/10B调制码的编码效率只有80%,在高速数据传输系统中仍然存在进一步提高编码效率的需求。而编码效率比较高的9B/10B调制码由于编码过程复杂,计算量大,难以硬件实现,目前在光纤传输领域的应用受到一定限制。At present, Gigabit Ethernet of the 1000BASE-X standard mainly adopts 8B/10B modulation codes with small transmission bandwidth, high conversion density, limited code word run length and DC balance characteristics. However, the coding efficiency of the 8B/10B modulation code is only 80%, and there is still a need to further improve the coding efficiency in high-speed data transmission systems. However, the 9B/10B modulation code with relatively high coding efficiency is difficult to implement in hardware due to the complicated coding process and large amount of calculation. Currently, its application in the field of optical fiber transmission is limited.
发明内容 Contents of the invention
针对现有技术的不足,本发明的目的是要提供一种编码效率更高且编码过程简单的9B/10B码的编码方法。Aiming at the deficiencies of the prior art, the purpose of the present invention is to provide a 9B/10B coding method with higher coding efficiency and simple coding process.
为了实现上述目的,本发明提供了一种9B/10B码的编码方法,包括以下步骤:将9bit码字划分为三个码段,并进行映射得到负极性10bit码字;计算负极性10bit码字的不平衡度,并根据不平衡度计算正极性10bit码字;计算当前信道码流极性,并根据极性选择负极性10bit码字或正极性10bit码字输出,以实现直流均衡。In order to achieve the above object, the present invention provides a coding method of 9B/10B code, comprising the following steps: dividing the 9bit codeword into three code segments, and performing mapping to obtain the negative polarity 10bit codeword; calculating the negative polarity 10bit codeword According to the unbalance degree, calculate the positive polarity 10bit code word; calculate the polarity of the current channel code stream, and select the negative polarity 10bit code word or the positive polarity 10bit code word output according to the polarity to achieve DC balance.
本发明的有益效果是,该方法采用9B/10B码的编码方法,其理论编码效率可以高达90%,具有编码效率高的优点。编码过程中将码字划分为三个码段分别进行分类和映射,可以极大地简化9B/10B码表生成过程,有效提高了编码速度,同时易于9B/10B编解码器的硬件实现。此外,该方法还利用正负极性偏差的跳转,实现编码的直流控制,并在码表设计过程中尽量选择游程长度短的码字,具有编码效率高、直流特性好、游程长度短的优点。The beneficial effect of the present invention is that the method adopts the encoding method of 9B/10B code, and its theoretical encoding efficiency can be as high as 90%, which has the advantage of high encoding efficiency. During the encoding process, the code word is divided into three code segments for classification and mapping, which can greatly simplify the 9B/10B code table generation process, effectively improve the encoding speed, and facilitate the hardware implementation of the 9B/10B codec. In addition, this method also uses the jump of positive and negative polarity deviation to realize the DC control of the encoding, and try to choose the codeword with short run length in the process of code table design, which has the advantages of high encoding efficiency, good DC characteristics, and short run length. advantage.
附图说明 Description of drawings
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:
图1是根据本发明实施例的9B/10B码的编码方法的流程图;Fig. 1 is the flow chart of the coding method of 9B/10B code according to the embodiment of the present invention;
图2是根据本发明实施例的9B/10B码的编码方法中码字映射的过程示意图;以及Fig. 2 is a schematic diagram of the process of code word mapping in the coding method of 9B/10B code according to the embodiment of the present invention; And
图3是根据本发明实施例的9B/10B码的编码方法中信道码流极性更新的过程示意图。Fig. 3 is a schematic diagram of a process of updating the polarity of a channel code stream in a coding method of a 9B/10B code according to an embodiment of the present invention.
具体实施方式 Detailed ways
下面将结合附图和具体实施例对本发明作进一步详细说明。The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
图1示出的是根据本发明实施例的9B/10B码的编码方法的大致流程。该9B/10B码的编码方法的主要步骤为:首先将9bit码字划分为三个码段,并进行映射得到负极性10bit码字;然后计算负极性10bit码字的不平衡度,并根据不平衡度计算正极性10bit码字;最后计算当前信道码流极性,并根据极性选择负极性10bit码字或正极性10bit码字输出,以实现直流均衡。各步骤的具体操作如下:FIG. 1 shows a general flow of a method for encoding a 9B/10B code according to an embodiment of the present invention. The main steps of the encoding method of the 9B/10B code are: first divide the 9bit codeword into three code segments, and map to obtain the negative polarity 10bit codeword; then calculate the unbalance degree of the negative polarity 10bit codeword, and according to different The balance degree calculates the positive polarity 10bit codeword; finally calculates the polarity of the current channel code stream, and selects the negative polarity 10bit codeword or the positive polarity 10bit codeword output according to the polarity to achieve DC balance. The specific operation of each step is as follows:
S1:将9bit码字划分为三个码段,并进行映射得到负极性10bit码字。S1: Divide the 9-bit codeword into three code segments, and perform mapping to obtain a negative polarity 10-bit codeword.
图2示出的是根据本发明实施例的9B/10B码的编码方法中码字映射的大致过程。结合图1和图2可以看出,在步骤S1中,首先将输入数据进行分组得到的9bit码字划分成长度为4bit、1bit和4bit三个码段并分别进行分类,以对每一个9bit码字进行分类;然后将分类后的9bit码字的三个码段分别映射成长度为4bit、2bit和4bit三个码段,以组成所述负极性10bit码字。将码字划分为三个码段,可以极大地简化9B/10B码的码表生成和编码过程,同时也易于9B/10B编解码器的硬件实现。FIG. 2 shows a general process of codeword mapping in the encoding method of 9B/10B code according to the embodiment of the present invention. Combining Figure 1 and Figure 2, it can be seen that in step S1, the 9-bit code word obtained by grouping the input data is firstly divided into three code segments with lengths of 4 bit, 1 bit and 4 bit and classified respectively, so as to classify each 9-bit code Words are classified; then the three code segments of the classified 9bit code word are mapped into three code segments of length 4bit, 2bit and 4bit respectively to form the negative polarity 10bit code word. Dividing the code word into three code segments can greatly simplify the code table generation and encoding process of the 9B/10B code, and it is also easy to realize the hardware of the 9B/10B codec.
S101:将9bit码字划分成长度为4bit、1bit和4bit三个码段并分别进行分类,以对9bit码字进行分类。S101: Divide the 9-bit codeword into three code segments with lengths of 4bit, 1bit and 4bit and classify them respectively, so as to classify the 9-bit codeword.
在步骤S101中,首先将9bit码字X划分成4bit的第一码段X1、1bit的第二码段X2和4bit的第三码段X3,具体形式为:In step S101, the 9-bit code word X is first divided into a 4-bit first code segment X 1 , a 1-bit second code segment X 2 and a 4-bit third code segment X 3 , the specific form is:
X=X1-X2-X3=[x8x7x6x5x4x3x2x1x0]X=X 1 -X 2 -X 3 =[x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 x 0 ]
其中in
X1=[x8x7x6x5],X2=[x4],X3=[x3x2x1x0]X 1 =[x 8 x 7 x 6 x 5 ], X 2 =[x 4 ], X 3 =[x 3 x 2 x 1 x 0 ]
然后将9bit码字的第一码段X1和第三码段X3中的4bit信息分别按照比特位中“1”的个数划分为5类,对应于“1”的个数分别为0、1、2、3、4,第二码段X2中的1bit信息按照比特位中“1”和“0”的状态划分为2类,对应的状态分别为1、0,从而将9bit码字划分为5×2×5=50类。例如对于9bit码字1110-1-0101,其所属分类为3-1-2。Then divide the 4-bit information in the first code segment X 1 and the third code segment X 3 of the 9-bit codeword into 5 categories according to the number of "1" in the bit, and the number corresponding to "1" is 0 respectively , 1, 2, 3, 4, the 1bit information in the second code segment X 2 is divided into 2 types according to the states of "1" and "0" in the bits, and the corresponding states are 1 and 0 respectively, so that the 9bit code Words are divided into 5*2*5=50 categories. For example, for a 9-bit codeword 1110-1-0101, its classification is 3-1-2.
S102:将分类后的所述9bit码字的三个码段分别映射成长度为4bit、2bit和4bit三个码段,以组成所述负极性10bit码字。S102: Map the three code segments of the classified 9-bit codeword into three code segments with lengths of 4 bits, 2 bits and 4 bits respectively, so as to form the negative polarity 10-bit code word.
为了便于更清楚地描述编码映射规则,在步骤S102中也可以采用类似步骤S101的方法对10bit码字的各个比特位进行分段并分类。将10bit码字Y划分成4bit的第一码段Y1、2bit的第二码段Y2和4bit的第三码段Y3,具体形式为:In order to describe the coding mapping rules more clearly, in step S102, a method similar to step S101 may also be used to segment and classify each bit of the 10-bit codeword. Divide the 10-bit code word Y into a 4-bit first code segment Y 1 , a 2-bit second code segment Y 2 and a 4-bit third code segment Y 3 , the specific form is:
Y=Y1-Y2-Y3=[y9y8y7y6y5y4y3y2y1y0]Y=Y 1 -Y 2 -Y 3 =[y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 ]
其中in
Y1=[y9y8y7y6],Y2=[y5y4],Y3=[y3y2y1y0]Y 1 =[y 9 y 8 y 7 y 6 ], Y 2 =[y 5 y 4 ], Y 3 =[y 3 y 2 y 1 y 0 ]
然后将10bit码字的第一码段Y1和第三码段Y3中的4bit信息分别按照比特位中“1”的个数划分为5类,对应于“1”的个数分别为0、1、2、3、4,第二码段Y2中的2bit信息按照比特位中“1”和“0”的组合状态划分为4类,对应于“1”和“0”的组合状态分别为00、01、10、11,从而将10bit码字划分为5×4×5=100类。例如对于10bit码字1111-01-0010,其所属分类为4-01-1。Then divide the 4-bit information in the first code segment Y 1 and the third code segment Y 3 of the 10bit codeword into 5 categories according to the number of "1" in the bit, and the number corresponding to "1" is 0 respectively , 1, 2, 3, 4, the 2bit information in the second code segment Y 2 is divided into 4 categories according to the combined state of "1" and "0" in the bit, corresponding to the combined state of "1" and "0" are 00, 01, 10, and 11 respectively, so that the 10-bit codewords are divided into 5*4*5=100 categories. For example, for a 10-bit codeword 1111-01-0010, its classification is 4-01-1.
对9bit码字分类完成之后,利用9bit码字的分类从预设的普通码字映射规则修正表、普通码字映射规则表和特殊码字映射规则表中选择相应的映射规则对9bit码字进行映射。表1为普通码字映射规则修正表,表2为普通码字映射规则表,表3为特殊码字映射规则表。表1、表2和表3中所示的映射规则是以降低9B/10B编解码器设计复杂度为原则而设计的,易于硬件实现。After the classification of 9bit codewords is completed, use the classification of 9bit codewords to select the corresponding mapping rules from the preset common codeword mapping rule modification table, common codeword mapping rule table and special codeword mapping rule table to perform 9bit codeword classification. map. Table 1 is a table for modifying common codeword mapping rules, Table 2 is a table for common codeword mapping rules, and Table 3 is a table for special codeword mapping rules. The mapping rules shown in Table 1, Table 2 and Table 3 are designed based on the principle of reducing the design complexity of 9B/10B codecs, and are easy to implement in hardware.
表1Table 1
表2Table 2
表3table 3
由于信道中传输的码流包括了普通码字和具有帧同步等特殊功能的特殊码字,为了避免在映射过程中将普通码字误匹配为特殊码字,特别制定了表1所示的普通码字映射规则修正表。若9bit码字为普通码字,首先查询表1,若9bit码字能够在表1中找到能够相应的映射规则,则按照表1中的映射规则直接进行映射,否则按照表2中相应的映射规则进行映射。表2中映射规则R的具体含义如下:Since the code stream transmitted in the channel includes common codewords and special codewords with special functions such as frame synchronization, in order to avoid the common codewords being mistakenly matched into special codewords during the mapping process, the common codewords shown in Table 1 are specially formulated. Codeword mapping rule revision table. If the 9bit codeword is an ordinary codeword, first query Table 1, if the 9bit codeword can find the corresponding mapping rules in Table 1, then directly map according to the mapping rules in Table 1, otherwise follow the corresponding mapping in Table 2 rules for mapping. The specific meaning of the mapping rule R in Table 2 is as follows:
映射规则A1:Y1=X1,Y3=X3,共316个映射;Mapping rule A 1 : Y 1 =X 1 , Y 3 =X 3 , a total of 316 mappings;
映射规则A2:Y1=X1,Y3=-X3(-X3表示X3的反码,下同),共64个映射;Mapping rule A 2 : Y 1 =X 1 , Y 3 =-X 3 (-X 3 represents the inverse of X 3 , the same below), a total of 64 mappings;
映射规则A3:Y1=-X1,Y3=X3,共24个映射;Mapping rule A 3 : Y 1 =-X 1 , Y 3 =X 3 , 24 mappings in total;
映射规则A4:Y1=-X1,Y3=-X3,共16个映射;Mapping rule A 4 : Y 1 =-X 1 , Y 3 =-X 3 , 16 mappings in total;
映射规则B1:Y1=X1,Y3=[0011],共4个映射;Mapping rule B 1 : Y 1 =X 1 , Y 3 =[0011], 4 mappings in total;
映射规则B2:Y1=X1,Y3=[0101],共4个映射;Mapping rule B 2 : Y 1 =X 1 , Y 3 =[0101], 4 mappings in total;
映射规则C1:Y1=[0011],Y3=X3,共10个映射;Mapping rule C 1 : Y 1 =[0011], Y 3 =X 3 , 10 mappings in total;
映射规则C2:Y1=[0101],Y3=X3,共10个映射;Mapping rule C 2 : Y 1 =[0101], Y 3 =X 3 , 10 mappings in total;
映射规则C3:Y1=[0110],Y3=X3,共10个映射;Mapping rule C 3 : Y 1 =[0110], Y 3 =X 3 , 10 mappings in total;
映射规则C4:Y1=[1001],Y3=X3,共10个映射;Mapping rule C 4 : Y 1 =[1001], Y 3 =X 3 , 10 mappings in total;
映射规则D1:Y1=[1010],Y3=X1,共10个映射;Mapping rule D 1 : Y 1 =[1010], Y 3 =X 1 , 10 mappings in total;
映射规则D2:Y1=[1100],Y3=X1,共10个映射;Mapping rule D 2 : Y 1 =[1100], Y 3 =X 1 , 10 mappings in total;
映射规则E1:Y1=X3,Y3=[0001],共4个映射;Mapping rule E 1 : Y 1 =X 3 , Y 3 =[0001], 4 mappings in total;
映射规则E2:Y1=X3,Y3=[0010],共4个映射;Mapping rule E 2 : Y 1 =X 3 , Y 3 =[0010], 4 mappings in total;
映射规则E3:Y1=X3,Y3=[0100],共4个映射;Mapping rule E 3 : Y 1 =X 3 , Y 3 =[0100], 4 mappings in total;
映射规则E4:Y1=X3,Y3=[1000],共4个映射;Mapping rule E 4 : Y 1 =X 3 , Y 3 =[1000], 4 mappings in total;
映射规则N1:Y1=[0111],Y3=[0110],共1个映射;Mapping rule N 1 : Y 1 =[0111], Y 3 =[0110], a total of 1 mapping;
映射规则N2:Y1=[1011],Y3=[0110],共1个映射;Mapping rule N 2 : Y 1 = [1011], Y 3 = [0110], a total of 1 mapping;
映射规则N3:Y1=[1101],Y3=[0110],共1个映射;Mapping rule N 3 : Y 1 =[1101], Y 3 =[0110], a total of 1 mapping;
映射规则N4:Y1=[1110],Y3=[0110],共1个映射;Mapping rule N 4 : Y 1 =[1110], Y 3 =[0110], a total of 1 mapping;
映射规则N5:Y1=[0111],Y3=[1001],共1个映射;Mapping rule N 5 : Y 1 =[0111], Y 3 =[1001], a total of 1 mapping;
映射规则N6:Y1=[1011],Y3=[1001],共1个映射;Mapping rule N 6 : Y 1 =[1011], Y 3 =[1001], a total of 1 mapping;
映射规则N7:Y1=[1101],Y3=[1001],共1个映射;Mapping rule N 7 : Y 1 =[1101], Y 3 =[1001], a total of 1 mapping;
映射规则N8:Y1=[1110],Y3=[1001],共1个映射。Mapping rule N 8 : Y 1 =[1110], Y 3 =[1001], 1 mapping in total.
在信号传输过程中需要添加一些用于建立同步、诊断线路故障、控制传输状态等的特殊码字以提高信号传输的可靠性。当9bit码字为特殊码字时,则按照表3中的映射规则进行映射。In the process of signal transmission, some special codewords for establishing synchronization, diagnosing line faults, controlling transmission status, etc. need to be added to improve the reliability of signal transmission. When the 9-bit codeword is a special codeword, it is mapped according to the mapping rules in Table 3.
经过上述步骤完成映射后,可以得到输入的9bit码字所对应的负极性10bit码字。例如,对于信源为9bit的码字0110-1-0000,其分类后的取值为2-1-0,根据表2可得,其所对应的10bit码字取值为2-11-2,映射规则为D2,即Y1=[1100],Y3=X1,故有Y1=[1100],Y2=[11],Y3=X1=[0110],即9bit码字0110-1-0000所对应的负极性10bit码字为1100-11-0110。After the mapping is completed through the above steps, the negative polarity 10-bit codeword corresponding to the input 9-bit codeword can be obtained. For example, for the code word 0110-1-0000 with a source of 9 bits, its classified value is 2-1-0, according to Table 2, the corresponding 10-bit code word value is 2-11-2 , the mapping rule is D 2 , that is, Y 1 =[1100], Y 3 =X 1 , so Y 1 =[1100], Y 2 =[11], Y 3 =X 1 =[0110], namely 9bit code The negative polarity 10-bit code word corresponding to the word 0110-1-0000 is 1100-11-0110.
S2:计算负极性10bit码字的不平衡度,并根据不平衡度计算正极性10bit码字。S2: Calculate the unbalance degree of the negative polarity 10-bit codeword, and calculate the positive polarity 10-bit codeword according to the unbalance degree.
10bit码字的不平衡度定义为该10bit码字中“0”的个数与“1”的个数的差值,即“0”的个数小于“1”的个数时为负,相等时为零,大于时为正。The unbalance degree of a 10bit codeword is defined as the difference between the number of "0" and the number of "1" in the 10bit codeword, that is, when the number of "0" is less than the number of "1", it is negative and equal When it is zero, it is positive when it is greater than.
计算出不平衡度之后,若不平衡度为零,正极性10bit码字为负极性10bit码字的原码;若不平衡度不为零,正极性10bit码字为负极性10bit码字的反码,从而可以得到所有负极性10bit码字对应的正极性10bit码字。After calculating the imbalance degree, if the imbalance degree is zero, the positive 10-bit codeword is the original code of the negative polarity 10-bit codeword; if the imbalance degree is not zero, the positive polarity 10-bit codeword is the inverse of the negative polarity 10-bit codeword code, so that the positive polarity 10-bit code words corresponding to all negative polarity 10-bit code words can be obtained.
例如,对于信源为9bit的码字K.0FCH,K.表示该码字为特殊字符,H为十六进制表示符号,该码字可用于帧同步,属于特殊字符,其二进制表示为0111-1-1100,查表3可知其所对应的负极性10bit码字为0111-11-1100,该10bit码字的不平衡度为-4,故K.0FCH所对应的正负极性10bit码字互为反码,即正极性10bit码字为1000-00-0011,由此可得作为信源的9bit码字K.0FCH所对应的正负极性码字分别为0111-11-1100(负)与1000-00-0011(正)。For example, for a codeword K.0FCH with a source of 9 bits, K. indicates that the codeword is a special character, and H is a hexadecimal symbol. This codeword can be used for frame synchronization and is a special character, and its binary representation is 0111 -1-1100, look up table 3, we can know that the corresponding negative polarity 10bit code word is 0111-11-1100, the unbalance degree of this 10bit code word is -4, so the positive and negative polarity 10bit code corresponding to K.0FCH The words are inverse codes, that is, the positive polarity 10bit codeword is 1000-00-0011, thus the positive and negative polarity codewords corresponding to the 9bit codeword K.0FCH as the source are 0111-11-1100( negative) and 1000-00-0011 (positive).
又如,对于信源为9bit的码字D.038H,D.表示该码字为普通字符,其二进制表示为0001-1-1000,属于表1中所列的源字,即D.038H为需要修正的码字,查表1可知其所对应的负极性10bit码字为1110-11-1010,该10bit码字的不平衡度为-4,故D.038H所对应的正负极性10bit码字互为反码,即正极性10bit码字为0001-00-0101,由此可得9bit源字D.038H所对应的正负极性码字分别为1110-11-1010(负)与0001-00-0101(正)。For another example, for the code word D.038H of 9bit, D. represents that this code word is a common character, and its binary representation is 0001-1-1000, which belongs to the source word listed in Table 1, that is, D.038H is For the codeword that needs to be corrected, look up Table 1 to know that the corresponding negative polarity 10bit codeword is 1110-11-1010, and the unbalance degree of the 10bit codeword is -4, so the positive and negative polarity 10bit corresponding to D.038H The codewords are inverses of each other, that is, the positive polarity 10bit codeword is 0001-00-0101, and thus the positive and negative polarity codewords corresponding to the 9bit source word D.038H are 1110-11-1010 (negative) and 0001-00-0101 (positive).
再如,对于信源为9bit的码字D.086H,该码字为普通字符,其二进制表示为0100-0-0110,不属于表1中所列的源字,查表2可知其所对应的负极性10bit码字为1011-00-0110,该10bit码字的不平衡度为0,故D.086H所对应的正负极性10bit码字相同,即正极性10bit码字也为1011-00-0110,由此可得9bit源字D.086H所对应的正负极性码字分别为1011-00-0110(负)与1011-00-0110(正)。For another example, for the codeword D.086H whose source is 9bit, the codeword is an ordinary character, and its binary representation is 0100-0-0110, which does not belong to the source words listed in Table 1. Look up Table 2 to know its corresponding The negative polarity 10bit codeword of D.086H is 1011-00-0110, and the unbalance degree of this 10bit codeword is 0, so the positive and negative polarity 10bit codewords corresponding to D.086H are the same, that is, the positive polarity 10bit codeword is also 1011- 00-0110, thus it can be obtained that the positive and negative polarity code words corresponding to the 9-bit source word D.086H are 1011-00-0110 (negative) and 1011-00-0110 (positive) respectively.
S3:计算当前信道码流极性,并根据极性选择所述负极性10bit码字或正极性10bit码字输出,以实现直流均衡。S3: Calculate the polarity of the current channel code stream, and select the negative polarity 10-bit code word or the positive polarity 10-bit code word to output according to the polarity, so as to realize DC balance.
图3示出的是根据本发明实施例的9B/10B码的编码方法中信道码流极性更新的大致过程,其中,RD10表示输出的10bit码字的不平衡度,RDS表示信道码流的总不平衡度,具体步骤如下:Figure 3 shows the general process of updating the polarity of the channel code stream in the encoding method of the 9B/10B code according to an embodiment of the present invention, wherein RD 10 represents the unbalance degree of the output 10bit code word, and RDS represents the channel code stream The total unbalance degree, the specific steps are as follows:
S301:设定初始时刻的信道码流极性为负;S301: Set the polarity of the channel code stream at the initial moment to be negative;
S302:判断当前信道码流的极性,若极性为负,则下一时刻输出正极性10bit码字,若极性为正,则下一时刻输出负极性10bit码字;S302: Determine the polarity of the current channel code stream, if the polarity is negative, output a positive polarity 10-bit code word at the next moment, and if the polarity is positive, output a negative polarity 10-bit code word at the next moment;
S303:输出10bit码字后计算信道码流的总不平衡度RDS,并根据总不平衡度RDS更新信道码流的极性,再次进行步骤S302。S303: After outputting the 10-bit code word, calculate the total unbalance degree RDS of the channel code stream, and update the polarity of the channel code stream according to the total unbalance degree RDS, and proceed to step S302 again.
信道码流的总不平衡度RDS定义为从初始时刻到当前时刻之间所有输出的10bit码字的不平衡度RD10的总和。计算出当前时刻信道码流的总不平衡度RDS之后,若总不平衡度RDS为正,则信道码流的极性更新为正;若总不平衡度RDS为负,则信道码流的极性更新为负;若总不平衡度RDS为零,且当前输出的10bit码字的不平衡度RD10为零,则信道码流的极性不改变;若总不平衡度RDS为零,且当前输出的10bit码字的不平衡度RD10不为零,则信道码流的极性反转。然后再根据信道码流的极性来选择下一时刻可以输出的10bit码字的极性。The total imbalance degree RDS of the channel code stream is defined as the sum of the imbalance degree RD 10 of all output 10-bit code words from the initial moment to the current moment. After calculating the total unbalance degree RDS of the channel code stream at the current moment, if the total unbalance degree RDS is positive, the polarity of the channel code stream is updated to be positive; if the total unbalance degree RDS is negative, the polarity of the channel code stream is If the total unbalance degree RDS is zero, and the unbalance degree RD 10 of the currently output 10bit codeword is zero, then the polarity of the channel code stream does not change; if the total unbalance degree RDS is zero, and If the unbalance degree RD 10 of the currently output 10-bit codeword is not zero, the polarity of the channel code stream is reversed. Then, according to the polarity of the channel code stream, the polarity of the 10-bit code word that can be output at the next moment is selected.
根据所述9B/10B码字映射方法,每个9bit源字均对应有正负极性的两种10bit码字。通过选择不同极性的码字输出,可实现编码过程的直流均衡的特性。According to the 9B/10B codeword mapping method, each 9bit source word corresponds to two 10bit codewords with positive and negative polarities. By selecting codeword outputs with different polarities, the characteristic of DC balance in the encoding process can be realized.
例如,待编码的信源码字序列如下:For example, the source codeword sequence to be encoded is as follows:
其中K.0FCH为特殊字符,用于帧同步,其余为普通字符。根据上述码字映射规则得到每个9bit源字所对应的正负极性10bit码字,再根据图3所示过程对作为信源的码字序列进行直流均衡以得到9B/10B编码,其编码过程如下:Among them, K.0FCH is a special character for frame synchronization, and the rest are common characters. According to the above code word mapping rules, the positive and negative polarity 10-bit code words corresponding to each 9-bit source word are obtained, and then according to the process shown in Figure 3, DC equalization is performed on the code word sequence as the source to obtain 9B/10B code. The process is as follows:
经过9B/10B编码后得到的码字序列输出如下:The codeword sequence output obtained after 9B/10B encoding is as follows:
1000000011011110110011101110101011000110110000011011000001111010101110001000010110000000110111101100111011101010110001101100000110110000011110101011100010000101
按照本发明的实施例的9B/10B码的编码方法,可以采用Altera公司的EP2C35F484I8芯片设计9B/10B硬件编码器与解码器。整个设计采用了Verilog HDL编程语言实现,仿真实验中总共使用了242个逻辑单元,其中编码器占用120个逻辑单元,解码器占用122个逻辑单元,系统的最高时钟频率可达338MHz。在9B/10B码的编码过程中,通过对10bit码字的挑选,剔除可能造成长连“0”或连“1”的码字,并以短游程长度优先的原则设计信源码字与目标码字之间的映射规则,最终实现信道码流的游程长度的控制。该编码方法理论上的编码效率可以达到90%,与现行高速串行数据传输中常用的8B/10B编码相比,编码效率提高了12.5%,即在相同的工作频率下,其有效传输速率提高了12.5%。该方法利用正负极性偏差的跳转,实现编码的直流控制,具有编码效率高、直流特性好的优点。相对于现有的9B/10B编码技术而言,本发明的9B/10B编码方法具有编码过程简单、编码速度快的优点,非常易于硬件实现,适合应用到高速通信系统中。According to the encoding method of the 9B/10B code in the embodiment of the present invention, the EP2C35F484I8 chip of Altera Company can be used to design the 9B/10B hardware encoder and decoder. The whole design is realized by Verilog HDL programming language. A total of 242 logic units are used in the simulation experiment, among which the encoder occupies 120 logic units, and the decoder occupies 122 logic units. The highest clock frequency of the system can reach 338MHz. In the encoding process of 9B/10B code, through the selection of 10bit code words, the code words that may cause long consecutive "0" or "1" are eliminated, and the source code word and target code are designed based on the principle of short run length priority The mapping rules between words finally realize the control of the run length of the channel code stream. The coding efficiency of this coding method can reach 90% in theory. Compared with the 8B/10B coding commonly used in the current high-speed serial data transmission, the coding efficiency is increased by 12.5%. up 12.5%. The method utilizes the jump of positive and negative polarity deviations to realize the direct current control of encoding, and has the advantages of high encoding efficiency and good direct current characteristics. Compared with the existing 9B/10B encoding technology, the 9B/10B encoding method of the present invention has the advantages of simple encoding process and fast encoding speed, is very easy to implement in hardware, and is suitable for application in high-speed communication systems.
以上所披露的仅为本发明的优选实施例,当然不能以此来限定本发明的权利保护范围。可以理解,依据本发明所附权利要求中限定的实质和范围所作的等同变化,仍属于本发明所涵盖的范围。The above-mentioned disclosures are only preferred embodiments of the present invention, and certainly cannot be used to limit the protection scope of the present invention. It can be understood that equivalent changes made according to the essence and scope defined in the appended claims of the present invention still belong to the scope covered by the present invention.
Claims (6)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2009102436809A CN101764617B (en) | 2009-12-22 | 2009-12-22 | Coding method of 9B/10B code |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2009102436809A CN101764617B (en) | 2009-12-22 | 2009-12-22 | Coding method of 9B/10B code |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101764617A CN101764617A (en) | 2010-06-30 |
| CN101764617B true CN101764617B (en) | 2012-05-30 |
Family
ID=42495622
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2009102436809A Expired - Fee Related CN101764617B (en) | 2009-12-22 | 2009-12-22 | Coding method of 9B/10B code |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101764617B (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103199869B (en) * | 2012-01-06 | 2017-05-10 | 上海华虹集成电路有限责任公司 | 8b/10b decoding circuit based on rd+ |
| CN103580774B (en) * | 2012-07-19 | 2019-01-04 | 中兴通讯股份有限公司 | A kind of method and device of control signaling transmission |
| CN105938728B (en) * | 2015-03-04 | 2020-08-11 | 爱思开海力士有限公司 | Encoder and Decoder Design for Approximate Balanced Codes |
| CN106411322A (en) * | 2016-11-04 | 2017-02-15 | 深圳国人通信股份有限公司 | Encoding and decoding method and device of serial communication system based on SerDes technology |
| CN109889306B (en) * | 2019-01-16 | 2021-12-17 | 中国航空工业集团公司洛阳电光设备研究所 | Encoding polarity calculation method for high-speed optical fiber digital transmission system |
| CN112838868B (en) | 2020-12-30 | 2022-09-09 | 天津瑞发科半导体技术有限公司 | 9B/10B coding and decoding method |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US3460122A (en) * | 1966-02-23 | 1969-08-05 | Bell Telephone Labor Inc | Pulse code modulation apparatus |
| CN1558582A (en) * | 2004-01-16 | 2004-12-29 | 中国科学院计算技术研究所 | 16b/20b encoder logic realization method based on double 8b/10b encoder |
| CN101112060A (en) * | 2004-12-29 | 2008-01-23 | 恩尼格玛半导体有限公司 | 16b/10s encoding apparatus and method |
-
2009
- 2009-12-22 CN CN2009102436809A patent/CN101764617B/en not_active Expired - Fee Related
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US3460122A (en) * | 1966-02-23 | 1969-08-05 | Bell Telephone Labor Inc | Pulse code modulation apparatus |
| CN1558582A (en) * | 2004-01-16 | 2004-12-29 | 中国科学院计算技术研究所 | 16b/20b encoder logic realization method based on double 8b/10b encoder |
| CN101112060A (en) * | 2004-12-29 | 2008-01-23 | 恩尼格玛半导体有限公司 | 16b/10s encoding apparatus and method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101764617A (en) | 2010-06-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101764617B (en) | Coding method of 9B/10B code | |
| CN101453221B (en) | Mapper and its mapping method based on bit-interleaved coded modulation system | |
| CN105656604B (en) | A kind of Bit Interleave Polarization Coding modulator approach and device | |
| CN104995612B (en) | Inter-chip communication method and system with low synchronous switching noise | |
| US10063341B1 (en) | Flexible data transmission scheme adaptive to communication channel quality | |
| CN100568744C (en) | Method and device for rate matching of convolutional codes | |
| US9871677B2 (en) | Data processing method and apparatus | |
| US9362962B2 (en) | Methods and systems for energy-efficient communications interface | |
| US8255779B2 (en) | System and method for accelerated forward error correction (FEC) synchronization | |
| CN105264778B (en) | A CRC calculation method and device | |
| CN104980679B (en) | MIPI DSI/CSI-2 receiver systems based on pure differential signal | |
| EP3324583B1 (en) | Data processing method, apparatus and system | |
| CN104618068B (en) | Bit Interleaved Coded Modulation device and method for wireless broadcast communication system | |
| CN104639477A (en) | Backchannel communications for initialization of high-speed networks | |
| US20200412368A1 (en) | Apparatuses and methods involving a segmented source-series terminated line driver | |
| CN119051801B (en) | Method, device, equipment, system and readable storage medium for data transmission | |
| CN103166743A (en) | A baseband digital signal coding and modulation integrated system | |
| CN102868482A (en) | Method and device for multi-level coding modulation | |
| US20150312037A1 (en) | Data scrambling initialization | |
| CN106301229A (en) | Data receiver circuit | |
| CN104333388A (en) | Serial communication protocol controller, character re-aligning circuit and 8b/10b decoder | |
| CN106992843B (en) | A Multiple Access Channel-Based Optimization Method for Code Degree Distribution of Digital Fountains | |
| CN103220007B (en) | The TPC iterative decoding algorithm of the unreliable figure place of a kind of self-adaptative adjustment subcode | |
| US9749237B2 (en) | Method and apparatus for aggregating and encoding received symbols including generation of a pointer for a control code | |
| US8885664B1 (en) | Multi-rate media independent interface over a physical coding sublayer |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120530 Termination date: 20171222 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |