Professional Documents
Culture Documents
Line Coding
Line Coding is the process of converting binary data, a sequence of bits, to a digital signal. For example, data, text, number, graphical image, audio and video that are stored in computer memory are all sequence of bits. Line coding converts a sequence of bits to a digital signal.
Some Characteristics
Line Coding
Some Characteristics
A digital signal can have a limited number of values. However, only some of these values can be used to represent data; rest are used for other purposes as we shall see shortly. Signal Levels: The number of values allowed in a particular signal. Data Levels: The number of values used to represent data.
Line Coding
Some Characteristics
Pulse Rate: It defines the number of pulses per second. A pulse is the minimum amount of time required to transmit a symbol.
Line Coding
Some Characteristics
Example 1
A signal has two data levels with a pulse duration of 1 ms. Calculate the pulse rate and bit rate.
Solution
Pulse Rate = 1/ 10-3= 1000 pulses/s Bit Rate = Pulse Rate x log2 L = 1000 x log2 2 = 1000 bps
Line Coding
Some Characteristics
Example 2
A signal has four data levels with a pulse duration of 1 ms. Calculate the pulse rate and bit rate.
Solution
Pulse Rate = = 1000 pulses/s Bit Rate = Pulse Rate x log2 L = 1000 x log2 4 = 2000 bps
Line Coding
Some Characteristics
Self-Synchronization
To correctly interpret the signals received from the sender, the receiver's bit intervals must correspond exactly to the senders bit interval. If the receiver clock is faster or slower, the bit intervals are not matched and the receiver might interpret the signals differently than the sender intended. Look at figure below to visualize the problem. The sender sends 10110001, while the receiver receives 110111000011.
Some Characteristics
Self-Synchronization
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: 1000 bits sent 1001 bits received1 extra bps At 1 Mbps: 1,000,000 bits sent 1,001,000 bits received1000 extra bps
Line Coding
Some Characteristics
Self-Synchronization
A Self-Synchronizing digital signal includes timing information in the data being transmitted. This can be achieved if there is the signal that alerts the receiver to the beginning, middle, or end of pulse. If the receivers clock is out of synchronization, these alerting points can reset the clock.
Line Coding
Line Coding
Unipolar Encoding
The polarity of a pulse refers to whether it is positive or negative. Unipolar encoding uses only one voltage level. It is named so because it uses only one polarity. This polarity is assigned to one of the two binary states, usually the 1. the other state, usually the 0, is represented by zero voltage.
Problems: 1) DC component. 2) Lack of synchronization in case of data containing long sequence of0s and 1s.
Line Coding
Polar Encoding
Polar encoding uses two voltage levels, one positive and one negative. Polar encoding is classified as follows:
Line Coding
Polar Encoding
Non return to Zero (NRZ): In it, the value of the signal is always either positive or negative. It is classified in two categories as follows: 1) In NRZ-L the level of the signal is dependent upon the state of the bit.
Line Coding
Polar Encoding
Return to Zero (RZ): It uses three values: positive, negative, and zero. In it signal changes not between bits but during each bit. A one bit is represented by positive-to-zero transition in the halfway of bit and a 0 bit by negative to-zero transition.
Disadvantage: It requires two signal changes to encode 1 bit and therefore occupies more bandwidth.
Line Coding
Polar Encoding
In Manchester Encoding, The transition at the middle of the bit is used for both synchronization and bit representation.
Line Coding
Polar Encoding
In Differential Manchester encoding, the transition at the middle of the bit is used only for synchronization. The bit representation is defined by the inversion or non inversion at the beginning of the bit.
Line Coding
Bipolar Encoding
In bipolar encoding, we use three levels: positive, zero, and negative. Bipolar alternate mark inversion (AMI): Binary 1 is represented by alternate 1 inversions.
Line Coding
2B1Q
2B1Q (two binary, one quaternary): uses four voltage levels, each representing two bits.
Block Coding
Block Coding: It was introduced to improve the performance of line coding. Some extra bits are include to:
-Ensure synchronization
-Detect errors
Block Coding
Steps in Transformation
Step 1 : Division
Block Coding
Steps in Transformation
Step 2 : Substitution
In this step, we substitute an m-bit code for an n-bit group, where nm. Therefore we can map some of the n-bit groups to the m-bit groups and some of the n-bit groups remains unused. We choose only those n-bit codes that help us in synchronization and error detection.
Block Coding
Steps in Transformation
Now we can use one of the line coding schemes. Figure below shows whole of the process.
Block Coding
Data
Steps in Transformation
Code Data
4B/5B encoding
Code
0000
0001
11110
01001
1000
1001
10010
10011
0010
0011 0100 0101 0110 0111
10100
10101 01010 01011 01110 01111
1010
1011 1100 1101 1110 1111
10110
10111 11010 11011 11100 11101
Block Coding
Steps in Transformation
Data
4B/5B encoding
Code
S (Set) R (Reset)
11001 00111
4.3 Sampling
Pulse Amplitude Modulation Pulse Code Modulation Sampling Rate: Nyquist Theorem How Many Bits per Sample? Bit Rate
Sampling
If you note carefully, Line and block coding can be used to convert binary data to a digital signal. What if data is analog, such as audio or video? The solution is sampling. The term sampling means measuring the amplitude of the signal at equal intervals.
Problem: PAM converts waveform to a series of pulses, which are still analog.
The binary data is then converted to digital signal by using one of the line coding or block coding technique.
Note: Note that we can always change a band-pass signal to a low-pass signal before sampling to reduce sampling rate.
Solution
The sampling rate must be twice the highest frequency in the signal: Sampling rate = 2 x (11,000) = 22,000 samples/s
Solution
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.
Solution
The human voice normally contains frequencies from 0 to 4000 Hz. Sampling rate = 4000 x 2 = 8000 samples/s Bit rate = sampling rate x number of bits per sample = 8000 x 8 = 64,000 bps = 64 Kbps
Transmission Mode
Transmission Mode
Parallel Transmission
Transmission Mode
Serial Transmission
Transmission Mode
Serial Transmission
Asynchronous transmission
Note: 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.
Transmission Mode
Serial Transmission
Asynchronous transmission
Note: Asynchronous here means asynchronous at the byte level, but the bits are still synchronized; their durations are the same.
Transmission Mode
Serial Transmission
Asynchronous transmission
Transmission Mode
Serial Transmission
Synchronous transmission
Note: In synchronous transmission, we send bits one after another without start/stop bits or gaps. It is the responsibility of the receiver to group the bits.
Transmission Mode
Serial Transmission
Synchronous transmission