Communication Systems/Line Codes

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Contents

[edit] Line Codes


In addition to pulse shaping, there are a number of useful line codes that we can use to help reduce our errors or to have other positive effects on our signal.

Line coding consists of representing the digital signal to be transported, by an amplitude- and time-discrete signal, that is optimally tuned for the specific properties of the physical channel (and of the receiving equipment). The waveform pattern of voltage or current used to represent the 1s and 0s of a digital signal on a transmission link is called line encoding. The common types of line encoding are unipolar, polar, bipolar and Manchester encoding.

Line codes are used commonly in computer communication networks over short distances.

There are numerous ways digital information can be coded onto a transmission medium. Some of the more common include:

Line code table.gif
Common line codes
Signal Comments

NRZ-L

Non-return to zero level. This is the standard positive logic signal format used in digital circuits.
1 forces a high level
0 forces a low level

NRZ-M

Non-return to zero mark.
1 forces a transition
0 does nothing

NRZ-S

Non-return to zero space.
1 does nothing
0 forces a transition

RZ

Return to zero.
1 goes high for half the bit period
0 does nothing

Biphase-L

Manchester. Two consecutive bits of the same type force a transition at the beginning of a bit period.
1 forces a negative transition in the middle of the bit
0 forces a positive transition in the middle of the bit

Biphase-M

There is always a transition at the beginning of a bit period. 1 forces a transition in the middle of the bit. 0 does nothing.

Biphase-S

There is always a transition at the beginning of a bit period. 1 does nothing
0 forces a transition in the middle of the bit.

Differential Manchester

There is always a transition in the middle of a bit period.
1 does nothing
0 forces a transition at the beginning of the bit

Bipolar

The positive and negative pulses alternate.
1 forces a positive or negative pulse for half the bit period
0 does nothing


Line code drawing.gif

Each of the various line formats has a particular advantage and disadvantage. It is not possible to select one, which will meet all needs. The format may be selected to meet one or more of the following criteria:

• Minimize transmission hardware
• Facilitate synchronization
• Ease error detection and correction
• Minimize spectral content
• Eliminate a dc component

The Manchester code is quite popular. It is known as a self-clocking code because there is always a transition during the bit interval. Consequently, long strings of zeros or ones do not cause clocking problems.

[edit] Non-Return to Zero Codes (NRZ)


Non-Return to Zero (NRZ) codes are a bit awkwardly named, especially considering that the unipolar NRZ code does return to a zero value. In essence, an NRZ code is just a simple square wave, assigning one value to a binary 1, and another amplitude to a binary 0.

NRZ codes are more bandwidth efficient than bipolar ones. However, their spectral components go all the way down to 0 Hz. This prevents them from being used on transmission lines which are transformer coupled, or for some other reason cannot carry DC.

NRZ spectrum.gif

[edit] Unipolar NRZ

Unipolar NRZ is simply a square wave with +AV being a binary 1, and 0V being a binary 0. NRZ is convenient because computer circuits use unipolar NRZ internally, and it requires little effort to expand this system outside the computer. Unipolar NRZ has a DC term, but a relatively narrow bandwidth.

[edit] Bipolar NRZ

Bipolar NRZ operates using a bipolar voltage supply rail. Marks typically are represented using negative voltages (e.g., -9V), while spaces with positive voltages (e.g., +9V). For example, RS-232C/EIA-232 signaling relies on bipolar NRZ.

-5V +5V -5V +5V -5V -5V +5V -5V -5V
 1  0   1   0   1   1   0   1   1

Bipolar NRZ has similar bandwidth and DC balance issues as unipolar NRZ.

[edit] AMI

AMI (alternate mark inversion) is another example of a bipolar line code. Each successive mark is inverted and the average or DC level of the line is therefor zero. This system cannot readily be used on fiber optic links.

AMI.gif

AMI is usually implemented as RZ pulses, but NRZ and NRZ-I variants exist as well.

One of the weaknesses of this approach is that long strings of zeros cause the receivers to loose lock. It is therefor necessary to impose other rules on the signal to prevent this. For example, combining NRZ-M with AMI yields MLT-3, the line coding system used with 100-base-T Ethernet.

[edit] CMI

The CMI bipolar line code is actually a slightly different form of the original FM line coding used in single-density disk drives and audio cassette tapes. Marks are encoded as alternate polarity full period pulses. Spaces are encoded by half a period at the negative voltage and half period at the positive voltage. This coding scheme has the advantage that it requires less logic to implement than HDB3.

CMI.gif

[edit] Manchester


Manchester codes were an invention that allows for timing information to be sent along with the data. In an NRZ code, if there is a long stream of ones or zeros, the receiver could conceivably suffer so much compound jitter that it would either lose or gain an entire bit time, and then be out of sync with the transmitter. This is because a long stream of 1s or 0s would not "change state" at all, but instead would simply stay at a single value. Manchester codes say that every single bittime will have a transition in the middle of the bit time, so that a receiver could find that transition, and "lock on" to the signal again, if it started to stray away from center. Because there are more transitions, however, manchester codes also require the highest bandwidth of all the line codes.

Information

Ethernet LAN uses manchester codes

[edit] Differential Codes

Some communication channels (such as phase-modulated sine waves and differential twisted pairs) have the characteristic that transitions between the 2 symbols used can be easily distinguished, but when first starting to receive it is difficult to tell which of the 2 states it is in. For example, full-speed USB uses a twisted pair and transmits +3.3 V on one line and 0 V on the other line for "1", but 0 V on the one line and +3.3 V on the other line for "0". Because some cables have an extra half-twist in them, it is impossible for a device that was just plugged in to tell whether the symbol it is currently receiving is a "1" or a "0".

Differential codes still work, not even noticing when the 2 wires get switched.


Differential codes, in general, look exactly the same on a oscilloscope or spectrum analyzer as the non-differential code they are based on, and so use exactly the same bandwidth and have exactly the same bitrate.

Differential codes that work when the 2 wires get switched include:

  • Differential Manchester encoding -- based on Manchester encoding
  • Non-Return-to-Zero Inverted (NRZI) -- based on non-return-to-zero (NRZ)

(A few non-differential codes also work even when the 2 wires get switched -- such as bipolar encoding, and MLT-3 encoding).


[edit] Differential NRZ

[edit] Differential Manchester

[edit] Comparison

Code bandwidth timing DC value
Unipolar NRZ low bandwidth no timing information High DC component
Bipolar NRZ lower bandwidth no timing information no DC component
Differential NRZ lower bandwidth no timing information little or no DC component
Manchester high bandwidth Good clock recovery no DC component
Differential Manchester moderate bandwidth Good clock recovery No DC Component

[edit] further reading