0% found this document useful (0 votes)
34 views26 pages

Lecture 9 - Technical Basic of Comm - 3

The document discusses line coding techniques for converting digital data into digital signals for transmission. It covers the basic concepts of line coding, including unipolar NRZ, polar NRZ, return-to-zero, Manchester, and differential Manchester coding. Diagrams and explanations of each technique are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views26 pages

Lecture 9 - Technical Basic of Comm - 3

The document discusses line coding techniques for converting digital data into digital signals for transmission. It covers the basic concepts of line coding, including unipolar NRZ, polar NRZ, return-to-zero, Manchester, and differential Manchester coding. Diagrams and explanations of each technique are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Presentation Outline

INDUSTRIAL INSTRUMETATION AND


❑Basic concepts
CONTROL SYSTEMS
❑Network Topology
Lecture 9. Technical Basis of ❑OSI Model
IICS Communication_ 3
Line code
❑Medium access control
❑Transmission medium
❑Physical Standards
Assoc. Prof. Dr. BUI Dang Thanh ❑Line code
School of Electronic & Electrical Engineering,
Hanoi University of Science and Technology ❑Error detection and correction
Dai Co Viet road, Ha Noi, Viet Nam

6/5/2023 [email protected] 1 6/5/2023 [email protected] 2 6/5/2023 [email protected] 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

6/5/2023 [email protected] 4 6/5/2023 [email protected] 5 6/5/2023 [email protected] 6

4 5 6

2
Line code Line code – Characteristics Line code – Unipolar NRZ

➢ NRZ (nonreturn to zero)


➢ Types • Bit rate versus data rate
• Voltage level remains during a bit interval
• Unipolar: only 2 voltage levels are • DC component elimination • There are two NRZ schemes: NRZ-I and NRZ-L
used
• Noise immunity v
0 1 0 0 1 1
• Polar: only 2 voltage levels are used • Synchronization V NRZ-L (nonreturn to zero level)

0 1 = Low level
t 0 = High level
-V
• Bipolar: 3 voltage levels are used

6/5/2023 [email protected] 7 6/5/2023 [email protected] 8 6/5/2023 [email protected] 9

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

6/5/2023 [email protected] 10 6/5/2023 [email protected] 11 6/5/2023 [email protected] 12

10 11 12

4
Line code – Polar RZ Line code – Manchester (biphase) Line code – Differential Manchester

➢Characteristic of RZ Encoding ➢ Manchester ➢ Differential Manchester


• Low-to-high (rising edge) represents a “1” • Transition in the middle of the interval
• Three levels • High-to-low (falling adge) represents a “0” • Transition at the beginning of the interval represent a “0”
• Lack of transition at the beginning of the interval represent a “1”
• Transition in the middle of the interval
• Bit rate is double of data rate v

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

6/5/2023 [email protected] 13 6/5/2023 [email protected] 14 6/5/2023 [email protected] 15

13 14 15

5
Line code – Manchester (biphase) Line code – Bipolar AMI Line code – Bipolar AMI

➢ Bipolar AMI (Alternate Mark Inversion)


➢Characteristic of Biphase Encoding ➢Characteristic of Biphase Encoding
• Use THREE voltage levels
• Different from Polar RZ, the zero level is used to represent “0”
• Two levels • “1”s are represented by alternating positive and negative voltages • Three levels
• Bit rate is double data rate v
• Loss of synchronization for long sequences
0 1 0 0 1 1

• Good synchronization V “0” = zero level


• Lesser bandwidth
0 “1” = alternating
• Higher bandwidth -V t

6/5/2023 [email protected] 16 6/5/2023 [email protected] 17 6/5/2023 [email protected] 18

16 17 18

6
Presentation Outline Cause of the error

❑ Cause of the error


Attenuation:

Error Detection and


❑ Single parity check
When a signal is transmitted in a physical environment, it is attenuated,
❑ Two-dimensional parity check
Correction
especially when transmitting signals at high frequencies.
❑ Cyclic redundancy check

6/5/2023 [email protected] 19 6/5/2023 [email protected] 20 6/5/2023 [email protected] 21

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

