ecom 4314 data communications fall september, 2010

72
ECOM 4314 Data Communications Fall September, 2010

Upload: avery

Post on 06-Jan-2016

41 views

Category:

Documents


2 download

DESCRIPTION

ECOM 4314 Data Communications Fall September, 2010. Lecture #4 Outline. DIGITAL-TO-DIGITAL CONVERSION Line Coding Line Coding Schemes Block Coding Scrambling. DIGITAL-TO-DIGITAL CONVERSION. A computer network is designed to send information from one point to another. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ECOM 4314 Data Communications Fall September, 2010

ECOM 4314

Data CommunicationsFall September, 2010

Page 2: ECOM 4314 Data Communications Fall September, 2010

Data Communication 2

Lecture #4 OutlineLecture #4 Outline

DIGITAL-TO-DIGITAL CONVERSION Line Coding Line Coding Schemes Block Coding Scrambling

Page 3: ECOM 4314 Data Communications Fall September, 2010

Data Communication 3

DIGITAL-TO-DIGITAL CONVERSIONDIGITAL-TO-DIGITAL CONVERSION

A computer network is designed to send information from one point to another.

This information needs to be converted to either a digital signal or an analog signal for transmission.

First we discuss conversion to digital signals;

next we conversion to analog signals.

Page 4: ECOM 4314 Data Communications Fall September, 2010

Data Communication 4

Line CodingLine Coding

Converting a string of 1’s and 0’s (digital data) into a sequence of signals that denote the 1’s and 0’s.

For example a high voltage level (+V) could represent a “1” and a low voltage level (0 or -V) could represent a “0”.

Page 5: ECOM 4314 Data Communications Fall September, 2010

Data Communication 5

Line CodingLine Coding

Page 6: ECOM 4314 Data Communications Fall September, 2010

Data Communication 6

CharacteristicsCharacteristics

Signal Element Versus Data Element A data element is the smallest entity that can

represent a piece of information(1,0). a signal element carries data elements

(1 -> +V, 0 -> -V)

r is the ratio of data element carried by each signal element

Page 7: ECOM 4314 Data Communications Fall September, 2010

Data Communication 7

CharacteristicsCharacteristics

Page 8: ECOM 4314 Data Communications Fall September, 2010

Data Communication 8

Data Rate vs. Signal RateData Rate vs. Signal Rate

Data rate is the number of bits per second

Signal rate is the number of signal sent in 1 second. Pulse rate, modulation rate, baud

where N is data rate

c is the case factor (worst, best & avg.)

r is the ratio between data element & signal element

Page 9: ECOM 4314 Data Communications Fall September, 2010

Data Communication 9

ExampleExample

A signal is carrying data in which one data element is encoded as one signal element ( r = 1). If the bit rate is 100 kbps, what is the average value of the baud rate if c is between 0 and 1?

SolutionWe assume that the average value of c is 1/2 . The baud rate is then

Page 10: ECOM 4314 Data Communications Fall September, 2010

Data Communication 10

BandwidthBandwidth

Although the actual bandwidth of a digital signal is infinite, the effective bandwidth is finite.

The mini. Bandwidth can be given as

The max. data rate is

Page 11: ECOM 4314 Data Communications Fall September, 2010

Data Communication 11

BandwidthBandwidth

The maximum data rate of a channel (see Chapter 3) is Nmax = 2 × B × log2 L (defined by the Nyquist formula). Does this agree with the previous formula for Nmax?

SolutionA signal with L levels actually can carry log2L bits per level. If each level corresponds to one signal element and we assume the average case (c = 1/2), then we have

Page 12: ECOM 4314 Data Communications Fall September, 2010

Data Communication 12

Baseline wanderingBaseline wandering

• A receiver will evaluate the average power of the received signal (called the baseline) and use that to determine the value of the incoming data elements.

• If the incoming signal does not vary over a long period of time, the baseline will drift and thus cause errors in detection of incoming data elements.

• A good line encoding scheme will prevent long runs of fixed amplitude.

Page 13: ECOM 4314 Data Communications Fall September, 2010

Data Communication 13

DC ComponentsDC Components

Voltage level is constant Problems

System that cannot pass low frequencies Long-distance link may use transformers to

isolate different parts of the line electrically

This will require the removal of the dc component of a transmitted signal.

Page 14: ECOM 4314 Data Communications Fall September, 2010

Data Communication 14

