0% found this document useful (0 votes)
39 views

Wk3 - LineCoding - v2

The document discusses various digital line coding schemes used to convert digital data to digital signals for transmission. It covers unipolar, polar, and bipolar line coding schemes such as NRZ-L, NRZ-I, Manchester, and AMI. For each scheme, it describes the encoding method, pros and cons in terms of synchronization, DC component suppression, error detection capabilities and more. The goal of line coding is to increase data rates while decreasing bandwidth requirements for digital communication.

Uploaded by

Taqris Bahari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Wk3 - LineCoding - v2

The document discusses various digital line coding schemes used to convert digital data to digital signals for transmission. It covers unipolar, polar, and bipolar line coding schemes such as NRZ-L, NRZ-I, Manchester, and AMI. For each scheme, it describes the encoding method, pros and cons in terms of synchronization, DC component suppression, error detection capabilities and more. The goal of line coding is to increase data rates while decreasing bandwidth requirements for digital communication.

Uploaded by

Taqris Bahari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

KKKT4133

Data Communication and


Computer Networks
Dr. Nor Fadzilah Abdullah
Dr. Mohd Fais Mansor
Teaching plan
Week Topic
1 Introduction to Data Communications & TCP/IP and OSI
model
2 Introduction to PHY Layer
3 Line coding (digital-to-digital conversion)
4 Bandpass modulation (digital-to-analog conversion)
5 Circuit switching
6 Packet switching
7 Introduction to Data Link Layer
8 Study week / Project title selection
Mid-Semester Break
9 Mid-semester Exam
10 Error Detection & Correction (Channel coding)
11 Media Access Control (MAC)
12 Wired LANs: Ethernet
13 Wireless LANs
14 Project Presentation
15-17 Final Exam
Digital-to-digital conversion

 Line coding
 Block coding
 Scrambling
Line Coding
 process of converting digital data to digital signal
 Example of digital data: text, numbers, graphical images, audio, or
video, stored in computer memory as sequences of bits
 Line coding converts a sequence of bits to a digital signal.
 At the sender, digital data are encoded into a digital signal
 At the receiver, the digital data are recreated by decoding the
digital signal
Signal elements vs. data elements

𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅 𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆
𝒓𝒓 =
𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔 𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆
Data Rate vs. Signal Rate
 Data rate (N): number of data elements (bits) sent in 1s.
Unit: bps
 Common terminologies: bit rate
 Signal rate (S): number of signal elements sent in 1s. Unit:
baud.
 Common terminologies: pulse rate, modulation rate or the baud rate.
 Goal in data communications:
 increase data rate: increases the speed of transmission
 decrease signal rate: decreases the bandwidth requirement
 Control by r (data/signal element ratio) or c (case factor) i.e. the
varying data pattern
Example: Data Rate vs. Signal Rate

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?
Solution
We assume that the average value of c is 1/2. The baud rate
is then
Effective bandwidth

 Baud (signal) rate, not the bit rate, determines the


required bandwidth for a digital signal.
 the actual bandwidth of a digital signal is infinite, the effective
bandwidth is finite

Min. BW (Hz):

Max. data rate (bps):


Example: Effective bandwidth

How does the effective bandwidth Nmax relates to the


maximum data rate of a channel i.e. the Nyquist formula?

Solution
A signal with L levels actually can carry log2 L bits per
level. If each level corresponds to one signal element and we
assume the average case (c = 1/2), then we have
Desirable line coding capabilities:
 Prevention of Baseline Wandering:
 Baseline: receiver calculates a running average received signal power
when decoding a digital signal. The incoming signal power is evaluated
against this baseline to determine the value of the data element.
 Baseline wandering: A long string of 0s or 1s that causes a drift in the
baseline and make it difficult for the receiver to decode correctly
 Suppression of DC Components:
 DC (direct-current) components: when the voltage level in a digital
signal is constant for a while, the spectrum creates very low around 0
frequencies (results of Fourier analysis).
 present problems for a system that cannot pass low frequencies or a
