Line Coding and Block Coding

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

LINE CODING

i. A line code is the code used for data transmission of a digital signal over a transmission line.
This process of coding is chosen so as to avoid overlap and distortion of signal such as inter-
symbol interference.

ii. The process for converting digital data into digital signal is said to be Line Coding. Digital data is
found in binary format. It is represented (stored) internally as series of 1s and 0s.

Properties of Line Coding:


 As the coding is done to make more bits transmit on a single signal, the bandwidth used
is much reduced.
 For a given bandwidth, the power is efficiently used.
 The probability of error is much reduced.
 Error detection is done and the bipolar too has a correction capability.
 Power density is much favorable.
 The timing content is adequate.
 Long strings of 1s and 0s is avoided to maintain transparency.

Types of Line Coding:


There are 3 types of Line Coding:
1. Unipolar Signaling:
i. Unipolar signaling is also called as On-Off Keying or simply OOK. The presence of pulse
represents a 1 and the absence of pulse represents a 0.
ii. Unipolar encoding schemes use single voltage level to represent data. In this case, to represent
binary 1, high voltage is transmitted and to represent 0, no voltage is transmitted.
iii. There are two variations in Unipolar signaling −

 Non Return to Zero NRZ


 Return to Zero RZ

Unipolar Non-Return to Zero (NRZ):

In this type of unipolar signaling, a High in data is represented by a positive pulse called
as Mark, which has a duration T  equal to the symbol bit duration. A Low in data input has no
0

pulse.
The following figure clearly depicts this.

Advantages:
The advantages of Unipolar NRZ are −

 It is simple.
 A lesser bandwidth is required.

2
Disadvantages:
The disadvantages of Unipolar NRZ are −
 No error correction done.
 Presence of low frequency components may cause the signal droop.
 No clock is present.
 Loss of synchronization is likely to occur (especially for long strings of 1s and 0s).

Unipolar Return to Zero RZ:

In this type of unipolar signaling, a High in data, though represented by a Mark pulse, its
duration T  is less than the symbol bit duration. Half of the bit duration remains high but it
0

immediately returns to zero and shows the absence of pulse during the remaining half of the
bit duration.
It is clearly understood with the help of the following figure.

Advantages:
The advantages of Unipolar RZ are −

 It is simple.
 The spectral line present at the symbol rate can be used as a clock.

3
Disadvantages:
The disadvantages of Unipolar RZ are −

 No error correction.
 Occupies twice the bandwidth as unipolar NRZ.
 The signal droop is caused at the places where signal is non-zero at 0 Hz.

2. Polar Signaling:
There are two methods of Polar Signaling. They are −

 Polar NRZ
 Polar RZ

Polar NRZ:

In this type of Polar signaling, a High in data is represented by a positive pulse, while a Low in
data is represented by a negative pulse. The following figure depicts this well.

Advantages:
The advantages of Polar NRZ are −

 It is simple.
 No low-frequency components are present.

4
Disadvantages:
The disadvantages of Polar NRZ are −
 No error correction.
 No clock is present.
 The signal droop is caused at the places where the signal is non-zero at 0 Hz.

Polar RZ

In this type of Polar signaling, a High in data, though represented by a Mark pulse, its
duration T  is less than the symbol bit duration. Half of the bit duration remains high but it
0

immediately returns to zero and shows the absence of pulse during the remaining half of the
bit duration.
However, for a Low input, a negative pulse represents the data, and the zero level remains
same for the other half of the bit duration. The following figure depicts this clearly.

Advantages:
The advantages of Polar RZ are −

 It is simple.
 No low-frequency components are present.

5
Disadvantages:
The disadvantages of Polar RZ are −
 No error correction.
 No clock is present.
 Occupies twice the bandwidth of Polar NRZ.
 The signal droop is caused at places where the signal is non-zero at 0 Hz.

3. Bipolar Signaling :
This is an encoding technique which has three voltage levels namely +, - and 0. Such a signal is
called as duo-binary signal.
An example of this type is Alternate Mark Inversion AMIAMI. For a 1, the voltage level gets a
transition from + to – or from – to +, having alternate 1s to be of equal polarity. A 0 will have a
zero voltage level.
Even in this method, we have two types.

 Bipolar NRZ
 Bipolar RZ

6
The above figure has both the Bipolar NRZ and RZ waveforms. The pulse duration and symbol
bit duration are equal in NRZ type, while the pulse duration is half of the symbol bit duration in
RZ type.

Advantages:

 It is simple.
 No low-frequency components are present.
 Occupies low bandwidth than unipolar and polar NRZ schemes.
 This technique is suitable for transmission over AC coupled lines, as signal drooping
doesn’t occur here.
 A single error detection capability is present in this.

Disadvantages:

 No clock is present.
 Long strings of data causes loss of synchronization.

