Why do we need to use Manchester encoding for Ethernet transmissions?

11

4

When you want to transfer data from one computer to another, your data (in binary form) will first go to the NIC (Network Interface Card) where the data will be encoded (with timer clock tick for example) and sent over the network under an electronic signal.

An example of Manchester Encoding:

101110011001   // data
101010101010   // timer tick on network
000100110011   // result using XOR

Why doesn't the NIC directly transfer the binary data but must encode it first?

hqt

Posted 2012-08-05T11:14:35.400

Reputation: 295

Answers

13

Because using manchester encoding has a nice advantage, self-clocking (lower error rate and a more reliable transmission).

This is because rather at looking at the +5 volt to 0 volt to encode a bit, it will depend on the direction of a transmission how a bit is encoded.

enter image description here
Image source

Normally you would first need to synchronize a clock before being able to transmit. Because of this encoding Manchester Encoding doesn't need this.

Lucas Kauffman

Posted 2012-08-05T11:14:35.400

Reputation: 2 545

No, I don't ask advantage of Machester Encoding, I just want to know why need encoding ? – hqt – 2012-08-05T11:44:11.760

2Like I said, because when you do not encode them, you need to synchronize the clock separately, which means you will have a higher error rate and lower transmission. – Lucas Kauffman – 2012-08-05T11:46:34.607

But I think, if you encode (Machester encoding or another encoding, too), two clock still must work at same frequently, or it will decode wrong. – hqt – 2012-08-05T11:55:59.123

No it doesn't because the clock is part of the way it's encoded, as you see you do not go up and down to the baseline, instead the baseline is there to tell you when nothing is being sent. So a separate clock is not necessary anymore – Lucas Kauffman – 2012-08-05T12:53:38.153

3Additional reason: prevents long runs of 0s or 1s, so errors (eg.: disconnections) will be more evident. – tucuxi – 2012-08-05T13:28:23.100

@hqt - Circular questioning. The advantages Manchester Encoding (self clocking, error correction and detection) delivers is why it is needed and used instead of a straight binary transmission. See @ sawdust's answer. There is simplicity in complexity in this case. – Fiasco Labs – 2012-08-06T01:37:22.887

@hqt: Same frequency. Different phase. – Ignacio Vazquez-Abrams – 2012-08-06T02:46:53.253

13

There are at least three (there may be more) reasons for using an encoding (such as the Manchester encoding you mention) when transmitting digital information:

  • The data and clock are combined into one signal. If the clock was not sent with the data, then the receiver would not know when to sample the signal to extract the digital values. Even if the transmitter and receiver are somehow perfectly synchronized, the infinitesimal delay of the transmission medium would have to be accounted for. The other alternative is to accompany the data line with a clock line, but that doubles the number of wires. It's cheaper & more reliable to double (or halve, depending on perspective) the cable & transceiver bandwidth requirements (or capabilities) than use more wire & bulkier connectors.
  • A long string of nulls (zeroes) will no longer look like a dead or disconnected line. A long sting of ones no longer look like a stuck level.
  • The encoded signal has a more balanced energy profile, i.e. the voltage averaged over time should tend toward zero. The logic signal on the circuit board uses 0 volts for logic zero and a positive voltage (5 volts for old TTL, 3.3 volts or less for modern logic) for logic one. Only data logic of all zeros would have a null energy profile; any other data pattern would always have a greater than zero average voltage level and a characteristic magnetic field. But since encodings such as Manchester use both positive and negative voltage levels, the magnetic fields created by the transmitted signal are much smaller as they will tend to cancel each other. This allows wires to be bundled closer together in cables yet create less interference with each other. (Even slow transmission schemes like RS/EIA-232 use both positive and negative voltage levels to balance the energy profile. Probably board-to-board connections less than 0.5 meter and within an enclosure would use only positive voltages.)

sawdust

Posted 2012-08-05T11:14:35.400

Reputation: 14 697

IEEE 1284 uses only positive voltages, TTL levels. – Ignacio Vazquez-Abrams – 2012-08-06T02:59:35.190

@IgnacioVazquez-Abrams - LOL, OK you found an exception, but I hedged that remark with "probably". And it typically uses ribbon (i.e. flat & wide) cable with alternating ground-signal-ground-signal conductors. The point that I was trying for was to mention where you would most likely find positive-voltage-only datalinks; I was not trying to characterize an application restriction. – sawdust – 2012-08-06T03:36:08.017

3

To completely know the reason why Manchester Encoding is used, one must be aware of the following:

  1. Clock signals
  2. Synchronous signals
  3. Encoding

After that, the reason is: "what is needed is a way for receivers to unambiguously determine the start, end or middle of the each bit without reference to an external clock

And finally, to do this, Manchester encoding is one of the approaches.

Sandeep Kumar

Posted 2012-08-05T11:14:35.400

Reputation: 31

3

Basically Manchester code is used in preference over many other types, because it is self synchronising.

Synchronisation can be lost with other types when there are a string of zero's or one's where data is not changing. Manchester code does not have this problem due to the fact there will always be a change in signal level, whenever data is present.

The only problem with Manchester code is that you need double the frequency of your data rate, as 8 bits is made into 16 bits of data. So if you require a data rate of 5K you would need a baud rate of 10K.

Addendum I hope the link is allowed but just in case it is not, go to the Maxim site and search Manchester Data Encoding for Radio Communications. http://www.maximintegrated.com/en/app-notes/index.mvp/id/3435 This should help anyone to understand the merits of this encoding.

Late Developer

Posted 2012-08-05T11:14:35.400

Reputation: 31