system that uses electrical coupling (via a transformer) especially for
long distance link.
 With no dc component, ac coupling via transformer is possible; this
provides excellent electrical isolation, reducing interference.
Desirable line coding capabilities:
 Self-synchronization:
 To correctly interpret the signals received from the sender, the receiver’s bit
intervals must correspond exactly to the sender’s bit intervals. If the receiver
clock is faster or slower, the bit intervals are not matched and the receiver
might misinterpret the signals.
 Self-synchronizing digital signal includes timing information in the data
being transmitted. This can be achieved if there are transitions in the signal
that alert the receiver to the beginning, middle, or end of the pulse. If the
receiver’s clock is out of synchronization, these points can reset the clock.
 Built-in Error Detection
 desirable capability in the generated code to detect some or all of the
errors that occurred during transmission
 Immunity to Noise and Interference
 Cost vs. complexity
 A complex scheme is more costly to implement. E.g. a scheme that uses 4
signal levels is more difficult to interpret than one that uses only 2 levels.
Encoding Schemes
• A good signal design should concentrate
Signal spectrum the transmitted power in the middle of the
transmission bandwidth

• Need to synchronize transmitter and


Clocking receiver either with an external clock or
sync mechanism in transmitted signal

• Responsibility of data link control (layer 2),


Error detection but if built-in into PHY signaling encoding
scheme, error can be detected faster.

Signal interference
• Certain codes perform better (BER) in the
and noise presence of noise
immunity

Cost and • The higher the signaling rate the greater the
complexity cost
Types of Line Coding Schemes

NRZ-L/I
Unipolar: Non-return to Zero (NRZ)
 Easiest way to transmit digital signals is to use two different voltages
for 0 and 1 bits
 Voltage level is constant during a bit interval
 No transition (no return to a zero voltage level at the middle of the bit)
 Absence of voltage = 0, constant positive voltage = 1
 Costly: normalized power (the power needed to send 1 bit per unit line
resistance) is double polar NRZ  not used in data comm today
Polar: NRZ-L and NRZ-I
 NRZ-L: A negative voltage represents one binary value and a positive
voltage represents the other
 NRZ-I: Non-return to zero, invert on ones
 Maintains a constant voltage pulse for duration of a bit time
 Data are encoded as presence or absence of signal transition at the
beginning of the bit time
 Transition (low to high, high to low) denotes binary 1
 No transition denotes binary 0
 An example of differential encoding
 Data are represented by changes rather than levels
 More reliable to detect a transition in the presence of noise than to compare a
value to a threshold
 Overcome lose sense of polarity e.g. multidrop the twisted pair are accidentally
inverted
Polar schemes: NRZ-L and NRZ-I
 NRZ-L and NRZ-I both have an average signal rate of N/2 Bd.
 Baseline wandering is a problem for both variations, but twice severe in NRZ-L
vs. NRZ-I. If there is a long sequence of 0s or 1s in NRZ-L, the average signal
power becomes skewed. The receiver might have difficulty discerning the bit
value. In NRZ-I this problem occurs only for a long sequence of 0s. Similar trend
for synchronization problem.
 NRZ-L and NRZ-I both have a DC component problem: power spectral density
is very high around frequencies 0 and N/2 i.e. DC components carry a high
level of energy.
Example: NRZ-I

A system is using NRZ-I to transfer 10-Mbps data. What are


the average signal rate and minimum bandwidth?

Solution
The average signal rate is 𝑆𝑆𝑎𝑎𝑎𝑎𝑎𝑎 = N/2 = 500 kbaud. The
minimum bandwidth for this average baud rate is
Bmin = 𝑆𝑆𝑎𝑎𝑎𝑎𝑎𝑎 = 500 kHz.
Polar schemes: RZ
 Main problem with NRZ: sender and receiver clocks are not synchronized.
The receiver does not know when one bit has ended and the next bit is
starting.
 Return-to-zero (RZ) scheme uses three values: positive, negative, and zero,
change in the middle of the bit
 Pros: solve synchronization & DC component problem
 Cons: requires two signal changes to encode a bit i.e. occupies greater
