39
DATA COMMUNICATIONS & NETWORKING LECTURE-09 Course Instructor : Sehrish Rafiq Department Of Computer Science University Of Peshawar

Lecture 09

Embed Size (px)

Citation preview

Page 1: Lecture 09

DATA COMMUNICATIONS & NETWORKING

LECTURE-09

Course Instructor : Sehrish Rafiq

Department Of Computer Science

University Of Peshawar

Page 2: Lecture 09

LECTURE OVERVIEW RZ Manchester and Differential Manchester Bipolar Block coding Steps in Block coding 4B/5B substitution Analog to digital conversion Sampling PAM PCM Nyquist Theorem

Page 3: Lecture 09

RZ OR RETURN TO ZERO RZ OR RETURN TO ZERO ENCODINGENCODING

Any time the original data contain strings of consecutive 1s or 0s, the receiver can lose its place.

A solution is to some how include synchronization in the encoded signal, something like the solution provided by NRZ-I but one capable of handling strings of 0’s as well as 1s.

Solution: To ensure synchronization , there must be a signal change

for each bit.

The receiver can use these changes to synchronize its clock.

NRZ-I accomplishes this for sequence of 1’s.

Page 4: Lecture 09

RZ CONTINUED…RZ CONTINUED…

But to change with every bit we need more than just two values.

RZ encoding uses three values: positive, negative and zero.

In RZ the signal changes not between bits but during each bit.

A 1 bit is actually represented by positive-to-zero and a 0 bit by negative-to-zero rather than by positive and negative alone.

The main disadvantage of RZ encoding is that it requires two signal changes to encode one bit and therefore occupies more bandwidth.

But it is more effective than NRZ-L and NRZ-I.

Page 5: Lecture 09

RZ ENCODINGRZ ENCODING

Page 6: Lecture 09

MANCHESTER ENCODINGMANCHESTER ENCODING

Manchester encoding uses an inversion at the middle of each bit interval for both synchronization and bit representation.

A negative to positive transition sent binary 1 and a positive to negative transition represents binary 0.

By using a single transition for a dual purpose, Manchester encoding achieves the same level of synchronization as RZ but with only two levels of amplitude.

Page 7: Lecture 09

MANCHESTER ENCODINGMANCHESTER ENCODING

Page 8: Lecture 09

DIFFERENTIAL MANCHESTER DIFFERENTIAL MANCHESTER ENCODINGENCODING

In differential Manchester encoding, the inversion at the middle of the bit interval is used for synchronization but the presence or absence of an additional transition at the beginning of the interval is used to identify the bit.

A transition means binary 0 and no transition means binary 1.

Differential Manchester encoding requires two signal changes to represent binary 0 but only one to represent binary 1.

Page 9: Lecture 09

DIFFERENTIAL MANCHESTER DIFFERENTIAL MANCHESTER ENCODINGENCODING

Page 10: Lecture 09

BIPOLAR ENCODINGBIPOLAR ENCODING

Bipolar like RZ uses three voltage levels: positive, negative and zero .

However the zero level in bipolar encoding is used to represent binary 0.

The 1’s are represented by alternating positive and negative voltages.

This alternation occurs even when the one bits are not consecutive.

Page 11: Lecture 09

AMI ENCODINGAMI ENCODING

A common bipolar encoding scheme is called bipolar alternate mark inversion (AMI).

AMI means alternate 1 inversion. A neutral zero voltage represents binary zero. Binary 1s are represented by alternating

positive and negative voltages.

Page 12: Lecture 09

BIPOLAR AMI ENCODINGBIPOLAR AMI ENCODING

Page 13: Lecture 09

2B1Q(TWO BINARY 1 2B1Q(TWO BINARY 1 QUATERNARY)QUATERNARY)

The 2B1Q uses four voltage levels. Each pulse can represent 2 bits, making each

pulse more efficient.

Page 14: Lecture 09

MLT-3MLT-3 Multiline transmission, three level (MLT-3) is very

similar to NRZ-I. But it uses three levels of signals (+1,0,-1). The signal transitions from one level to the next at the

beginning of a 1 bit, there is no transition at the beginning of a zero bit.

Page 15: Lecture 09

BLOCK CODINGBLOCK CODING

To improve the performance of line coding,block coding was introduced.

We need some kind of redundancy to ensure synchronization.

We need to include other redundandant bits to detect errors.

Block coding can achieve to some extent these two goals.

Page 16: Lecture 09

BLOCK CODINGBLOCK CODING

Page 17: Lecture 09

STEPS IN TRANSFORMATIONSTEPS IN TRANSFORMATION

Division Substitution Line coding

Page 18: Lecture 09

DIVISIONDIVISION

In this step the sequence of bits is divided in to groups of m bits.

E.g. in 4B/5B encoding, the orignal bit sequence is divided in to 4-bit groups.

Page 19: Lecture 09

SUBSTITUTIONSUBSTITUTION

In this step we substitute m-bit code for an n-bit group.

To achieve synchronization we can use the m-bit codes in such a way that for example we don’t have more than 3 consecutive 0’s and 1’s,

Block coding can definitely help in error detection.

