2.7.1.
2 Block Coding
Block coding changes m bits into a block of
n bits (n > m)
Referred as mB/nB encoding technique
Block coding normally involves 3 steps :
Division – a sequence of bits is divided into
groups of m bits (ex : in 4B/5B encoding, the
original bit sequence is divided into 4-bit
groups).
Substitution – substitute an m-bit group for
an n-bit group (ex : in 4B/5B encoding, a 4-
bit code is substituted for a 5-bit group.
Combination – n-bit groups are combined
together to form a stream.
The new stream has more bits than the
original bits
Chapter 2 : Data Communications 1
[Link] Block Coding
4B/5B
was designed to be used in combination with NRZ-I
to overcome a long 0s synchronization problem, 4B/5B technique is used prior
to encoding with NRZ-I to prevent a long stream of 0s.
In 4B/5B, the 5-bit output that replaces the 4-bit input has no more than 1
leading (zero and 2 trailing zeros).
when different groups are combined to make a new sequence, there are never
more than 3 consecutive 0s.
Chapter 2 : Data Communications 2
[Link] Block Coding
Chapter 2 : Data Communications 3
[Link] Scrambling
modified part of bipolar AMI technique
Narrow bandwidth and does not create a DC component problem.
However long 0s upset the synchronization and not suitable for long distance.
Looking for a solution – a technique that does not increase the number of bits
and providing synchronization.
Chapter 2 : Data Communications 4
[Link] Scrambling
B8ZS
Commonly used in North America
Updated version of AMI with synchronization
Substitutes eight consecutive zeros with 000VB0VB
V denotes “violation”, B denotes “bipolar”
Letter V (violation) : same polarity as the polarity of the previous nonzero pulse.
Letter B (bipolar) : polarity opposite to the polarity of the previous nonzero
pulse.
Chapter 2 : Data Communications 5
[Link] Scrambling
HDB3
High-density bipolar 3-zero
Commonly used outside of North America
HDB3 substitutes four consecutive zeros with 000V or B00V depending on the
number of nonzero pulses after the last substitution
If the number of the nonzero pulses after the last substitution is odd, the
substitution pattern I 000V, which makes the number of nonzero pulses even.
If the number of the nonzero pulses after the last substitution is even, the
substitution pattern is B00V, which make the total number of nonzero pulses
even
Chapter 2 : Data Communications 6
2.7.2 Analog-To-Digital Conversion
Analog information (e.g., voice) digital signal (e.g., 10001011…)
Two techniques :
Pulse Code Modulation (PCM)
Delta Modulation
Chapter 2 : Data Communications 7
[Link] Pulse Code Modulation (PCM)
Three processes :
The analog signal is sampled
The sampled signal is quantized
The quantized values are encoded as streams of bits
Chapter 2 : Data Communications 8
[Link] Pulse Code Modulation (PCM)
Sampling (PAM – Pulse Amplitude Modulation)
According to the Nyquist theorem, the sampling rate must be at least 2 times the
highest frequency contained in the signal.
Chapter 2 : Data Communications 9
[Link] Pulse Code Modulation (PCM)
Recovery of a sampled sine wave for different sampling rates :
Chapter 2 : Data Communications 10
[Link] Pulse Code Modulation (PCM)
Ex : telephone companies digitize voice by assuming a maximum frequency of
4000 Hz. The sampling rate therefore is 8000 samples per second.
Ex : a complex low-pass signal as a bandwidth of 200 kHz. What is the
minimum sampling rate for this signal ?
Ex : a complex bandpass signal has a bandwidth has a bandwidth of 200 kHz.
What is the minimum sampling rate for this signal ?
Chapter 2 : Data Communications 11
[Link] Pulse Code Modulation (PCM)
Quantization
The result of sampling is a series of pulses with amplitude values between the
maximum and minimum amplitude of the signal.
The set of amplitudes can be infinite with nonintegral values between the two limits
and the values cannot be used in the encoding process.
Steps in Quantization
Assume that the original analog signal has instantaneous amplitudes between Vmin
and Vmax.
The range is divided into L zones, each of height Δ (delta).
V max V min
L
Assign quantized values of 0 to L-1 to the midpoint of each zone.
Approximate the value of the sample amplitude to the quantized values
Chapter 2 : Data Communications 12
[Link] Pulse Code Modulation (PCM)
Quantization (Examples)
Assume a sampled signal and the sample amplitudes are between -20 and +20V. We
decide to have eight levels (L = 8). This means that Δ = 5V.
Normalized PAM values
= actual amplitude/Δ
Normalized quantized
values = mid value of the
zone
Normalized error =
different between
normalized values and
normalized quantized
values
Chapter 2 : Data Communications 13
[Link] Pulse Code Modulation (PCM)
Quantization Levels
Depends on the range of the amplitudes of the analog signal and how accurately we
want to recover the signal.
Quantization error
If the input value is at the middle of the zone = no quantization error
Otherwise there is an error
The value of the error for any sample is less than Δ/2.
Range of error : -Δ/2 ≤ error ≥ Δ/2
Contribution of the quantization error to the SNRdB of the signal depends on the
number of quantization levels L, or the bits per sample nb as follow :
SNRdB 6.02nb 1.76dB
Chapter 2 : Data Communications 14
[Link] Pulse Code Modulation (PCM)
Ex : what is the SNRdB in the previous example ?
Ex : A telephone subscriber line must have an SNRdB above 40. What is the
minimum number of bits per sample ?
Chapter 2 : Data Communications 15
[Link] Pulse Code Modulation (PCM)
Encoding
After each sample is quantized and the number of bits per sample is decided, each
sample is changed to an nb-bit codeword.
If the number of quantization levels is L, the number of bits is nb = log2L.
The bit rate can be found as
Bit rate sampling rate number of bits per sample f s n b
Ex : we want to digitize the human voice. What is the bit rate, assuming 8 bits per
sample ?
Chapter 2 : Data Communications 16
[Link] Pulse Code Modulation (PCM)
Original Signal Recovery
The recovery of the original signal requires the PCM decoder.
The decoder first uses circuitry to convert the code words into a pulse that holds the
amplitude until the next pulse.
Then the complete staircase signal is passed through a low pass filter to smooth the
staircase signal into an analog signal.
The filter has the same cutoff frequency as the original signal at the sender.
If the signal has been sampled at (or greater than) the Nyquist sampling rate and
enough quantization levels, the original signal will be recreated.
Chapter 2 : Data Communications 17
[Link] Pulse Code Modulation (PCM)
PCM bandwidth
Supposed we are given an analog signal with a given bandwidth, then digitized the
signal, what is the new minimum bandwidth of the channel that can pass this digital
signal ?
Previously, the minimum bandwidth of a line-encoded signal is
1
B min c N
r
Substitute the value of N (data rate) = fs x nb
1 1 1
B min c N c f s nb c 2 Banalog nb
r r r
When 1/r =1 (for a NRZ or bipolar signal) and c = ½ (average situation), the
minimum bandwidth is
B min nb Banalog
Chapter 2 : Data Communications 18
[Link] Pulse Code Modulation (PCM)
Maximum data rate of a channel
N max 2 B log 2 L bps
Minimum required bandwidth
N
Bmin Hz
2 log 2 L
Chapter 2 : Data Communications 19
[Link] Delta Modulation
Developed to reduce the complexity of PCM.
PCM finds the value of the signal amplitude for each sample; Delta
Modulation finds the changes from the previous sample
No code words; bits are sent one after another.
Chapter 2 : Data Communications 20
[Link] Delta Modulation
Modulator
Modulator is used at the sender to create a stream of bits from an analog signal.
The process records the small positive or negative changes, called delta δ.
If the δis positive, the process records 1. If the δis negative, the process records 0.
The modulator builds a second signal that resembles a staircase.
The modulator at each sampling intervals, compares the input analog signal with the
last value of the staircase.
If the amplitude of the analog signal is larger, the next bit in the digital data is 1;
otherwise 0.
Chapter 2 : Data Communications 21
[Link] Delta Modulation
Modulator
The output of the comparator also makes the staircase itself; if the next bit is 1, the
staircase maker moves the last point of the staircase signal δup, otherwise moves the
δdown.
A delay unit is used to hold the staircase function for a period between two
comparisons.
Chapter 2 : Data Communications 22
[Link] Delta Modulation
Demodulator
The demodulator takes the digital data, and using the staircase maker and the delay
unit, creates the analog signal.
A low-pass filter is used to smoothen the signal.
Chapter 2 : Data Communications 23
2.7.3 Transmission Modes
A 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.
Chapter 2 : Data Communications 24
2.7.3 Transmission Modes
A 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.
Chapter 2 : Data Communications 25
2.7.3 Transmission Modes
Parallel Transmission
Use n wires to send n bits at one time synchronously
Advantage: speed
Disadvantage: cost Limited to short distances
Chapter 2 : Data Communications 26
2.7.3 Transmission Modes
Serial Transmission
On communication channel
Advantage: reduced cost
Parallel/serial converter is required
Three ways: asynchronous, synchronous, or isochronous
Chapter 2 : Data Communications 27
2.7.3 Transmission Modes
Serial Transmission – Asynchronous transmission
so named because the timing of a signal is unimportant.
In asynchronous transmission, a sender 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.
Chapter 2 : Data Communications 28
2.7.3 Transmission Modes
Serial Transmission – Synchronous transmission
Bit stream is combined into “frames”
In synchronous transmission, bits are sent after another without start or stop bits or
gaps. It is the responsibility of the receiver to group the bits.
Advantage: speed high-speed transmission
Accuracy of the received information depends on the ability of the receiver to keep
an accurate count of the bits as they come in.
Chapter 2 : Data Communications 29
2.7.3 Transmission Modes
Serial Transmission – Isochronous transmission
In real time audio and video, in which uneven delays between frames are not
acceptable, synchronous transmission fails.
Ex: TV images are broadcasted at the rate of 30 images per second ; and they must
be viewed at the same rate.
The isochronous transmission guarantees that the data arrive at a fixed rate.
Isochronous = occurring at the same time
Chapter 2 : Data Communications 30
2.8 Data Flow
A communication between two devices can be simplex, half duplex or full
duplex.
Chapter 2 : Data Communications 31
2.8 Data Flow
Simplex
Unidirectional
As on a one-way street
Ex : TV broadcasting
Half-duplex
Both transmit and receive possible, but not at the same time
Like a one-lane road with two-directional traffic
Ex : Walkie-talkie
Full-duplex
Transmit and receive simultaneously
Like a two-way street, telephone network
Channel capacity must be divided between two directions
Ex : computer network
Chapter 2 : Data Communications 32