Self-SynchronizationSelf-Synchronization

The clocks at the sender and the receiver must have the same bit interval.

If the receiver clock is faster or slower it will misinterpret the incoming bit stream.

Page 15: ECOM 4314 Data Communications Fall September, 2010

Data Communication 15

Self-SynchronizationSelf-Synchronization

Page 16: ECOM 4314 Data Communications Fall September, 2010

Data Communication 16

Other characteristicsOther characteristics

Built-in error detection Immunity to noise and interference Complexity

Page 17: ECOM 4314 Data Communications Fall September, 2010

Data Communication 17

Line coding schemesLine coding schemes

Page 18: ECOM 4314 Data Communications Fall September, 2010

Data Communication 18

UnipolarUnipolar

All signal levels are on one side of the time axis - either above or below

NRZ - Non Return to Zero scheme is an example of this code. The signal level does not return to zero during a symbol transmission.

Scheme is prone to baseline wandering and DC components.

Uses two signal levels: 0 and +V (typically 5 volts)

Long streams 0f 1s and 0s causes synchronization problem

Page 19: ECOM 4314 Data Communications Fall September, 2010

Data Communication 19

Unipolar NRZ schemeUnipolar NRZ scheme

Figure 4.5 Unipolar NRZ scheme

Page 20: ECOM 4314 Data Communications Fall September, 2010

Data Communication 20

Polar - Non Return to Zero (NRZ)Polar - Non Return to Zero (NRZ)

The voltages are on both sides of the time axis.

Polar NRZ scheme can be implemented with two voltages. E.g. +V for 1 and -V for 0.

There are two versions: NZR - Level (NRZ-L) - positive voltage for one

symbol and negative for the other NRZ - Inversion (NRZ-I) - the change or lack of

change in polarity determines the value of a symbol. E.g. a “1” symbol inverts the polarity a “0” does not.

Page 21: ECOM 4314 Data Communications Fall September, 2010

Data Communication 21

Polar - Non Return to Zero (NRZ)Polar - Non Return to Zero (NRZ)

Polar NRZ-L and NRZ-I schemes

Page 22: ECOM 4314 Data Communications Fall September, 2010

Data Communication 22

Polar – Non Return to Zero (NRZ)Polar – Non Return to Zero (NRZ)

Advantages Easy to engineer. Make good use of bandwidth.

Disadvantages DC component. Lack of synchronization capability.

The power is very high around frequencies close to 0

DC component carry high level of energy

Page 23: ECOM 4314 Data Communications Fall September, 2010

Data Communication 23

Polar - NRZPolar - NRZ

Unsuitable for transmission over channel with poor performance around this frequency

Not often used for signal transmission applications.

NRZ-L and NRZ-I both have an average signal rate of N/2 Bd.

Page 24: ECOM 4314 Data Communications Fall September, 2010

Data Communication 24

Polar - Return to Zero (RZ)Polar - Return to Zero (RZ)

The Return to Zero (RZ) scheme uses three voltage values. +, 0, -.

Each symbol has a transition in the middle. Either from high to zero or from low to zero.

This scheme has more signal transitions (two per symbol) and therefore requires a wider bandwidth.

No DC components or baseline wandering. Self synchronization - transition indicates symbol

value. More complex as it uses three voltage level. It has no error detection capability.

Page 25: ECOM 4314 Data Communications Fall September, 2010

Data Communication 25

Polar – Return to Zero (RZ)Polar – Return to Zero (RZ)

Polar RZ scheme

Page 26: ECOM 4314 Data Communications Fall September, 2010

Data Communication 26

Biphase: Manchester and Differential Biphase: Manchester and Differential ManchesterManchester

Manchester coding consists of combining the NRZ-L and RZ schemes. Every symbol has a level transition in the

middle: from high to low or low to high. Uses only two voltage levels.

Differential Manchester coding consists of combining the NRZ-I and RZ schemes. Every symbol has a level transition in the

middle. But the level at the beginning of the symbol is determined by the symbol value. One symbol causes a level change the other does not.

Page 27: ECOM 4314 Data Communications Fall September, 2010

Data Communication 27

Manchester and Differential Manchester and Differential ManchesterManchester

Figure 4.8 Polar biphase: Manchester and differential Manchester schemes

Page 28: ECOM 4314 Data Communications Fall September, 2010

Data Communication 28

Manchester and Differential Manchester and Differential ManchesterManchester

