Line Coding

Transforming binary data into physical signals for transmission (NRZ, RZ, Manchester, AMI, HDB-3).

Why Do We Need Line Coding?

In digital systems, information is represented as a sequence of abstract bits (0s and 1s). However, to send this information over a physical medium like a copper wire or optical fiber, these abstract bits must be converted into a physical signal-for example, a varying voltage or light pulse. This conversion process is called line coding or channel coding.

Simply using a high voltage for '1' and a low/zero voltage for '0' (a scheme known as NRZ) is often insufficient for reliable communication due to several critical problems. Good line codes are designed to overcome these challenges.

Desirable Properties of Line Codes

An effective line code should possess several key characteristics to ensure robust and efficient data transmission:

  • DC Component Minimization: The signal should have a zero or near-zero average voltage, known as being DC-balanced. Many networks use transformers or AC-coupling, which block a persistent , leading to signal distortion.
  • Self-Synchronization: The code must ensure frequent transitions (changes in signal level) regardless of the data being sent. The receiver uses these transitions to extract a and stay synchronized with the transmitter, which is crucial for preventing errors caused by timing drift.
  • Bandwidth Efficiency: The code should occupy the minimum possible bandwidth for a given data rate. Some codes, while offering good synchronization, require double the bandwidth of simpler codes.
  • Error Detection Capability: Some codes have inherent rules where certain signal sequences are invalid. If the receiver detects an invalid sequence, it knows a transmission error has occurred.
  • Transparency: The code must be able to reliably transmit any sequence of bits, including long strings of all 0s or all 1s, without losing synchronization or introducing a significant DC component.

Common Line Codes

Let's explore several key line codes, evaluating them against the properties above.

NRZ (Non-Return-to-Zero)

The most basic line code where the signal level is constant throughout the bit's duration.

  • Bipolar NRZ: Logical '1' is represented by a positive voltage (+V+V), and '0' is represented by a negative voltage (−V-V).
  • Unipolar NRZ: Logical '1' is a positive voltage (+V+V), and '0' is zero voltage (0V0V).

Evaluation: Simple and bandwidth-efficient (main spectral lobe extends to fclkf_{clk}). However, it suffers from a significant DC component (especially the unipolar version) and poor clock recovery on long sequences of identical bits, making it unreliable for many systems.


RZ (Return-to-Zero)

In RZ, a '1' is represented by a pulse that only lasts for half of the bit duration, returning to zero for the second half. A '0' is represented by no pulse (0V).

Evaluation: The presence of a spectral line at the clock frequency (fclkf_{clk}) makes synchronization much easier. However, it requires twice the bandwidth of NRZ and still has a DC component problem and loses sync on long strings of zeros.


AMI (Alternate Mark Inversion)

AMI is a three-level (ternary) code designed to eliminate the DC component.

  • Logical '0' is represented by 0V.
  • Logical '1's ("Marks") are represented by alternating positive (+V+V) and negative (−V-V) pulses.

Evaluation: Excellent DC balance regardless of data content. However, like NRZ, a long sequence of '0's results in no signal transitions, leading to a loss of synchronization. This is its primary weakness.


HDB3 (High-Density Bipolar - 3 zeros)

An intelligent modification of AMI, widely used in European E1 digital telephony systems, designed specifically to solve its synchronization problem.

  • It follows the same rules as AMI.
  • Exception: When a sequence of four consecutive zeros (00000000) occurs, it is replaced with a special substitution sequence containing a "violation" pulse (VV), which breaks the alternating rule of AMI.
  • The choice of substitution sequence (000V000V or B00VB00V) is made to maintain overall DC balance. BB is a standard bipolar pulse that conforms to the alternating rule.

Evaluation: HDB3 effectively solves the long-zeroes problem of AMI, guaranteeing synchronization while retaining its excellent DC-balance properties.


Manchester Code

Manchester code is a two-phase code where every bit period contains a signal transition in the middle, effectively embedding the clock signal into the data stream.

  • A logical '0' can be a high-to-low transition.
  • A logical '1' can be a low-to-high transition.

Evaluation: Guarantees excellent synchronization due to the transition in every bit, and has no DC component. Its main drawback is low bandwidth efficiency, requiring twice the bandwidth of NRZ.

    Line Coding | Teleinf Edu