bandwidth, higher complexity with 3 levels of voltage  no longer used today
Polar biphase
 Improves RZ, only 2 voltage levels, transition at the middle of the bit
is used for synchronization
 Manchester = RZ + NRZ-L
 Differential Manchester = RZ + NRZ-I
Manchester Encoding

 There is a transition at the middle


of each bit period
 Midbit transition serves as a
clocking mechanism and also as
data
 Low to high transition = 1
 High to low transition = 0
 Used in IEEE 802.3 (Ethernet)
standard for baseband coaxial
cable and twisted-pair bus LANs
Differential Manchester Encoding

 Midbit transition is only used for clocking


 The encoding of a 0 is represented by the presence
of a transition at the beginning of a bit period
 A 1 is represented by the absence of a transition at
the beginning of a bit period
 Has the added advantage of employing differential
encoding
 Used in specified for the IEEE 802.5 token ring LAN,
using shielded twisted pair.
Biphase Pros and Cons
Bipolar schemes: AMI and pseudoternary
 sometimes called multilevel binary (more than 2 signal levels)
 3 levels: positive, zero, and negative (voltage level for one data element is
at zero, while the voltage level for the other element alternates between
positive and negative)
Bipolar: AMI & Pseudoternary

 AMI: alternate mark (1) inversion


 Binary 0 represented by no line signal
 Binary 1 represented by positive or negative pulse
 Binary 1 pulses alternate in polarity
 Pseudoternary
 Binary 1 represented by absence of line signal
 Binary 0 represented by alternating positive and negative pulses
 No advantage or disadvantage of pseudoternary over AMI
and each is the basis of some applications
 No loss of sync if a long string of 1s occurs
 No DC component: energy concentration at around
frequency N/2
 Lower bandwidth than polar/biphase schemes: has the same
signal rate (BW) as NRZ
 Easy error detection
Multilevel Binary (Bipolar) Issues
 Synchronization with long runs of 0’s or
1’s
 Can insert additional bits that force
transitions
 Scramble data
 Not as efficient as NRZ
 Each signal element only represents one bit
 Receiver distinguishes between three levels:
+A, -A, 0
 A 3 level system could represent log23 = 1.58
bits
 Requires approximately 3dB more signal
power for same probability of bit error
Multilevel Schemes
 Goal: to increase the data rate or decrease the required bandwidth
 Method: to increase the number of bits per baud by encoding a
pattern of m data elements into a pattern of n=𝟐𝟐𝒎𝒎 signal elements
 𝟐𝟐𝒎𝒎 = 𝑳𝑳𝒏𝒏 , each data pattern is encoded into one signal pattern
 𝟐𝟐𝒎𝒎 < 𝑳𝑳𝒏𝒏 , data patterns occupy only a subset of signal patterns. The subset
can be carefully designed to prevent baseline wandering, to provide
synchronization, and to detect errors that occurred during data
transmission.
 𝟐𝟐𝒎𝒎 > 𝑳𝑳𝒏𝒏 , not possible because some of the data patterns cannot be
encoded
 mBnL = m is the length of the binary pattern, B means binary data, n is
the length of the signal pattern and L is the number of levels in the
signalling.
 A letter is often used in place of L: B (binary) for L = 2, T (ternary) for L =
3, and Q (quaternary) for L = 4. Note that the first two letters define the
data pattern, and the second two define the signal pattern.
Multilevel: 2B1Q
 m = 2, n = 1, and L = 4 (quarternary), no redundant signal patterns
𝟐𝟐𝟐𝟐 = 𝟒𝟒𝟏𝟏
 Pros: 𝑆𝑆𝑎𝑎𝑎𝑎𝑎𝑎 = 𝑁𝑁/4 = send data 2 times faster than NRZ-L
 Cons: 4 different signal levels = receiver has to discern 4 different
thresholds
 used in DSL (Digital Subscriber Line): high-speed connection to the
Internet by using subscriber telephone lines
Multilevel: 8B6T
 28 = 256 different data patterns and 36 = 729 different signal
