Lecture 9 - Technical Basic of Comm - 3
Lecture 9 - Technical Basic of Comm - 3
1 2 3
1
Contents Overview Overview
➢ Overview
➢ Number of Signal Level
➢ Purpose
• Purpose 1 0 1 1 0 0
• Two data levels and two signal levels 1
• Digital data is converted to digital signal for transformation
• Number of signal levels
• Line coding: Technique for converting digital data into digital signal
➢ Line code
Digital Data Digital Signal
• Characteristics 1 0 1 1 0 0
1
• Types 1000001 Line Coding • Two data levels and three signal levels
• Methods
4 5 6
2
Line code Line code – Characteristics Line code – Unipolar NRZ
0 1 = Low level
t 0 = High level
-V
• Bipolar: 3 voltage levels are used
7 8 9
3
Line code – Unipolar NRZ Line code – Polar NRZ Line code – Polar RZ
➢ NRZ-I (Nonreturn to Zero Invert) ➢ RZ (Return zero)
• A transition from one voltage level to the other represents a 1 • There must be a signal transition in the middle of each interval
• For bit 0, the voltage level remains ➢Characteristic of NRZ Encoding Bit rate is double data rate
v
• Two levels
v
0 1 0 0 1 1 1 = Change
V
• Bit rate same as data rate 0 1 0 0 1 1
0 = No Change V 1 = High level and return zero
0
t • Loss of synchronization for long sequences 0 0 = Low level and return zero
-V t
-V
10 11 12
4
Line code – Polar RZ Line code – Manchester (biphase) Line code – Differential Manchester
0 1 0 0 1 1 v
• Good synchronization V
0 1 0 0 1 1
V
0
• Increase in bandwidth 0
-V
t t
-V
13 14 15
5
Line code – Manchester (biphase) Line code – Bipolar AMI Line code – Bipolar AMI
16 17 18
6
Presentation Outline Cause of the error
19 20 21
7
Cause of the error Cause of the error Cause of the error
Noise:
The most important parameter for the transmission medium is the noise
Limited Bandwidth coefficient:
Delay distortion:
According to Nyquist formula the maximum transmission rate of the
S
transmission line is:
When transmitting signals with different frequencies on the line, this signal
HSN = 10 log 10 (dB)
VMax = 2 B.log2 M (bit/ s)
may reach the receiver with different time delays. Interference may occur N
causing the signal to be distorted According to Shannon - Hartley's law the maximum data rate of the
transmission medium is:
S
B log 2 (1 + ) (bit / s)
N
22 23 24
8
Parity Codes
Error Detection Error Detection
• Parity Check
• A parity bit is added to every data unit so that the total number of 1s(including the
• Detection methods
parity bit) becomes even for even-parity check or odd for odd-parity check • Known as a single error detecting code (SED). Only useful if
• Simple parity check
probability of getting 2 errors is small since parity will
become correct again
• Used in serial communications
• Low overhead but not very powerful
• Decoder can be implemented efficiently using a tree of
XOR gates
25 26 27
9
Parity Codes Parity Codes – Example 1 Parity Codes – Example 2
• Example of a simple block code – Single Parity Check Code • Coding table for (4,3) even parity code
• In this case, n = k+1, i.e., the codeword is the dataword with one • Even parity
additional bit
(i) d=(10110) so, Dataword Codeword
• For ‘even’ parity the additional bit is,
c=(101101) 0 0 0 0 0 0 0
q = i =1 di (mod 2)
k
(ii) d=(11011) so, 0 0 1 0 0 1 1
c=(110110) 0 1 0 0 1 0 1
0 1 1 0 1 1 0
– For ‘odd’ parity the additional bit is 1-q 1 0 0 1 0 0 1
– That is, the additional bit ensures that there are an ‘even’ 1 0 1 1 0 1 0
1 1 0 1 1 0 0
or ‘odd’ number of ‘1’s in the codeword 1 1 1 1 1 1 1
28 29 30
10
Parity Codes Parity Checks Parity Checks (continued)
• To decode
• Calculate sum of received bits in block (mod 2) • Simple parity (continued)
• Simple parity
• If sum is 0 (1) for even (odd) parity, then the dataword is the • What happens if the character 10010101 is sent and the first
first k bits of the received codeword • If performing even parity, add a parity bit such that an even two 0s accidentally become two 1s?
• Otherwise error number of 1s are maintained • Thus, the following character is received: 11110101
• If performing odd parity, add a parity bit such that an odd number • Will there be a parity error?
• Code can detect single errors
of 1s are maintained • Problem: Simple parity only detects odd numbers of bits in error
• But cannot correct error since the error could be in any bit • For example, send 1001010 using even parity
• For example, if the received dataword is (100000) the transmitted • For example, send 1001011 using even parity
dataword could have been (000000) or (110000) with the error
being in the first or second place respectively
• Note error could also lie in other positions including the parity bit
31 32 33
11
Parity Checks (continued) Parity Checks (continued) Parity Checks (continued)
• Longitudinal parity
• Adds a parity bit to each character then adds a row of parity bits
after a block of characters
• The row of parity bits is actually a parity bit for each “column”
of characters
• The row of parity bits plus the column parity bits add a great
amount of redundancy to a block of characters
34 35 36
12
Parity Checks (continued) Detection -examples Detection – examples
Example 1
• Both simple parity and longitudinal parity do not
catch all errors Example 2
Suppose the sender wants to send the word world. In ASCII the
• Simple parity only catches odd numbers of bit errors five characters are coded as Now suppose the word world in Example 1 is received by the
• Longitudinal parity is better at catching errors but receiver without being corrupted in transmission.
requires too many check bits added to a block of 1110111 1101111 1110010 1101100 1100100
data 11101110 11011110 11100100 11011000 11001001
The following shows the actual bits sent
• We need a better error detection method The receiver counts the 1s in each character and comes up with
11101110 11011110 11100100 11011000 11001001
• What about arithmetic checksum? even numbers (6, 6, 4, 4, 4). The data are accepted.
37 38 39
13
Detection – examples Two –Dimensional Parity Check Detection - example
Example 3 Example 4
Suppose the following block is sent:
Now suppose the word world in Example 1 is corrupted during 10101001 00111001 11011101 11100111 10101010
transmission.
However, it is hit by a burst noise of length 8, and some bits are
11111110 11011110 11101100 11011000 11001001 corrupted.
The receiver counts the 1s in each character and comes up with 10100011 10001001 11011101 11100111 10101010
even and odd numbers (7, 6, 5, 4, 4). The receiver knows that
When the receiver checks the parity bits, some of the bits do not
the data are corrupted, discards them, and asks for
follow the even-parity rule and the whole block is discarded.
retransmission.
10100011 10001001 11011101 11100111 10101010
40 41 42
14
Parity Codes Example Problem 2 Example Problem 2 - Solution
• To construct an even-parity code, add a parity bit such that the total
number of 1s is even. The serial port on a computer is set to transmit a file using 8 data bits
followed by 1 parity bit. The port is set for even parity. Another The serial port on a computer is set to transmit a file using 8
Information bits Even-parity code Odd-parity code
computer receives the following 9-bit strings. Which are valid and data bits followed by 1 parity bit. The port is set for even parity.
000 000 0 000 1 which contain an error? Another computer receives the following 9-bit strings. Which
001 001 1 001 0 are valid and which contain an error?
010 010 1 010 0
a. 001011010
011 011 0 011 1
a. 001011010 → even # of 1s, no error
100 100 1 100 0 b. 111111111
b. 111111111 → odd # of 1s, error
101 101 0 101 1 c. 101010100
110 110 0 110 1 c. 101010100 → even # of 1s, no error
111 111 1 111 0
• 1-bit parity codes can detect single bit errors, but they do not detect 2
bit errors.
43 44 45
15
Parity Codes Parity Checker Circuit Parity Bit
• The parity bit can be generated using several XOR gates.
• Data is 1011001
Q:- What is a parity bit?
46 47 48
16
CRC Error Detection Redundancy
49 50 51
17
Redundancy Vertical Redundancy Check VRC Longitudinal Redundancy Check(LRC)
52 53 55
18
VRC and LRC Cyclic Redundancy Check (CRC) Cyclic Redundancy Check
▪ we have the polynomial G, the order is n
▪ The source information bit sequence I will be added to n bits 0 and we call
▪ The ability to detect 1 error bit: 100%
it the polynomial P
▪ The ability to detect even errors: 100%
▪ take the binary polynomial P divided by the binary polynomial G according
▪ The ability to detect odd errors: 100%
to the rule: use subtraction (don't remember)
▪ capable of detecting errors less than 16 bits: 100%
▪ The remainder of the division is replaced into the position n bit 0 in binary
▪ capable of detecting errors greater than 16 bits: 99.9986%
polynomial P. We call this new binary polynomial D
▪ capable of detecting other errors: 99.9969%
▪ The polynomial D has the property that: D is divisible by G (the remainder
of the division is 0)
57 58 59
19
Binary Division Polynomial Polynomial and Divisor
61 62 63
20
Standard Polynomials Checksum At the Sender
64 65 66
21
At the Receiver Performance Error Correction
67 68 69
22
Single-bit Error Correction Error Correction Hamming Code
70 71 72
23
Hamming Code Hamming Code Example of Hamming Code
73 74 75
24
Single-bit Error Error Detection Hamming Distance Calculation
◼ Step - Ensure the two strings are of equal length. The Hamming distance
can only be calculated between two strings of equal length. String 1:
"1001 0010 1101" String 2: "1010 0010 0010"
◼ Step 2- Compare the first two bits in each string. If they are the same,
record a "0" for that bit. If they are different, record a "1" for that bit. In this
case, the first bit of both strings is "1," so record a "0" for the first bit.
◼ Step 3- Compare each bit in succession and record either "1" or "0" as
appropriate. String 1: "1001 0010 1101" String 2: "1010 0010 0010"
Record: "0011 0000 1111"
◼ Step 4- Add all the ones and zeros in the record together to obtain the
Hamming distance. Hamming distance = 0+0+1+1+0+0+0+0+1+1+1+1 =
6
Tip:-If using a computer, "XOR" can be used to compare the two strings and
obtain the "record."
76 77 78
25
CRC
• Ans:- The CRC is an error detecting code in which the Thank you for your attention!
code is the remainder resulting from dividing the bits
to be checked by a predetermined binary number.
79 93
26