Advantages: Synchronization on mid bit transition (self clocking). No DC component. Error detection:

Absence of expected transition. Noise would have to invert both before and after expected

transition.

Disadvantages: At least one transition per bit time and possibly

two. Maximum modulation rate is twice NRZ. Requires more bandwidth (2 times that of NRZ.)

Page 29: ECOM 4314 Data Communications Fall September, 2010

Data Communication 29

Multilevel Binary -BipolarMultilevel Binary -Bipolar

Code uses 3 voltage levels: - +, 0, -, to represent the symbols (note not transitions to zero as in RZ).

Voltage level for one symbol is at “0” and the other alternates between + & -.

Bipolar Alternate Mark Inversion (AMI) - the “0” symbol is represented by zero voltage and the “1” symbol alternates between +V and -V.

Pseudoternary is the reverse of AMI

Page 30: ECOM 4314 Data Communications Fall September, 2010

Data Communication 30

Multilevel Binary -BipolarMultilevel Binary -Bipolar

Bipolar schemes: AMI and pseudoternary

Page 31: ECOM 4314 Data Communications Fall September, 2010

Data Communication 31

Multilevel Binary -BipolarMultilevel Binary -Bipolar

It is a better alternative to NRZ. Has no DC component or baseline

wandering… Why?? Has no self synchronization because long

runs of “0”s results in no signal transitions. No error detection.

Page 32: ECOM 4314 Data Communications Fall September, 2010

Data Communication 32

Multilevel SchemeMultilevel Scheme

We want to increase data rate and decrease the required band width.

Increasing the number of bits per baud. m data elements can produce a

combination of 2mdata pattern. If we have L different levels

Each data pattern is encoded into one signal pattern if 2m= Ln

Data pattern occupies only a subset of signal pattern if 2m< Ln

Data encoding is not possible if 2m> Ln

Page 33: ECOM 4314 Data Communications Fall September, 2010

Data Communication 33

Multilevel SchemeMultilevel Scheme

In mBnLs chemes, a pattern of m data elements is encoded as a pattern of n signal elements in which 2m≤Ln.

B (binary) for L= 2 T (ternary) for L=3 Q (quaternary) for L= 4 ,

Page 34: ECOM 4314 Data Communications Fall September, 2010

Data Communication 34

Multilevel SchemeMultilevel Scheme

Multilevel: 2B1Q scheme

Page 35: ECOM 4314 Data Communications Fall September, 2010

Data Communication 35

Block CodingBlock Coding

For a code to be capable of error detection, we need to add redundancy, i.e., extra bits to the data bits.

Synchronization also requires redundancy - transitions are important in the signal flow and must occur frequently.

Block coding is done in three steps: division, substitution and combination.

The resulting bit stream prevents certain bit combinations that when used with line encoding would result in DC components or poor sync. Quality.

Page 36: ECOM 4314 Data Communications Fall September, 2010

Data Communication 36

Block CodingBlock Coding

Block coding is normally referred to as mB/nB coding; it replaces each m-bit group with an n-bit group.

Page 37: ECOM 4314 Data Communications Fall September, 2010

Data Communication 37

Block CodingBlock Coding

Page 38: ECOM 4314 Data Communications Fall September, 2010

Data Communication 38

Block CodingBlock Coding

Using block coding 4B/5B with NRZ-I line coding scheme

Page 39: ECOM 4314 Data Communications Fall September, 2010

Data Communication 39

Block CodingBlock Coding

Page 40: ECOM 4314 Data Communications Fall September, 2010

Data Communication 40

Block CodingBlock Coding

Substitution in 4B/5B block coding

Page 41: ECOM 4314 Data Communications Fall September, 2010

Data Communication 41

Block CodingBlock Coding

Redundancy A 4 bit data word can have 24

combinations. A 5 bit word can have 25=32

combinations. We therefore have 32 - 16 = 16 extra

words. Some of the extra words are used for

control/signaling purposes.

Page 42: ECOM 4314 Data Communications Fall September, 2010

Data Communication 42

Block CodingBlock Coding

8B/10B block encoding

Page 43: ECOM 4314 Data Communications Fall September, 2010

Data Communication 43

ScramblingScrambling

The best code is one that does not increase the bandwidth for synchronization and has no DC components.

Scrambling is a technique used to create a sequence of bits that has the required c/c’s for transmission - self clocking, no low frequencies, no wide bandwidth.