patterns
 729 − 256 = 473 redundant signal elements that provide
synchronization, error detection and DC balance
 To make the whole stream DC-balanced, the sender keeps track of the weight. If
2 groups of weight +1 are encountered one after another, the first one is sent as
is, while the next one is totally inverted to give a weight of −1.

 used with 100BASE-4T cable 1 1 6


𝑆𝑆𝑎𝑎𝑎𝑎𝑎𝑎 = 𝑐𝑐 × 𝑁𝑁 × = × 𝑁𝑁 ×
𝑟𝑟 2 8

Weight = 0 Weight = +1 Weight = -1


Multilevel: 4D-PAM5 scheme
 four-dimensional five level pulse amplitude modulation (4D-PAM5)= data
is sent over 4 wires (channels) at the same time using 5 voltage levels.
 level 0 is used only for forward error detection (FEC) + 4 levels create 8B4Q
(28 = 44 ) with worst signal rate of Nx4/8=N/2
 Used in Gigabit LAN (1000BASE-T) copper cables
Multi-transition MLT-3 scheme
 NRZ-I and differential Manchester are classified as differential
encoding but use 2 transition rules to encode binary data (no
inversion, inversion).
 Multiline transmission, three-level (MLT-3) = 3 levels (+V, 0, and −V)
and 3 transition rules to move between levels:
1. If the next bit is 0, there is no transition.
2. If the next bit is 1 and the current level is not 0, the next level is 0.
3. If the next bit is 1 and the current level is 0, the next level is the opposite
of the last nonzero level.
Example: MLT-3

 MLT-3 maps 1 bit data to 1 signal element: signal rate similar to NRZ-I, but
with greater complexity (3 levels and complex transition rules). However, it
helps to reduce the required bandwidth.
 E.g. worst-case scenario (sequence of 1s): signal element pattern +V 0 −V 0
is repeated every 4 bits. A non-periodic signal has changed to a periodic
signal with period of 4 times the bit duration. This worst-case situation can
be simulated as an analog signal with a frequency (signal rate) of N/4.
 suitable to send 100 Mbps on a copper wire that cannot support more than
32 MHz (frequencies above this level create electromagnetic emissions).
Types of Line Coding Schemes

NRZ-L/I

2B1Q, 8B6T
Summary of line coding schemes
Digital-to-digital conversion

 Line coding
 Block coding
 Scrambling
Block Coding
 Block coding offers redundancy to ensure synchronization and provide
inherent error detecting
 improve the performance of line coding
 Block coding is normally referred to as mB/nB coding; it replaces each m-
bit group with an n-bit group.
 i.e. changes a block of m bits into a block of n bits, where n > m
 3 steps: division, substitution, and combination
Block coding: 4B/5B with NRZ-I
 slash in block encoding (e.g. 4B/5B) distinguishes block encoding from
multilevel encoding (e.g. 8B6T)
 NRZ-I has a good signal rate, 1/2 of biphase, but has synchronization
problem (long sequence of 0s can make the receiver clock lose
synchronization)
 4B/5B change the bit stream, prior to encoding with NRZ-I, so that it does
not have a long stream of 0s
 no more than 1 leading 0 (left bit) and no more than 2 trailing 0s (right bits), does
not have more that 3 consecutive 0s (refer mapping table)
Block coding: 4B/5B mapping codes

Other sequence received =


detect error in the transmission
Block coding 4B/5B: substitution
 4B/5B encoding solves the problem of synchronization of NRZ-I but increases the
signal rate of NRZ-I (redundant bit = 20% more baud), still less than the biphase
scheme which has a signal rate of 2 times NRZ-I.
 However, 4B/5B block encoding does not solve the DC component problem of
NRZ-I. If a DC component is unacceptable, we need to use biphase or bipolar
encoding.
Example: Block coding 4B/5B

We need to send data at a 1-Mbps rate. What is the


minimum required bandwidth, using a combination of
4B/5B and NRZ-I or Manchester coding?

