16b18b-Code - 16b18b-Code

The 16b18b code (also 16b / 18b code ) is a line code in telecommunications technology developed by Albert Xavier Widmer in 1999 . 16 data bits are encoded by 18 symbol bits. There is no DC component and a simple clock recovery is possible from the data signal. The data volume increases with coding by 12.5 percent.

Another and significantly more efficient code is the 64b66b code with 3 percent overhead, which maps 64 bits to 66 symbols, and the 128b130b code with 1.5 percent overhead.


The 16b18b code uses an 18-bit symbol to transmit two octets . The following properties are met:


The number of ones per symbol differs from the number of zeros by a maximum of two. This gives three types of symbols:

  • 48620 neutrals (neutral disparity): same number of "1" and "0", so nine times "1" and nine times "0"
  • 43758 positive (positive disparity): ten times "1" and eight times "0"
  • 43758 negative (negative disparity): eight times "1" and ten times "0"

In a data stream, “1” and “0” occur with the same probability. If a “1” is transmitted as a positive voltage + U and a “0” as a negative voltage −U, the coded signal (at a given data rate) has a lower limit frequency, ie the voltage is averaged out over a longer bit sequence so that the signal does not contain any DC voltage. This DC voltage equalization allows, for example, a capacitive or inductive coupling of transmitter and receiver.

Maximum length of equal bits

The maximum length of the same bits (maximum run length) is limited to seven by appropriate selection of the symbols for pure data transmission, ie the level changes after seven clocks at the latest. This enables a simple clock recovery from the data signal.


In addition to the data, the 16B18B encoder also processes the disparity. This tells the encoder whether it should generate a symbol with positive or negative disparity and what disparity a subsequent symbol should have. If a symbol has negative disparity, the following symbol must be generated with positive disparity. If the symbol has neutral disparity, the disparity information of the previous symbol is forwarded to the following symbol. This ensures that a maximum of three 1s or three 0s is too many in the entire data stream at any time, and that there is a sufficient number of symbols that are free of direct voltage. Hence for each input symbol there are two possible output symbols. Which of the two is used depends on the respective predecessor.

K words

In addition to the two 65536 possible data symbols, there is also ???? mal ??? 18-bit code words which, like the data words, contain a maximum of seven identical consecutive bits and a maximum of ten ones or ten zeros. These symbols are called K-words, which can be used for control functions in higher-level protocol layers. Three of these K-words have a bit pattern that cannot be created across symbol boundaries. This means that the last bits of a symbol together with the first bits of a subsequent symbol can never result in the bit pattern of one of these three special K-words. This is used in serial data streams to recognize the beginning and the end of a symbol. These three special K-words are also called comma words .

Error detection

Since not all of the 262144 possible combinations that can be represented with 18 bits are valid code words, it is possible to detect some bit transmission errors. However, individual bit errors can also result in other valid code words, which means that reliable detection or even correction of transmission errors is impossible. Therefore, a checksum is usually also transmitted together with the data in order to detect bit transmission errors with greater reliability.


There is another non-DC-free 16B18B code that is more closely related to the 64b66b code .


The 16b18b code is used in the HDMI 2.1 standard for digital image and sound transmission in entertainment electronics.