Line coding
NRZ, Manchester and PAM4
Two bit patterns, 1 1 0 1 0 0 and 1 0 1 0 1 0 1 0, each drawn three ways on one time axis with the clock above, to show what each scheme puts on the wire.
NRZ
The line holds high for a 1 and low for a 0 for the whole bit. Two equal bits in a row produce a flat line with no edge, so long runs give the receiver nothing to lock its clock to. The fastest pattern, alternating 1 and 0, completes one cycle every two bits: its frequency is half the bit rate (the Nyquist frequency).
Manchester
Every bit has an edge in its middle: rising for 1, falling for 0. That edge is the data. When two equal bits follow each other, the line must also flip at the boundary between them to be ready for the next middle edge; those boundary edges (amber) carry no information. Because there is an edge in every bit, the receiver can recover the clock from the data, and every bit is half high and half low, so the average stays at zero. The cost: a run of equal bits toggles every half-bit, a full cycle per bit, so it needs twice NRZ's bandwidth.
PAM4
The bits are taken in pairs: 11, 01, 00. Each pair picks one of four levels, held for two bit-times. This is the scheme that genuinely carries two bits per symbol. NRZ and Manchester both carry one bit per bit-time; Manchester just switches more often.
The alternating pattern: 1 0 1 0 1 0 1 0
The same three schemes behave very differently on 10101010, which is why this pattern is used to test links.
- NRZ changes on every bit, its fastest possible pattern: one full cycle per two bits, a square wave at exactly half the bit rate. This is the pattern that puts all its energy at the Nyquist frequency, so it is the one that loses most in a lossy cable.
- Manchester needs no boundary edges at all here: each bit already ends at the level the next bit starts from. It toggles only at mid-bit, once per bit, which is also half the bit rate. Manchester's worst case is the opposite pattern, 1111 or 0000, which toggles every half-bit.
- PAM4 reads the stream as the pair 10 four times, so it sends +3 for the whole time: no edges at all. NRZ's easiest-to-recover pattern becomes PAM4's hardest. Real PAM4 links scramble the data so this cannot persist.
Comparison
| Scheme | Bits per symbol | Fastest edge rate | Highest frequency |
|---|---|---|---|
| NRZ | 1 | one edge per bit (1010…) | ½ × bit rate |
| Manchester | 1 | one edge per half-bit (1111… or 0000…) | 1 × bit rate |
| PAM4 | 2 | one edge per symbol | ½ × symbol rate (¼ × bit rate) |
More on each scheme, with spectra and block codes, in the Line Coding Primer.