Solution
First 4B/5B block coding increases the bit rate to 1.25 Mbps. The
minimum bandwidth using NRZ-I is N/2 or 625 kHz. The
Manchester scheme needs a minimum bandwidth of 1.25 MHz.
The 4B/5B NRZ-I needs a lower bandwidth, but has a DC
component problem; the 4B/5B Manchester needs a higher
bandwidth, but does not have a DC component problem.
Block coding 8B/10B

 a group of 8 bits of data is substituted by a 10-bit code.


 provides greater error detection and synchronization capability than 4B/5B.
 has 210 − 28 = 768 redundant groups that can be used for disparity checking and
error detection
 The 8B/10B block coding is actually a combination of 5B/6B (MSB) and
3B/4B (LSB) encoding to simplify the mapping table
 disparity controller: to prevent a long run of consecutive 0s or 1s, keeps
track of excess 0s over 1s (or 1s over 0s).
Scrambling Design Goals

 scrambling, as opposed to block coding,


is done at the same time as encoding no DC
component
 Use scrambling rules to replace
sequences that would produce constant
voltage no long
sequences
 These filling sequences must: of zero
level line
 Provide sufficient transitions for the signals
receiver’s clock to maintain
synchronization
no
 Be recognized by the receiver and reduction
replaced with the original data in data
sequence rate

 Be the same length as the original


sequence so there is no data rate
Error
penalty detection
capability
 Two common scrambling
techniques: B8ZS and HDB3
AMI with scrambling
 Biphase schemes (Manchester) that are suitable for dedicated links
between stations in a LAN are not suitable for long-distance
communication because of their wide bandwidth requirement
 The combination of block coding and NRZ line coding is not suitable for
long-distance encoding, because of the DC component
 Bipolar AMI has a narrow bandwidth and does not create a DC
component. However, a long sequence of 0s upsets the synchronization
 Scrambling substitutes long zero-level pulses with a combination of other levels to
provide synchronization
Scrambling: B8ZS

 B8ZS = Bipolar with 8-zeros Substitution


 Coding scheme commonly used in North America
 Based on a bipolar-AMI but amended with the following rules:
 If an octet of all zeros occurs and the last voltage pulse preceding this
octet was positive, then the eight zeros of the octet are encoded as
000+-0-+
 If an octet of all zeros occurs and the last voltage pulse preceding this
octet was negative, then the eight zeros of the octet are encoded as
000-+0+-
 The receiver recognizes the pattern and interprets the octet as
consisting of all zeros.
Example: B8ZS scrambling technique
 B8ZS substitutes eight consecutive zeros with 000VB0VB.
 V = violation i.e. nonzero voltage that breaks an AMI rule of encoding
(opposite polarity from the previous)
 B = bipolar i.e. nonzero level voltage in accordance with the AMI rule
 scrambling does not change the bit rate and balances the positive and
negative voltage levels (two positives and two negatives), which means
that the DC balance is maintained. Note that the substitution may change
the polarity of a 1 because, after the substitution, AMI needs to follow its
rules
Scrambling: HDB3
 HDB3 = high-density bipolar-3 zeros: substitutes four consecutive zeros with 000V
or B00V depending on the number of nonzero pulses after the last substitution.
 to maintain the even number of nonzero pulses after each substitution
1. If the number of nonzero pulses after the last substitution is odd, the substitution
pattern will be 000V, which makes the total number of nonzero pulses even.
2. If the number of nonzero pulses after the last substitution is even, the substitution
pattern will be B00V, which makes the total number of nonzero pulses even.
 commonly used outside of North America (e.g. Europe & Japan)
Encoding schemes spectral density
Analog-to-digital conversion

 Sometimes, we have an analog signal such as one


created by a microphone or camera, which requires
analog-to-digital conversion.
 2 main techniques for analog-to-digital conversion:
 pulse code modulation (PCM)
 delta modulation (DM)
Data transmission modes
 Of primary concern when we are considering the
transmission of data from one device to another is the
wiring, which relates to the data stream.
 The transmission of binary data across a link can be
accomplished in either parallel or serial mode

You might also like