Communication - Digital Encode                                     Home : www.sharetechnote.com

 

 

 

Why we need Digital Encoding ?

 

First I assume that you know what Encoding is (Refer to Encoding page if you are not familiar with the concept of Encoding).

Now the question is why we need Digital Encoding. Here goes some of the reason why.

 

< Spectral Efficiency >

 

According to Fourier Transform, a Digital Pulse contains frequencies of infinite range. So theoretically we need to implement a physical medium that can transfer the signal with infinite frequency range, but it is practically impossible. So it would be good if we can have a some technique to concentrate the frequency of digital signal into a specific region as narrow as possible. Channel Coding can be a measure to achieve this goal.

 

< Removing DC Offset >

 

If we just map the digital bit 1 to +V volt and bit 0 to +0 volt (or -V volt), a certain bit pattern (all zero bit or all one bit) can create DC Offset along the communication media which may cause various problem. By applying a proper Digital Encoding technique, you can reduce (even though you may not completely remove) the DC offset.

 

< Assisting Synchronization >

 

A certain signal pattern which does not have much transition in it (e.g, long period of '+V' or long period of '-V') may make it difficult for the reciever to get synchronized. By applying a proper encoding technique, you can reduce such a period in which the signal stays at the same voltage level. It helps synchronization on reciever side.

 

< Increase immunitity against Signal Interference and Noise >

 

Some Coding Technique can shows the better performance in terms of BER vs SNR.

 

Followings are some of the digital encoding techniquest commonly used in the field.  You would often come across these words when you are reading specification sheet or technical documents about digital communication system.

 

 

RZ vs NRZ

 

RZ stands for 'Return to Zero' and NRZ stands for 'No Return to Zero'. As shown in the following illustration, in RZ there is a certain period in which the signal level goes to 'zero' and stays there for some time. In NRZ, the signal jump between +V and -V at the bit boundary and never stays at zero within the bit duration.

 

There a couple of different type of NRZ. In concept, you can map the bit to +V or to -V in any way. The illustration shown below shows the case where '1' maps to '+V' and '0' maps to '-V'.

 

 

In practice, special type of NRZ valled 'NRZ-L' and 'NRZ-I' are more frequency used. In NRZ-L, the bit '0' maps to electric level '+V' and the bit '1' maps to the electric level '-V' as shown below. In NRZ-I, the bit value does not map to any specific signal level, the bits are mapped to a certain transistion of signal level. '1' maps to 'transition' and '0' maps to 'no transision'. When it hits '0, the signal level stay same as the signal level of previous bit whatever it is. When it hits '1', the signal level changes to opposite value from the signal level of previous bit. (It may be a little bit confusing at the beginning, so try to understand the concept clearly)

 

 

In case of electrical signal, we can map plus(+) and minus (-) level signal to the bit '1' or '0', but in case of optical signal, we cannot do the same thing since there is no minus (-) level in optics. so one of the optical bits should be mapped to zero as shown below.

 

 

< Pros and Cons of NRZ >

 

Pros :

  • As you may recognize in the description above, it is very simple to understand and simple to implement
  • Relatively good spectral efficiency : it can achieve 2 bits/Hz spectral efficiency

 

Cons :

  • A certain bit pattern can cause DC offset. For example, '11111...' or '00000...' can cause DC offset in NRZ-L and '0000...' in NRZ-I can cause DC offset.
  • Due to the same reason as DC offset, the long duration can generate a long duration of signal without any transition and this would make the reciever to get synchronized.

 

 

Manchester / Differential Manchester

 

In Manchester and Differential Manchester, both 0 and 1 is mapped to a certain pattern of transition. So whatever the bit pattern, you would always see the transition. The transition pattern is defined as follows :

 

Manchester :

  • 0 => Transition from high to low in the middle of bit period
  • 1 => Transition from low to high in the middle of bit period

Differential Manchester :

  • 0 => Transition at the beginning of the bit period
  • 1 => no transition at the beginning of the bit period
  • In any case, transition happens in the middle of bit period

 

 

 

Bipolar AMI (Alternative Mark Inversion)

 

This encoding method is using 3 signal levels (+V, 0, -V). and mapping goes as follows :

  • 0 => No signal. Signal level Zero
  • 1 => maps the +V or -V depending on previous '1' signal. If previous '1' level is '-V', the current '1' maps to '+V', If previous '1' level is '+V', the current '1' maps to '-V'

 

 

Pros :

  • Good condition for Sync in case of long string of '1's since it always make transision.
  • Zero DC offset whatever the bit string is
  • Bandwidth efficiency (Majority of power concentrates in less bandwith than in NRZ case)
  • Possible Error Detection (If you see the same non-zero signal level more than 1 consecutive bit period, it implies there is error)

Cons :

  • Possible Synchronization issue with long string of '0' since there is no transition and signal level stays always at '0'
  • A little bit of redundancy because 3 levels are used to implement one bit.
  • 3dB SNR loss in terms of BER vs SNR comparing to NRZ case.

 

 

B8ZS

 

 

 

3B/4B Encoding

 

3B/4B Encoding is a method to replace '3 bit' original data (input) with '4 bit' data (output). The input and output mapping of this encoding is based on following table. (Auctually this table just shows the result of the encoding, but in many case real implementation is done by statemachine running a predefined rule).

 

3B Input (Decimal)

3B Input (Binary)

4B Output (Binary)

0

000

0100 or 1011

1

001

1001

2

010

0101

3

011

0011 or 1100

4

100

0010 or 1101

5

101

1010

6

110

0110

7

111

0001 or 1100 or 1000 or 0111

 

 

 

5B/6B Encoding

 

5B/6B Encoding is a method to replace '5 bit' original data (input) with '6 bit' data (output). The input and output mapping of this encoding is based on following table. (Auctually this table just shows the result of the encoding, but in many case real implementation is done by statemachine running a predefined rule).

 

5B Input (Decimal)

5B Input (Binary)

6B Output (Binary)

0

00000

100111 or 011000

1

00001

011101 or 100010

2

00010

101101 or 010010

3

00011

110001

4

00100

110101 or 001010

5

00101

101001

6

00110

011001

7

00111

111000 or 000111

8

01000

111001 or 000110

9

01001

100101

10

01010

010101

11

01011

110100

12

01100

001101

13

01101

101100

14

01110

011100

15

01111

010111 or 101000

16

10000

011011 or 100100

17

10001

100011

18

10010

010011

19

10011

110010

20

10100

001011

21

10101

101010

22

10110

011010

23

10111

111010 or 000101

24

11000

110011 or 001100

25

11001

100110

26

11010

010110

27

11011

110110 or 001001

28

11100

001110

29

11101

101110 or 010001

30

11110

011110 or 100001

31

11111

101011 or 010100

 

 

8B/10B Encoding

 

8B/10B Encoding is a method to replace '8 bit' original data (input) with '10 bit' data (output). This encoding is implemented by combining two simpler encoding method 3B/4B and 5B/6B as illustrated below.

 

 

Describing this in written form, it goes as follows.

    i) Take the Input Data Bits: HGFEDCBA

    ii) Split the Data into two blocks: HGF EDCBA

    iii) Swap the position of the two blocks/shuffle the bits in each block : abcdei fghj

 

8B/10B is a kind of encoding scheme and it is not the predefined encoding table. The output of 8B/10B would vary depending on how the shuffling statemachine is defined. So you would need to refer to the specification of each application if you want to know exact mapping table for any specific application.