It replaces ‘unfriendly’ runs of bits with a violation code that is easy to recognize and removes the unfriendly c/c.

Page 44: ECOM 4314 Data Communications Fall September, 2010

Data Communication 44

ScramblingScrambling

For example: B8ZS substitutes eight consecutive zeros with 000VB0VB.

The V stands for violation, it violates the line encoding rule

B stands for bipolar, it implements the bipolar line encoding rule

Page 45: ECOM 4314 Data Communications Fall September, 2010

Data Communication 45

ScramblingScrambling

Page 46: ECOM 4314 Data Communications Fall September, 2010

Data Communication 46

ScramblingScrambling

HDB3 substitutes four consecutive zeros with 000V or B00V depending

on the number of nonzero pulses after the last substitution. If # of non zero pulses is even the

substitution is B00V to make total # of non zero pulse even.

If # of non zero pulses is odd the substitution is 000V to make total # of non zero pulses even.

Page 47: ECOM 4314 Data Communications Fall September, 2010

Data Communication 47

ScramblingScrambling

Different situations in HDB3 scrambling technique

Page 48: ECOM 4314 Data Communications Fall September, 2010

Data Communication 48

ANALOG-TO-DIGITAL CONVERSIONANALOG-TO-DIGITAL CONVERSION

A digital signal is superior to an analog signal because it is more robust to noise and can easily be recovered.

For this reason, the tendency today is to change an analog signal to digital data.

Pulse Code Modulation (PCM) Delta Modulation (DM)

Page 49: ECOM 4314 Data Communications Fall September, 2010

Data Communication 49

Pulse Code Modulation (PCM)Pulse Code Modulation (PCM)

• PCM consists of three steps to digitize an analog signal: Sampling Quantization Binary encoding

Before we sample, we have to filter the signal to limit the maximum frequency of the signal as it affects the sampling rate.

Filtering should ensure that we do not distort the signal, ie remove high frequency components that affect the signal shape.

Page 50: ECOM 4314 Data Communications Fall September, 2010

Data Communication 50

Pulse Code Modulation (PCM)Pulse Code Modulation (PCM)

Components of PCM encoder

Page 51: ECOM 4314 Data Communications Fall September, 2010

Data Communication 51

SamplingSampling

Analog signal is sampled every TS secs. Ts is referred to as the sampling interval. fs = 1/Ts is called the sampling rate or sampling

frequency. There are 3 sampling methods:

Ideal - an impulse at each sampling instant Natural - a pulse of short width with varying amplitude Flattop - sample and hold, like natural but with single

amplitude value The process is referred to as pulse amplitude

modulation PAM and the outcome is a signal with analog (non integer) values

Page 52: ECOM 4314 Data Communications Fall September, 2010

Data Communication 52

SamplingSampling

Three different sampling methods for PCM

Page 53: ECOM 4314 Data Communications Fall September, 2010

Data Communication 53

SamplingSampling

According to the Nyquist theorem, the sampling rate must be at least 2 times the highest frequency contained in the signal.

Page 54: ECOM 4314 Data Communications Fall September, 2010

Data Communication 54

SamplingSampling

Recovery of a sampled sine wave for different sampling rates

Page 55: ECOM 4314 Data Communications Fall September, 2010

Data Communication 55

QuantizationQuantization

• Sampling results in a series of pulses of varying amplitude values ranging between two limits: a min and a max.

• The amplitude values are infinite between the two limits.

• We need to map the infinite amplitude values onto a finite set of known values.

• This is achieved by dividing the distance between min and max into L zones, each of height

= (max - min)/L

Page 56: ECOM 4314 Data Communications Fall September, 2010

Data Communication 56

Quantization LevelsQuantization Levels

The midpoint of each zone is assigned a value from 0 to L-1 (resulting in L values)

Each sample falling in a zone is then approximated to the value of the midpoint.

Page 57: ECOM 4314 Data Communications Fall September, 2010

Data Communication 57

• Assume we have a voltage signal with amplitutes Vmin=-20V and Vmax=+20V.

• We want to use L=8 quantization levels.• Zone width = (20 - -20)/8 = 5• The 8 zones are: -20 to -15, -15 to -10, -10

to -5, -5 to 0, 0 to +5, +5 to +10, +10 to +15, +15 to +20

• The midpoints are: -17.5, -12.5, -7.5, -2.5, 2.5, 7.5, 12.5, 17.5

Page 58: ECOM 4314 Data Communications Fall September, 2010

Data Communication 58

• Each zone is then assigned a binary code.• The number of bits required to encode the

zones, or the number of bits per sample as it is commonly referred to, is obtained as follows:

nb = log2 L• Given our example, nb = 3• The 8 zone (or level) codes are therefore:

000, 001, 010, 011, 100, 101, 110, and 111• Assigning codes to zones:

– 000 will refer to zone -20 to -15– 001 to zone -15 to -10, etc.

Page 59: ECOM 4314 Data Communications Fall September, 2010

Data Communication 59

Figure 4.26 Quantization and encoding of a sampled signal

Page 60: ECOM 4314 Data Communications Fall September, 2010

Data Communication 60

Quantization ErrorQuantization Error

• When a signal is quantized, we introduce an error - the coded signal is an approximation of the actual amplitude value.

• The difference between actual and coded value (midpoint) is referred to as the quantization error.

• The more zones, the smaller which results in smaller errors.

• BUT, the more zones the more bits required to encode the samples -> higher bit rate

Page 61: ECOM 4314 Data Communications Fall September, 2010

Data Communication 61

Delta ModulationDelta Modulation

• This scheme sends only the difference between pulses, if the pulse at time tn+1 is higher in amplitude value than the pulse at time tn, then a single bit, say a “1”, is used to indicate the positive value.

• If the pulse is lower in value, resulting in a negative value, a “0” is used.

• This scheme works well for small changes in signal values between samples.

• If changes in amplitude are large, this will result in large errors.

Page 62: ECOM 4314 Data Communications Fall September, 2010

Data Communication 62

Delta ModulationDelta Modulation

The process of delta modulation

Page 63: ECOM 4314 Data Communications Fall September, 2010

Data Communication 63

TRANSMISSION MODESTRANSMISSION MODES

Data transmission and modes

Page 64: ECOM 4314 Data Communications Fall September, 2010

Data Communication 64

TRANSMISSION MODESTRANSMISSION MODES

Parallel transmission

Page 65: ECOM 4314 Data Communications Fall September, 2010

Data Communication 65

TRANSMISSION MODESTRANSMISSION MODES

Figure 4.33 Serial transmission

Page 66: ECOM 4314 Data Communications Fall September, 2010

Data Communication 66

Serial TransmissionSerial Transmission

• Received messages are a string of bits which need to be interpreted correctly by determining the:– Start of each bit signaling element– Start of each character– Start and end of each message

• These three tasks are known as bit or clock synchronization, character or byte synchronization, and block or frame synchronization.

• These can be performed by two ways depending on whether the transmitter and receiver clocks are synchronized or independent (asynchronous)

Page 67: ECOM 4314 Data Communications Fall September, 2010

Data Communication 67

Synchronous TransmissionSynchronous Transmission

• There is no delay or gap between each 8 bit element

• Each frame of characters is transmitted as a contiguous bit strings and the receiver must stay synchronized for the entire frame

• The clock (timing) information must be embedded into the signal for it to be extracted by the receiver by using self-clocking codes

• By synchronization performed by placing special characters at the start of each frame

Page 68: ECOM 4314 Data Communications Fall September, 2010

Data Communication 68

Synchronous TransmissionSynchronous Transmission

Synchronous transmission

Page 69: ECOM 4314 Data Communications Fall September, 2010

Data Communication 69

Asynchronous TransmissionAsynchronous Transmission

• Each character (7 or 8 bits) is sent independently

• Mainly used with data transmitted at irregular intervals (eg. Keyboard) such that the line will be idle for long period

• Each character is encapsulated between an additional start bit and one or more stop bits, which have different polarity

• The additional start and stop bits required for transmission mean that the useful data rate is less than transmission time

Page 70: ECOM 4314 Data Communications Fall September, 2010

Data Communication 70

Asynchronous TransmissionAsynchronous Transmission

Asynchronous transmission

Page 71: ECOM 4314 Data Communications Fall September, 2010

Data Communication 71

ReferencesReferences

Ayman, Maliha, “Data Communication Lectures”, IUG.

BehrouzA. Forouzan , “Data Communications and Networking”, 4rdEdition, Chapter4, 2007

Page 72: ECOM 4314 Data Communications Fall September, 2010

Data Communication 72

ThanksThanks