What is 8b/10b encoding?

Line coding that sends 8 data bits as a 10-bit code with balanced 0s and 1s and short runs. It eases clock recovery but limits efficiency to 80%.

Field: I/O Interfaces & Buses

Japanese name: 8b/10b符号化

Purpose of 8b/10b encoding

High-speed serial links do not send a clock on a separate wire; instead, the receiver's clock and data recovery (CDR) circuit extracts timing from the transitions between 0s and 1s in the data. Long runs of the same value therefore make it lose timing. On AC-coupled links, which block DC with series capacitors, an imbalance between 0s and 1s also shifts the average signal voltage and causes decision errors. 8b/10b encoding solves both problems through the structure of the code by replacing 8 data bits with a 10-bit code; it was published by Widmer and Franaszek of IBM.

Code structure and running disparity

Each 8-bit byte is split, with the lower 5 bits converted to 6 bits and the upper 3 bits to 4 bits (5b/6b and 3b/4b), for 10 bits in total. Only codes with equal numbers of 1s and 0s, or a difference of 2, are used, and the unbalanced ones come in two forms, one with more 1s and one with more 0s. The transmitter remembers the direction of the imbalance so far (the running disparity) and picks the form that cancels it next, so 0s and 1s even out over time. Runs of the same value are at most 5 bits, which also guarantees frequent transitions.

Control characters and commas

There are 1024 possible 10-bit codes, more than the 256 needed for data, so 12 control codes (K codes) are defined in addition to data. The widely used K28.5 is a 'comma' containing a 7-bit pattern (0011111 or 1100000) that never appears in a valid data sequence, and the receiver finds it to align the 10-bit boundaries. Receiving an undefined code or a sequence that breaks the disparity rules also reveals a transmission error. There is no error correction, however, so it is combined with CRCs and similar checks in higher layers.

Efficiency and the standards that used it

Only 8 of every 10 bits carry data, so the efficiency is 80% and 20% of the signaling rate goes to the encoding; seen from the data, 25% more bits are sent. A 5 Gb/s link, for example, carries 4 Gb/s of data, or 500 MB/s. It has been used in PCI Express generations 1 and 2, USB 3.0 (5 Gb/s), SATA, Gigabit Ethernet (1000BASE-X), DisplayPort 1.x and others. Faster standards have replaced it with more efficient scrambling-based codes such as 64b/66b, 128b/130b encoding and 128b/132b.

Try it: questions about 8b/10b encoding

What is the purpose of 8b/10b encoding (sending 8 data bits as a 10-bit code) in serial links?

  1. ATo compress data and reduce the amount sent
  2. BTo balance the numbers of 0s and 1s and ensure frequent transitions so the receiver can recover the clock
  3. CTo encrypt data so third parties cannot read it
Show answer and explanation

Answer: B. To balance the numbers of 0s and 1s and ensure frequent transitions so the receiver can recover the clock

Long runs of 0s or 1s make the receiver's CDR lose timing and shift the average signal voltage, preventing correct decisions. 8b/10b encoding replaces 8 data bits with a 10-bit code that has nearly equal numbers of 0s and 1s and only short runs. The cost is 25% more bits on the wire, so data efficiency is 80%. It was used in PCI Express generations 1 and 2, USB 3.0 and others.

On a link using 8b/10b encoding with a signaling rate of 5 Gb/s, what is the effective data rate?

  1. A4 Gb/s
  2. B5 Gb/s
  3. C6.25 Gb/s
Show answer and explanation

Answer: A. 4 Gb/s

With 8b/10b encoding, 8 of every 10 bits sent are data, so the effective rate is 8/10 of the signaling rate: 5 Gb/s × 0.8 = 4 Gb/s. This is the one-direction speed of a single PCI Express 2.0 lane, or 500 MB/s in bytes. When comparing interfaces, the signaling rate (such as GT/s) and the coding efficiency must be considered separately.

FAQ

What is the overhead of 8b/10b encoding?

Two of every 10 bits are extra, so the overhead is 20% of the signaling rate and the data efficiency is 80%. Relative to the data, 25% more bits are sent. For example, SATA at 6 Gb/s carries 4.8 Gb/s of data, or 600 MB/s.

What is running disparity?

The state recording which way the balance of 1s and 0s in the codes sent so far leans. In 8b/10b, each unbalanced code has a form with more 1s and a form with more 0s, and the transmitter uses this state to pick the form that cancels the imbalance. The result is a signal with almost no DC component.

How does 8b/10b differ from 128b/130b?

8b/10b guarantees transitions and DC balance through the structure of the code, at the cost of a large 20% overhead. 128b/130b adds a 2-bit sync header to 128 bits and scrambles the data to prevent imbalance statistically, with an overhead of about 1.5%. PCI Express switched from 8b/10b to 128b/130b with version 3.0.

Books on I/O Interfaces & Buses Ad

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary