If you have any questions or feedback, pleasefill out this form
This post is translated by ChatGPT and originally written in Mandarin, so there may be some inaccuracies or mistakes.
In the previous article, we discussed that Manchester encoding effectively addresses the situation where the data stream consists solely of 0s or 1s. However, this encoding method requires double the bandwidth for the same amount of data, which is not ideal for high-speed transmission.
Today, we will introduce 4B/5B encoding, which efficiently resolves the issue of a data stream consisting entirely of 0s or 1s without sacrificing too much bandwidth.
4B/5B
4B/5B encoding transforms the original data into groups of 4 bits, converting them into groups of 5 bits. This way, data streams like 0000
and 1111
are encoded to ensure they do not consist solely of 0s or 1s, thus avoiding situations where the clock cannot be recovered.
4bit | 5bit |
---|---|
0000 | 11110 |
0001 | 01001 |
0010 | 10100 |
0011 | 10101 |
0100 | 01010 |
0101 | 01011 |
0110 | 01110 |
0111 | 01111 |
1000 | 10010 |
1001 | 10011 |
1010 | 10110 |
1011 | 10111 |
1100 | 11010 |
1101 | 11011 |
1110 | 11100 |
1111 | 11101 |
If we observe 0000
and 1111
, we can see that after conversion to 5 bits, there is guaranteed to be at least one transition (from high to low voltage or vice versa). Although this adds an extra bit, the same amount of data now requires 20% more bandwidth. However, compared to Manchester encoding, this is still a significant improvement. 1000BASE-X uses 8B/10B encoding, which is conceptually similar to 4B/5B, but encodes 8 bits at a time. Besides being utilized in 1000BASE-X, 8B/10B is also employed in various high-speed transmission protocols, such as PCI 1.0/2.0 and USB 3.
8B1Q4
In 2023, wired network speeds often reach 1Gbps, with demands for even greater bandwidth hitting 10Gbps.
Common Ethernet cables consist of pairs of insulated wires twisted together. This twisting technique effectively reduces noise. However, at very high frequencies, these cables can still be susceptible to interference.
In transmissions above 100BASE-TX, 8B1Q4 encoding (8 binary to 1 quinary 4) is used. The main principle behind this is to transmit multiple bits within the same cycle, thereby increasing data volume. For instance, although CAT-6 has a transmission frequency of 125MHz, it achieves a transmission rate of 1Gbps.
In simple terms, 8B1Q4 divides the 8 bits plus 1 bit (checksum) into four groups. As seen in the image above, there are four groups of wires, and after grouping, each is represented by different voltage levels.
But how is the 9-bit data divided into four groups? First, the checksum plus the first two bits of data (a total of 3 bits) are used to find the corresponding transformation table. The remaining 6 bits are then encoded from the table found earlier. Notably, each wire has 5 voltage levels, rather than just high and low. This method allows for the transmission of 2 bits within one cycle, effectively doubling the data transmitted in the same bandwidth.
This is also why CAT-6 can achieve a transmission frequency of 125MHz while maintaining a transmission rate of 1Gbps.
If you found this article helpful, please consider buying me a coffee ☕ It'll make my ordinary day shine ✨
☕Buy me a coffee