Line Encoding

The previous pages looked at the types of physical media that are used to transport the data. In transmitting data, there must be a method of representing the digital logic levels using the physical attributes associated with the media.

As the length of the media increases and the transfer rate (line speed) increases, new problems of corruption of data appear at the receiving end. This is due to the physical characteristics and limitations of the media itself. Several methods of representing the data on the media have been developed to address these problems - some more successful than others. It is not a trivial solution as it has taken years of development to reach the current state.

Line encoding is the method used to represent the digital information on the media. A pattern, that uses either voltage or current, is used to represent the 1s and 0s of the digital signal on the transmission link. This chapter discusses the methods that are used most often in data communications

Common types of line encoding methods used in data communications are:

  • Unipolar line encoding
  • Polar line encoding
  • Bipolar line encoding
  • Manchester line encoding.

Unipolar Encoding

Unipolar encoding has 2 voltage states with one of the states being 0 volts. Since Unipolar line encoding has one of its states being 0 Volts, it is also called Return to Zero (RTZ). A common example of Unipolar line encoding is the logic levels used in computers and digital logic. A logic High (1) is represented by +5V and a logic Low (0) is represented by 0V.

Unipolar line encoding works well for inside machines where the signal path is short but is unsuitable for long distances due to the presence of stray capacitance in the transmission medium. On long transmission paths, the constant level shift from 0 volts to 5 volts causes the stray capacitance to charge up. There will be a "stray" capacitor effect between any two conductors that are in close proximity to each other. Parallel running cables or wires are very suspectible to stray capacitance.

If there is sufficient capacitance on the line and a sufficient stream of 1s, a DC voltage component will be added to the data stream. Instead of returning to 0 volts, it would only return to 2 or 3 volts! The receiving station may not recognize a digital low at voltage of 2 volts!

Unipolar line encoding can have synchronization problems between the transmitter and receiver's clock oscillator. The receiver's clock oscillator locks on to the transmitted signal's level shifts (logic changes from 0 to 1). If there is a long series of logical 1s or 0s in a row. There is no level shift for the receive oscillator to lock to. The receive oscillator's frequency may drift and become unsynchronized. It could lose track of where the receiver is supposed to sample the transmitted data!

Receive oscillator may drift during the period of all 1s

Polar Encoding

When the digital encoding is symmetrical around 0 Volts, it is called a Polar Code. The RS-232D interface uses Polar line encoding. The signal does not return to zero, it is either a +ve voltage or a -ve voltage. Polar line encoding is also called None Return To Zero (NRZ). Polar line encoding is the simplest pattern that eliminates most of the residual DC problem.

There is still a small residual DC problem but Polar line encoding is a great improvement over Unipolar line encoding. Polar encoding has an added benefit in that it reduces the power required to transmit the signal by one-half compared with unipolar.


Polar line encoding has the same synchronization problem as Unipolar line encoding. If there is a long string of logical 1s or 0s, the receive oscillator may drift and become unsynchronized.

Bipolar Line Encoding

Bipolar line encoding has 3 voltage levels, a low or 0 is represented by a 0 Volt level and a 1 is represented by alternating polarity pulses. By alternating the polarity of the pulses for 1s, the residual DC component cancels.

Bipolar Line Encoding

Synchronization of receive and transmit clocks is greatly improved except if there is a long string of 0s transmitted. Bipolar line encoding is also called Alternate Mark Inversion (AMI).

Manchester Line Encoding

In the Manchester Line Encoding, there is a transition at the middle of each bit period. The mid-bit transition serves as a clocking mechanism and also as data: a low to high transition represents a 1 and a high to low transition represents a 0.

Manchester line encoding has no DC component and there is always a transition available for synchronizing receive and transmit clocks. Manchester line encoding is also called a self clocking line encoding. It has the added benefit of requiring the least amount of bandwidth compared to the other line encoding. Manchester line encoding requires 2 frequencies: the base carrier and 2 x the carrier frequency. All others require a range from 0 hertz to the maximum transfer rate frequency.

Manchester line encoding can detect errors during transmission. a transition is expected during every bit period. The absence of a transition would indicate an error condition.

If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.

Return to

TelecomWorld 101

Copyright July 2013 Eugene Blanchard