2. 4.2
4-1 DIGITAL-TO-DIGITAL CONVERSION
In this section, we see how we can represent digital
data by using digital signals. The conversion involves
three techniques: line coding, block coding, and
scrambling. Line coding is always needed; block
coding and scrambling may or may not be needed.
Line Coding
Line Coding Schemes
Block Coding
Scrambling
Topics discussed in this section:
3. 4.3
Line Coding
ā¼ Line coding is the process of
converting digital data to digital signals
ā¼ At the sender, data elements are
encoded into signal elements
ā¼ At the receiver, signal elements are
decoded into data elements
5. 4.5
Characteristics of line coding
ā¼ Data Element vs. Signal Element
ā¼ Data Rate vs. Signal Rate
ā¼ Bandwidth
ā¼ Baseline Wandering
ā¼ DC Components
ā¼ Self-Synchronization
ā¼ Built-in Error Detection
ā¼ Immunity to noise and interference
ā¼ Complexity
6. 4.6
Signal Elements vs. Data Elements
ā¼ A data element is the smallest entity that
can represent a piece of information (a bit)
ā¼ A signal element is the shortest unit in
time of a digital signal (a baud)
ā¼ Data elements are what we need to send
ā¼ Signals elements are what we can send
ā¼ The ratio, r, is defined as the number of
data elements carried by each signal
element
8. 4.8
Data Rate vs. Signal Rate
ā¼ The data rate (or bit rate), N, is the number of
data elements (bits) sent in one second
ā¼ The signal rate (or baud rate or pulse rate or
modulation rate), S, is the number of signal
elements (bauds) sent in one second
ā¼ The goal is to increase the data rate (and hence
the speed of transmission) while decreasing the
signal rate (and hence the required bandwidth)
ā¼ Where c is the case factor that depends on the
case
9. 4.9
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
Example 4.1
10. 4.10
The Bandwidth
ā¼ As learned previously, a digital signal that carries
information is nonperiodic and its bandwidth is
continuous and infinite
ā¼ Also, many of its components have very small
amplitude that can be ignored
ā¼ Therefore, the āeffective bandwidthā of the real-
life digital signal is finite
ā¼ The bandwidth is proportional to the signal rate
ā¼ Given N:
ā¼ Given B:
r
N
c
B
1
min ļ“
ļ“
=
r
B
c
N ļ“
ļ“
=
1
max
11. 4.11
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?
Solution
A 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
Example 4.2
12. 4.12
Although the actual bandwidth of a
digital signal is infinite, the effective
bandwidth is finite.
Note
13. 4.13
Baseline Wandering
ā¼ While decoding the received signal, the receiver,
calculates the running average of the received
signal power, called the ābaselineā
ā¼ The incoming signal power is evaluated against
the baseline in order to determine the value of
the data element
ā¼ Long strings of 0ās or 1ās can cause a drift of the
baseline, called ābaseline wanderingā, which
makes it hard for the receiver to correctly
decode the signal
ā¼ A good line coding scheme should prevent
baseline wandering
14. 4.14
DC Components
ā¼ Long constant voltage levels (DC) in digital
signals create low-frequency components
ā¼ DC components are mostly filtered out in
systems that canāt pass low frequencies
ā¼ A good line coding scheme should have no
DC components
15. 4.15
Self-synchronization
ā¼ The sender and receiver must be exactly
synchronized in order for the received signals to
be interpreted correctly
ā¼ Bit duration, the start, and the end of the bits
should be exactly identified by the receiver
ā¼ If the sender and the receiver are running at
different clock rates, the bit intervals will not
match and the receiver may misinterpret the
signals
ā¼ A good āself-synchronizedā line coding scheme
should keep the receiver well-synchronized
17. 4.17
In a digital transmission, the receiver clock is 0.1
percent faster than the sender clock. How many extra
bits per second does the receiver receive if the data rate
is 1 kbps? How many if the data rate is 1 Mbps?
Solution
At 1 kbps, the receiver receives 1001 bps instead of 1000
bps.
Example 4.3
At 1 Mbps, the receiver receives 1,001,000 bps instead
of 1,000,000 bps.
19. 4.19
Figure 4.5 Unipolar NRZ (Non-Return to Zero) scheme
ā¼ Unipolar: All signal levels at one side of the time axis
ā¼ NRZ since the signal does not return to zero in the middle
of the bit
ā¼ Relatively very costly scheme in terms of normalized
power
ā¼ Hence, not a popular scheme nowadays
20. 4.20
Figure 4.6 Polar NRZ-L (NRZ-Level) and NRZ-I (NRZ-Invert) schemes
ā¼ Polar: The signal levels are on both sides of the time axis
ā¼ NRZ-L: the voltage level determines the value of the bit
ā¼ NRZ-I: the change or lack of change determines the value
ā¼ Baseline Wandering and Synchronization problems: in
both, but twice as severe in NRZ-L
ā¼ Both have the DC Component problem
23. 4.23
A system is using NRZ-I to transfer 1 Mbps data. What
are the average signal rate and minimum bandwidth?
Solution
The average signal rate is S = N/2 = 500 kbaud. The
minimum bandwidth for this average baud rate is Bmin
= S = 500 kHz.
Example 4.4
24. 4.24
Figure 4.7 Polar RZ (Return-to-Zero) scheme
ā¼ RZ: the signal changes at the beginning and in middle of bit
ā¼ Solves the synchronization problem in NRZ schemes
ā¼ No DC Component problem
ā¼ Needs two signal levels to encode a bit ā more bandwidth
ā¼ Uses 3 signal levels ā more complex
ā¼ Not a popular scheme
25. 4.25
Figure 4.8 Polar biphase: Manchester and differential Manchester schemes
ā¼ Overcome the problems of NRZ-L & NRZ-I
ā¼ The cost is doubling the signal rate and hence the minimum
bandwidth
26. 4.26
In Manchester and differential
Manchester encoding, the transition
at the middle of the bit is used for
synchronization.
Note
29. 4.29
Figure 4.9 Bipolar schemes: AMI and pseudoternary
ā¼ AMI (Alternate Mark Inversion) = Alternate 1 Inversion
ā¼ AMI: 0 = zero volt, 1 = alternating positive and negative
ā¼ Pseudoternary: 1 = zero volt, 0 = alter. pos. and neg.
ā¼ No DC component. Why?
ā¼ What about synchronization?
30. 4.30
Multi-Level Line Encoding Schemes (mBnL)
ā¼ The goal is to increase the number of bits per baud by
encoding a pattern of m DEās into a pattern of n SEās
ā¼ Binary data elements ā 2m data patterns
ā¼ L signal levels ā Ln signal patterns
ā¼ If 2m = Ln ā each data pattern has a signal pattern
ā¼ If 2m < Ln ā data patterns form a subset of the signal
patterns
ā¼ Extra signal patterns can be used for better synch. and error
detection
ā¼ If 2m > Ln ā not enough signal patterns (not allowed)
ā¼ mBnL ā Binary patterns of length m, signal patterns of
length n with L signal levels
ā¼ L can be replaced by:
ā¼ B (Binary) ā L=2 (e.g.; 2B2B)
ā¼ T (Ternary) ā L=3 (e.g.; 8B6T)
ā¼ Q (Quaternary) ā L=4 (e.g.; 2B1Q)
31. 4.31
In mBnL schemes, a pattern of m data
elements is encoded as a pattern of n
signal elements in which 2m ā¤ Ln.
Note
32. 4.32
Figure 4.10 Multilevel: 2B1Q (2 Binary 1 Quaternary) scheme
ā¼ Faster data rate. Why?
ā¼ L = 4 ā complex receiver & 22 = 41 ā no extra signal patterns
ā¼ What about the DC Comp.? Not balanced (scrambling used to help)
ā¼ What about synchronization and baseline wandering? (same)
2
33. 4.33
Figure 4.11 Multilevel: 8B6T (Eight Binary 6 Ternary) scheme
ā¼ 36 - 28 = 473 extra signal patterns ā good synchronization
and error detection
ā¼ Each pattern has a weight of either 0 or +1 DC values
ā¼ If two consecutive patterns with +1 weight, the sender
inverts the second pattern. Why?
ā¼ How does the receiver recognize the inverted pattern?
ā¼ Savg = Ā½ x N x 6/8 = 3N/8
34. 4.34
Figure 4.12 Multilevel: 4D-PAM5 scheme
ā¼ 4-dimentional five-level pulse amplitude modulation
ā¼ Level-0 is only used for error-correction
ā¼ Equivalent to 8B4Q scheme with Smax = N x 4/8 = N/2
ā¼ Four signal are sent simultaneously over four different wires
ā¼ Smax = N/8
ā¼ Used in Gigabit LANs over 4 copper cables
35. 4.35
Figure 4.13 Multi-transition: MLT-3 scheme
ā¼ If next bit is 0 ā no transition (problematic long string of 0ās)
ā¼ If next bit is 1 and current level is not zero ā next level is 0
ā¼ If next bit is 1 and current level is zero ā alternate the nonzero level
ā¼ The worst case is a periodic signal with period of 4/N
ā¼ ā Smax = N/4
37. 4.37
Block Coding
ā¼ The process of stuffing the bit stream
with redundant bits in order to:
ā¼ Ensure synchronization
ā¼ Detect errors
ā¼ The bit stream is divided into groups of
m bits (called blocks)
ā¼ Each group is substituted with a different
(usually larger) group of n bits (a code)
ā¼ This is referred to as mB/nB coding
38. 4.38
Block coding is normally referred to as
mB/nB coding;
it replaces each m-bit group with an
n-bit group.
Note
39. 4.39
Steps in Block Coding Transformation
ā¼ Step 1: Division
ā¼ The bit stream is divided into groups of m bits
ā¼ Step 2: Substitution
ā¼ The m-bit groups are substituted with n-bit codes, where n>m
ā¼ A number of n-bit codes are carefully chosen to ensure that the
synchronization and error detection are achieved
ā¼ Notice that at most only one half of the n-bit codes are needed. Why?
ā¼ Step 4: Combination
ā¼ The n-bit groups are combined together to form a new bit stream
ā¼ Step 3: Line Coding
ā¼ A simple line coding scheme is used to convert the new bit stream
into signals
ā¼ No need for a complex line coding scheme since block coding ensures
at least the synchronization
41. 4.41
Common Block Codes
ā¼ 4B/5B Code
ā¼ Every 4-bit block of data is substituted with a 5-bit codes
ā¼ The 5-bit codes are line encoded with NRZ-I
ā¼ Each code has no more than one leading 0 and no more
than two trailing 0ās (i.e.; no more than 3 consecutive
0ās will ever be transmitted)
ā¼ What about consecutive 1ās? Why is it not handled?
ā¼ 20% more bauds on NRZ-I due to using redundant bits
ā¼ Unused codes provide a kind of error detection. How?
ā¼ What about the DC component problem with NRZ-I?
ā¼ 8B/10B Code
ā¼ Same as 4B/5B except for the number of bits substituted
ā¼ More codes are available for better error detection
capability
45. 4.45
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 MHz. The first choice needs a lower
bandwidth, but has a DC component problem; the
second choice needs a higher bandwidth, but does not
have a DC component problem.
Example 4.5
46. 4.46
Figure 4.17 8B/10B block encoding
ā¼ It is a combination of 5B/6B and 3B/4B encoding for simpler mapping
ā¼ The disparity controller is used prevent long consecutive 0ās or 1ās
ā¼ If the bits in the current block creates a disparity that contributes to
the previous disparity, the bits in the current block are complemented
ā¼ The coding has 210 ā 28 = 768 redundant code that can be used for
disparity checking and error detection
47. 4.47
4-2 ANALOG-TO-DIGITAL CONVERSION
We have seen in Chapter 3 that a digital signal is
superior to an analog signal. The tendency today is
to change an analog signal to digital data. In this
section we describe two techniques, pulse code
modulation and delta modulation.
Pulse Code Modulation (PCM)
Delta Modulation (DM)
Topics discussed in this section:
48. 4.48
Figure 4.21 Components of PCM encoder
1. The analog signal is sampled
2. The sampled signal is quantized
3. The quantized values are encoded as streams of bits
51. 4.51
Sampling: Definition and Background
ā¼ Sampling is converting analog signals into digital by
taking samples at certain uniform intervals called
sampling interval (or sampling period), Ts
ā¼ The inverse of the sampling interval is called sampling
rate (or sampling frequency), fs = 1/Ts
ā¼ Sampling is also called Pulse Amplitude Modulation (PAM)
ā¼ The idea started by telephone carriers to provide long
distance services
ā¼ The analog voice signal loses power on long distance cables and
therefore require amplifiers
ā¼ Amplifiers distort the signal due to their own frequency spectrum
and phase changes and they also add noise
ā¼ Since digital signals are more immune to noise and distortion,
digitization is used
53. 4.53
Sampling Rate: Nyquist Theorem
ā¼ Question: How many samples are needed to
digitally reproduce the analog signal
accurately?
ā¼ Ideally, infinite number of samples
ā¼ Nyquist Theorem: the sampling rate should
be at least twice the highest frequency
component in the original analog signal
54. 4.54
According to the Nyquist theorem, the
sampling rate must be
at least 2 times the highest frequency
contained in the signal.
Note
56. 4.56
For an intuitive example of the Nyquist theorem, let us sample
a simple sine wave at three sampling rates: fs = 4f (2 times the
Nyquist rate), fs=2f (Nyquist rate), and fs = 4f/3 (a little more
than one-half the Nyquist rate). Figure 4.24 shows the
sampling and the subsequent recovery of the signal.
It can be seen that sampling at the Nyquist rate can create a
good approximation of the original sine wave (part a).
Oversampling in part b can also create the same
approximation, but it is redundant and unnecessary. Sampling
below the Nyquist rate (part c) does not produce a signal that
looks like the original sine wave.
Example 4.6
58. 4.58
Telephone companies digitize voice by assuming a
maximum frequency of 4000 Hz. The sampling rate
therefore is 8000 samples per second.
Example 4.9
59. 4.59
A complex low-pass signal has a bandwidth of 200 kHz.
What is the minimum sampling rate for this signal?
Solution
The bandwidth of a low-pass signal is between 0 and f,
where f is the maximum frequency in the signal.
Therefore, we can sample this signal at 2 times the
highest frequency (200 kHz). The sampling rate is
therefore 400,000 samples per second.
Example 4.10
60. 4.60
A complex bandpass signal has a bandwidth of 200
kHz. What is the minimum sampling rate for this
signal?
Solution
We cannot find the minimum sampling rate in this
case because we do not know where the bandwidth
starts or ends. We do not know the maximum
frequency in the signal.
Example 4.11
61. 4.61
Quantization
ā¼ Quantization: assigning values in a specific range of
sampled instances
ā¼ Each value is translated into a binary equivalent number
(i.e.; Binary Encoding)
ā¼ The binary digits are converted into digital signal using
line coding
ā¼ Steps of quantization:
ā¼ 1. Assume that the analog signal ranges between Vmin and Vmax
ā¼ 2. Divide the range into L zones each of height ļ² (delta)
ā¼ 3. Assign quantized values of 0 to L-1 to the midpoint of the zone
ā¼ 4. Approximate the sample amplitude to the quantized value
L
V
V min
max ā
=
ļ
62. 4.62
Figure 4.26 Quantization and encoding of a sampled signal
ā¼ Vmin = -20 v
ā¼ Vmax = +20 v
ā¼ L = 8
ā¼ ļ² = 5 v
63. 4.63
Quantization Levels and Error
ā¼ The number of levels, L, depends on:
ā¼ The amplitude range of the analog signal
ā¼ The accuracy needed in recovering the signal
ā¼ Choosing low values of L may increase the quantization
error if the signal changes a lot
ā¼ The quantization error for each sample is less than ļ²/2 (-
ļ²/2 ā¤ error ā¤ ļ²/2)
ā¼ The contribution of the quantization error to the SNRdB of
the signal depends on L or nb (the number of bits per
sample)
SNRdB = 6.02 nb + 1.76 dB
64. 4.64
What is the SNRdB in the example of Figure 4.26?
Solution
We can use the formula to find the quantization. We
have eight levels and 3 bits per sample, so
SNRdB = 6.02(3) + 1.76 = 19.82 dB
Increasing the number of levels increases the SNR.
Example 4.12
65. 4.65
A telephone subscriber line must have an SNRdB above
40. What is the minimum number of bits per sample?
Solution
We can calculate the number of bits as
Example 4.13
Telephone companies usually assign 7 or 8 bits per
sample.
66. 4.66
PCM Bandwidth
ā¼ Consider a low-pass analog signal
ā¼ Bit Rate = Sampling Rate x bits per sample
= fs x nb
= 2 x Banalog x log2 L (Nyquist Data Rate)
ā¼ Bmin = c x N x 1/r = c x fs x nb x 1/r
= c x 2 x Banalog x nb x 1/r
ā¼ When r=1 (for NRZ or Bipolar) and c=1/2,
Bmin = nb x Banalog
67. 4.67
We want to digitize the human voice. What is the bit
rate, assuming 8 bits per sample?
Solution
The human voice normally contains frequencies from 0
to 4000 Hz. So the sampling rate and bit rate are
calculated as follows:
Sampling Rate = 4000 x 2 = 8000 samples per second
Bit Rate = 8000 x 8 = 64,000 bps = 64 kbps
Example 4.14
68. 4.68
We have a low-pass analog signal of 4 kHz. If we send
the analog signal, we need a channel with a minimum
bandwidth of 4 kHz. If we digitize the signal and send 8
bits per sample, we need a channel with a minimum
bandwidth of 8 Ć 4 kHz = 32 kHz.
Example 4.15
70. 4.70
Delta Modulation (DM)
ā¼ PCM is a relatively complex A-to-D technique
ā¼ DM is a much simpler technique than PCM:
ā¼ Finds the delta change of the current sample compared to the
previous sample
ā¼ If the current sample is larger, it sends a 1. Otherwise, it sends a 0
Figure 4.28 The process of delta modulation
73. 4.73
4-3 TRANSMISSION MODES
The transmission of binary data across a link can be
accomplished in either parallel or serial mode. In
parallel mode, multiple bits are sent with each clock
tick. In serial mode, 1 bit is sent with each clock tick.
While there is only one way to send parallel data,
there are three subclasses of serial transmission:
asynchronous, synchronous, and isochronous.
Parallel Transmission
Serial Transmission
Topics discussed in this section:
75. Parallel Transmission
ā¼ Principle: use n wires to send n bits simultaneously
ā¼ Advantage: speed (n times faster than serial transmission)
ā¼ Disadvantage: cost and complexity due to the extra wiring
ā¼ Usually limited to short distances
ā¼ Devices: older Centronics printers, internal data & address buses
ā¼ Adapters: PIA (Par. Interface Adapter), PPI (Par. Peripheral. Interface)
4.75
Figure 4.32 Parallel transmission
76. 4.76
Figure 4.33 Serial transmission
Serial Transmission
ā¼ Principle: use 1 wire to send 1 bit at a time
ā¼ Advantage: cost and simplicity (almost a factor of n less than parallel)
ā¼ Requires serial-to-parallel and parallel-to-serial conversion
ā¼ Devices: Peripheral devices (e.g. mouse & keyboard), modems, etc.
ā¼ Adapters: ACIA (Asynchronous Comm. Interface Adapter), UART
(Universal Asynchronous Receiver Transmitter)
77. Asynchronous Serial Transmission
ā¼ The information is received and translated by agreed-upon patterns
ā¼ Usually, patterns are based on grouping the bits into bytes
ā¼ The sender handles each group independently
ā¼ Each group is sent whenever it is ready without regard to a timer
ā¼ To alert the receiver to the arrival of a new group, a āstart bitā (usually a 0 bit) is added
to the beginning of the group
ā¼ To let the receiver know that the byte has finished, 1 or more āstop bitsā are appended
to the end of the group
ā¼ Each group may be followed by a gap of random duration
ā¼ The gap can be an idle channel or a stream of stop bits
ā¼ The start and stop bits allow the receiver to synchronize with the data stream within the
group
ā¼ āAsynchronousā means that the sender and receiver do not have to be synchronized at
the group level, but at the bit level within the group
ā¼ The receiver counts n bits after the start bit and looks for the stop bit
4.77
78. 4.78
In asynchronous transmission, we send
1 start bit (0) at the beginning and 1 or
more stop bits (1s) at the end of each
byte. There may be a gap between
each byte.
Note
81. Synchronous Serial Transmission
ā¼ The bit stream is combined into longer āframesā
ā¼ Each frame may contain multiple bytes without gaps
ā¼ Mainly, the data is sent as a continuous stream of bits
ā¼ The receiver decides how to group them (e.g.; into
bytes, characters, numbers, etc.) for decoding purposes
ā¼ If the sender sends the data in bursts, the gap must be
filled with a special sequence of 0ās & 1ās (i.e.; idle)
ā¼ Without start and stop bits, the receiver canāt adjust its
bit-level synchronization
ā¼ Therefore, strict timing between the sender and the
receiver is required in order to receive the bits correctly
ā¼ The advantage of synchronous transmission is speed as
there is no overhead of synchronization bits
4.81
82. 4.82
In synchronous transmission, we send
bits one after another without start or
stop bits or gaps. It is the responsibility
of the receiver to group the bits.
Note
84. Isochronous Serial Transmission
ā¼ Used for real-time applications, where:
ā¼ The synchronization between characters or bytes is
not enough but rather the synchronization of the
entire stream
ā¼ The delay between frames must be equal or none
ā¼ The data is received at a fixed rate
ā¼ Examples: real-time audio and video streaming
4.84