Because only a subset of the 5-bit codes is used, If one or more of the bits in the block is changed

in such a way that one of the unused codes is received, the receiver can easily detect the error.

Page 20: Lecture 09

4B/5B4B/5B

Page 21: Lecture 09

4B/5B4B/5B

Data Code Data Code

0000 1111011110 1000 1001010010

0001 0100101001 1001 1001110011

0010 1010010100 1010 10110101100011 1010110101 1011 10111101110100 0101001010 1100 11010110100101 0101101011 1101 11011110110110 0111001110 1110 11100111000111 0111101111 1111 1110111101

Page 22: Lecture 09

4B/5B4B/5B

Data Code

Q (Quiet) 0000000000

I (Idle) 1111111111

H (Halt) 0010000100

J (start delimiter) 1100011000

K (start delimiter) 1000110001

T (end delimiter) 0110101101

S (Set) 1100111001R (Reset) 0011100111

Page 23: Lecture 09

LINE CODINGLINE CODING

In Line coding the block codes are transformed in to the digital signals using one of the Line coding techniques.

Page 24: Lecture 09

SAMPLINGSAMPLING

The process through which an Analog signal is changed to digital signal is called sampling.

The idea of digitizing the analog signals started with telephone companies.

Digital signals are less prone to noise and distortion.

A small change in an analog signal can change the received voice substantially but it takes a considerable change to convert a 0 to 1 or a 1 to 0.

PAM PCM

Page 25: Lecture 09

PULSE AMPLITUDE PULSE AMPLITUDE MODULATION(PAM)MODULATION(PAM)

The analog–to-digital conversion method is called pulse amplitude modulation.

This technique takes an analog signal , samples it and generates a series of pulses based on the results of the sampling.

Sampling: Sampling: The term sampling means measuring the amplitude of the signal at equal intervals.

PAM uses a technique called sample and hold.

At a given moment the signal level is read and then held briefly.

Page 26: Lecture 09

PAMPAM

Page 27: Lecture 09

PAMPAM Pulse amplitude modulation has some applications,

but it is not used by itself in data communication. However, it is the first step in another very popular

conversion method called pulse code modulation. The sampled value occurs only instantaneously in

the actual waveform but it is generalized over a still but measurable period in the PAM result.

PAM is not useful to data communications because the pulses measured by PAM are still of any amplitude(still an analog signal not digital).

To make them digital, we must modify them by using pulse code modulation.

Page 28: Lecture 09

PCMPCM

PCM modifies the pulses created by PAM to create a completely digital signal.

PCM first quantizes the PAM pulses.

Quantization is a method of assigning integral values in a specific range to sampled instances.

Page 29: Lecture 09

QUANTIZED PAM SIGNALQUANTIZED PAM SIGNAL

Page 30: Lecture 09

PCMPCM

Then a sign and magnitude is assigned to quantized samples.

Each value is translated in to its 7-bit binary equivalent.

The eighth bit creates the sign.

Page 31: Lecture 09

PCM CONTINUED…PCM CONTINUED…

The binary digits are then transformed to a digital signal by using one of the line coding techniques.

Page 32: Lecture 09

FROM ANALOG SIGNAL TO PCM FROM ANALOG SIGNAL TO PCM DIGITAL CODEDIGITAL CODE

Page 33: Lecture 09

WHAT SHOULD BE THE SAMPLING WHAT SHOULD BE THE SAMPLING RATE???RATE???

The accuracy of any digital reproduction of an analog signal depends on the number of samples taken.

Using PAM and PCM we can reproduce the waveform exactly by taking infinite samples or we can reproduce the barest generalization of its direction change by taking three samples.

How many samples are sufficient? Answer : Nyquist theorem

Page 34: Lecture 09

NYQUIST THEOREMNYQUIST THEOREM

According to Nyquist theorem the sampling rate must be at least twice the highest frequency of the signal.

Page 35: Lecture 09

Example 1Example 1

What sampling rate is needed for a signal with a bandwidth of 10,000 Hz (1000 to 11,000 Hz)?

SolutionSolution

The sampling rate must be twice the highest frequency in the signal:

Sampling rate = 2 x (11,000) = 22,000 Sampling rate = 2 x (11,000) = 22,000 samples/ssamples/s

Page 36: Lecture 09

NYQUIST THEOREMNYQUIST THEOREM

Page 37: Lecture 09

HOW MANY BITS PER SAMPLE???HOW MANY BITS PER SAMPLE???

This depends on the level of precision needed.

The number of bits is chosen such that the original signal can be reproduced with the desired precision in amplitude.

Page 38: Lecture 09

Example 2Example 2

A signal is sampled. Each sample requires at least 12 levels of precision (+0 to +5 and -0 to -5). How many bits should be sent for each sample?

SolutionSolution

We need 4 bits; 1 bit for the sign and 3 bits for the value. A 3-bit value can represent 23 = 8 levels (000 to 111), which is more than what we need. A 2-bit value is not enough since 22 = 4. A 4-bit value is too much because 24 = 16.

Page 39: Lecture 09

Have a nice day!!!Have a nice day!!!