BLOCK CODING
i. Block coding refers to the technique of adding extra bits to a digital word in order to improve
the reliability of transmission.
ii. The word consists of the message bits (often called information, or data) plus code bits. It may
also, as in the present case, contain a frame synchronization bit.
iii. A block code adds bits to existing message bits, or blocks, independently of adjacent blocks 1.
iv. In block coding, we divide our message into blocks, each of k bits, called data words. We add r
redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called
code words.
v. For example, we have a set of data words, each of size k, and a set of code words, each of size
of n. With k bits, we can create a combination of 2k data words, with n bits; we can create a
combination of 2n code words. Since n > k, the number of possible code words is larger than
the number of possible data words in the message being transferred.

7
vi. The block coding process is one-to-one; the same data word is always encoded as the same
code word. This means that we have 2n-2k code words that are not used. We call these code
words invalid or illegal. The following figure shows the situation.

Error Detection
If the following two conditions are met, the receiver can detect a change in the original code
word by using Block coding technique.

1. The receiver has (or can find) a list of valid code words.

2. The original code word has changed to an invalid one.

The sender creates code words out of data words by using a generator that applies the rules
and procedures of encoding (discussed later). Each code word sent to the receiver may change
during transmission. If the received code word is the same as one of the valid code words, the
word is accepted; the corresponding data word is extracted for use.

If the received code word is not valid, it is discarded. However, if the code word is corrupted
during transmission but the received word still matches a valid code word, the error remains
undetected. This type of coding can detect only single errors. Two or more errors may remain
undetected.
 
For example consider the following table of data words and Code words:

8
Assume the sender encodes the data word 01 as 011 and sends it to the receiver. Consider the
following cases:

1. The receiver receives O11. It is a valid code word. The receiver extracts the data word 01
from it.

2. The code word is corrupted during transmission, and 111 is received (the leftmost bit is
corrupted). This is not a valid code word and is discarded.

3. The code word is corrupted during transmission, and 000 is received (the right two bits are
corrupted). This is a valid code word. The receiver incorrectly extracts the data word 00. Two
corrupted bits have made the error undetectable.

Error Correction:

Error correction is much more difficult than error detection. In error detection, the receiver
needs to know only that the received code word is invalid, in error correction the receiver
needs to find (or guess) the original code word sent. So, we need more redundant bits for error
correction than for error detection.

Consider the following table of Data words and Code words.

9
Assume the data word is 01. The sender consults the table (or uses an algorithm) to create the
code word 01011. The code word is corrupted during transmission, and 01001 is received (error
in the second bit from the right). First, the receiver finds that the received code word is not in
the table. This means an error has occurred. (Detection must come before correction.) The
receiver, assuming that there is only 1 bit corrupted, uses the following strategy to guess the
correct data word.
1. Comparing the received code word with the first code word in the table (01001 versus
00000), the receiver decides that the first code word is not the one that was sent because
there are two different bits.

2. By the same reasoning, the original code word cannot be the third or fourth one in the
table.

3. The original code word must be the second one in the table because this is the only one
that differs from the received code word by 1 bit. The receiver replaces 01001 with 01011
and consults the table to find the data word 01.

Hence block coding helps in error detection and re-transmission of the signal. It is normally
referred to as mB/nB coding as it replaces each m-bit data group with an n-bit data group
(where n>m). Thus, its adds extra bits (redundancy bits) which helps in synchronization at
receiver’s and sender’s end and also providing some kind of error detecting capability.

It normally involves three steps: division, substitution, and combination. In the division
step,a sequence of bits is divided into groups of m-bits. In the substitution step, we
substitute an m-bit group for an n-bit group. Finally, the n-bit groups are combined together
to form a stream which has more bits than the original bits.

10
Examples of mB/nB coding:
4B/5B (four binary/five binary ) –

This coding scheme is used in combination with NRZ-I. The problem with NRZ-I was that it has a
synchronization problem for long sequences of zeros. So, to overcome it we substitute the bit
stream from 4-bit to 5-bit data group before encoding it with NRZ-I.

So that it does not have a long stream of zeros. The block-coded stream does not have more
than three consecutive zeros (see encoding table).

At the receiver, the NRZ-I encoded digital signal is first decoded into a stream of bits and then
decoded again to remove the redundancy bits.

Drawback – Though 4B/5B encoding solves the problem of synchronization,it increases the
signal rate of NRZ-L.Moreover,it does not solve the DC component problem of NRZ-L.

11
8B/10B (eight binary/ten binary) –

This encoding is similar to 4B/5B encoding except that a group of 8 bits of data is now
substituted by a 10-bit code and it provides greater error detection capability than 4B/5B.
It is actually a combination of 5B/6B and 3B/4B encoding.

The most five significant bits of a 10-bit block is fed into the 5B/6B encoder; the least 3
significant bits is fed into a 3B/4B encoder. The split is done to simplify the mapping table.

A group of 8 bits can have 2^8 different combinations while a group of 10 bits can have 2^10
different combinations. This means that there are 2^10-2^8=768 redundant groups that are not
used for 8B/10B encoding and can be used for error detection and disparity check.

Thus, this technique is better than 4B/5B because of better error-checking capability and better
synchronization.

12

You might also like