6/5/2023 [email protected] 22 6/5/2023 [email protected] 23 6/5/2023 [email protected] 24

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

6/5/2023 [email protected] 25 6/5/2023 [email protected] 26 6/5/2023 [email protected] 27

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

6/5/2023 [email protected] 28 6/5/2023 [email protected] 29 6/5/2023 [email protected] 30

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

6/5/2023 [email protected] 31 6/5/2023 [email protected] 32 6/5/2023 [email protected] 33

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

6/5/2023 [email protected] 34 6/5/2023 [email protected] 35 6/5/2023 [email protected] 36

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.

6/5/2023 [email protected] 37 6/5/2023 [email protected] 38 6/5/2023 [email protected] 39

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

6/5/2023 [email protected] 40 6/5/2023 [email protected] 41 6/5/2023 [email protected] 42

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.

6/5/2023 [email protected] 43 6/5/2023 [email protected] 44 6/5/2023 [email protected] 45

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?

• Ans:- A parity bit appended to an array of binary digits


to make the sum of all the binary digits, including the
parity bit, always odd (odd parity) or always even
(even parity).

6/5/2023 [email protected] 46 6/5/2023 [email protected] 47 6/5/2023 [email protected] 48

46 47 48

16
CRC Error Detection Redundancy

Q:- What is the CRC?


• Detection methods

6/5/2023 [email protected] 49 6/5/2023 [email protected] 50 6/5/2023 [email protected] 51

49 50 51

17
Redundancy Vertical Redundancy Check VRC Longitudinal Redundancy Check(LRC)

Four Types of Redundancy Checks are Used


in Data Communications

6/5/2023 [email protected] 52 6/5/2023 [email protected] 53 6/5/2023 [email protected] 55

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)

▪ D is the information to be sent

6/5/2023 [email protected] 57 6/5/2023 [email protected] 58 6/5/2023 [email protected] 59

57 58 59

19
Binary Division Polynomial Polynomial and Divisor

6/5/2023 [email protected] 61 6/5/2023 [email protected] 62 6/5/2023 [email protected] 63

61 62 63

20
Standard Polynomials Checksum At the Sender

• The unit is divided into k sections, each of n bits.


• All sections are added together using one’s
complement to get the sum.
• The sum is complemented and becomes the
checksum.
• The checksum is sent with the data

6/5/2023 [email protected] 64 6/5/2023 [email protected] 65 6/5/2023 [email protected] 66

64 65 66

21
At the Receiver Performance Error Correction

• The checksum detects all errors involving an odd


• The unit is divided into k sections, each of n bits. number of bits.
• All sections are added together using one’s It can be handled in two ways:
• It detects most errors involving an even number of
complement to get the sum. bits. • receiver can have the sender retransmit the entire
• The sum is complemented. data unit.
• If one or more bits of a segment are damaged and the
• If the result is zero, the data are accepted: otherwise, corresponding bit or bits of opposite value in a second • The receiver can use an error-correcting code, which
they are rejected. segment are also damaged, the sums of those automatically corrects certain errors.
columns will not change, and the receiver will not
detect a problem.

6/5/2023 [email protected] 67 6/5/2023 [email protected] 68 6/5/2023 [email protected] 69

67 68 69

22
Single-bit Error Correction Error Correction Hamming Code

To correct an error, the receiver reverses the value of


the altered bit. To do so, it must know which bit is in
error.
Number of redundancy bits needed
• Let data bits = m
• Redundancy bits = r
Total message sent = m+r
The value of r must satisfy the following relation:
2r ≥ m+r+1

6/5/2023 [email protected] 70 6/5/2023 [email protected] 71 6/5/2023 [email protected] 72

70 71 72

23
Hamming Code Hamming Code Example of Hamming Code

6/5/2023 [email protected] 73 6/5/2023 [email protected] 74 6/5/2023 [email protected] 75

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."

6/5/2023 [email protected] 76 6/5/2023 [email protected] 77 6/5/2023 [email protected] 78

76 77 78

25
CRC

Q:- What is the 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.

6/5/2023 [email protected] 79 6/5/2023 [email protected] 93

79 93

26

You might also like