Learn the principles of encoding and decoding signals for effective digital communication and data transmission in electronics.
Bits do not travel on a wire as they are: first they are transformed into a waveform suitable for the channel, then the receiver reconstructs them. This pair of operations, line encoding and decoding, determines how much bandwidth is needed, whether the receiver can synchronize with the stream, and whether the signal can be coupled with transformers or capacitors. A line code is the rule by which a bit sequence becomes a sequence of voltage levels [1][2][3][4].
- Synchronization content: the receiver derives the clock from signal transitions; long sequences of identical bits, without transitions, cause it to lose sync.
- Zero DC component: a signal with zero average value passes through coupling transformers and capacitors without baseline drift.
- Reduced bandwidth and low implementation cost.
- Error detection, at least partial, to recognize invalid sequences.
No code achieves all qualities: the choice depends on the medium and speed [1][2][3].
In the NRZ (non-return to zero) code, a high level represents $1$ and a low level $0$: minimum bandwidth, but no synchronization if bits remain the same for a long time and a DC component that depends on the data. The Manchester code encodes each bit with a transition in the middle of the bit period: by convention, bit $1$ is a low-to-high transition and bit $0$ is a high-to-low transition. Thus, each bit has at least one transition (synchronization guaranteed), the average value is zero, but the transition frequency doubles and the occupied bandwidth is about twice that of NRZ. It is used in Ethernet at $10\ \mathrm{Mbit/s}$ [1][2][3].
The 8b/10b code replaces every group of $8$ bits with a $10$-bit symbol chosen from a table, so as to always have a sufficient number of transitions (no more than $5$ identical consecutive bits) and a limited imbalance between ones and zeros (controlled disparity), with zero average value. It costs $25\ \%$ more channel speed, but synchronization and controlled DC component are achieved, and special control symbols exist. Other modern codes (64b/66b, with less overhead) use scrambling to maintain transitions [1][3][4].
The receiver extracts the clock from the signal (with a phase-locked loop), samples the levels at the center of the bit period, and reconverts them into the original bits, checking that the received sequence is allowed by the code: for Manchester, each bit period must have the mid-bit transition; for 8b/10b, each symbol must belong to the table [1][2][4].
Transmission at $10\ \mathrm{Mbit/s}$ of the sequence $1\,0\,1\,1\,0\,0\,1\,0$ in Manchester code (convention above).
1. Bit duration: $100\ \mathrm{ns}$; central transition after $50\ \mathrm{ns}$.
2. Half periods (low/high, for $1$: low then high; for $0$: high then low): $\mathrm{BA}\ \mathrm{AB}\ \mathrm{BA}\ \mathrm{BA}\ \mathrm{AB}\ \mathrm{AB}\ \mathrm{BA}\ \mathrm{AB}$.
3. The maximum transition frequency is $20\ \mathrm{MHz}$ (two half periods per bit), twice that of NRZ, which reaches $5\ \mathrm{MHz}$ with the sequence $1010\ldots$.
4. With $8\mathrm{b}/10\mathrm{b}$ for a data stream of $1\ \mathrm{Gbit/s}$ the line rate is $1\cdot10/8 = 1{,}25\ \mathrm{Gbaud}$, that is $250\ \mathrm{Mbaud}$ more.
5. With 8b/10b there are never more than $5$ consecutive identical symbols, and with Manchester no more than two identical half periods.
NRZ and Manchester codes are used in low-speed Ethernet, RFID tags, and field buses; 8b/10b in Gigabit Ethernet, SATA, PCI Express (early generations), and DisplayPort; other line codes are used in telephony (HDB3) and fiber optic links.
[1] Wikipedia (fr): Codage Manchester
[2] Wikipedia (en): Manchester code
[3] Wikipedia (en): Line code
[4] Wikipedia (en): 8b/10b encoding
Generating summary…