You are on page 1of 53

DATA ENCODING

TECHNIQUES

Data Communication And Computer networks bmuwonge@cit.ac.ug 1


Data Communication Basics

 Analog or Digital.
 Three Components:
• Data.
• Signal.
• Transmission.

2
Analog Data Choices

3
Digital Data Choices

4 4
Encoding Techniques
1. Digital data, Digital signal.
2. Digital data, Analog signal.
3. Analog data, Digital signal.
4. Analog data, Analog signal.

5 5
Forms of Data Encoding
 Four possible combinations in
widespread use.
 Digital data-to-digital signal:
– Reason- equipment for encoding digital
data into a digital signal is less complex
and less expensive than digital-to-analog
conversion.
 Digital data-to- analog signal:
– Reason- some transmission media, such as
optical fiber and the unguided media, will
only propagate analog signals.

6
 Analog data-to- digital signal:
– Reason-conversion of analog data to
digital form permits the use of modern
digital transmission and switching
equipment.
 Analog data-to-analog signal:
– Reason-Analog data in electrical form can
be transmitted as baseband signals easily
and cheaply.

7
Transmission Choices
 Analog transmission.
• Only transmits analog signals, without regard
for data content.
• Attenuation overcome with amplifiers.
 Digital transmission.
• Transmits analog or digital signals.
• Uses repeaters rather than amplifiers.

8 8
Advantages of Digital Transmission
1. The signal is exact.
2. Signals can be checked for errors.
3. Noise/interference are easily filtered out.
4. A variety of services can be offered over
one line.
5. Higher bandwidth is possible with data
compression.

9 9
Encoding schemes

Analog data, Analog signal Analog data, Digital signal

voice analog analog digital


Telephone CODEC

Digital data, Analog signal Digital data, Digital signal

digital analog digital Digital digital


Modem
transmitter

10 10
Encoding and Modulation
x(t)
g(t) x(t) g(t)
Encoder Decoder
digital digital
or
analog
t
s(f)
m(t) s(t)
m(t)
Modulator Demodulator
digital analog
or f
analog fc
fc

11 11
Why encoding?

Three factors determine successfulness of receiving a


signal:
1. S/N (signal to noise ratio).
2. Data rate.
3. Bandwidth.

12 12
Factors to consider when choosing
Encoding techniques
1. Signal spectrum.

2. Clocking.

3. Error detection.

4. Signal interference & noise immunity.

5. Cost and complexity.

13 13
Comparison of Encoding Schemes
1- Signal Spectrum.
• Lack of high frequencies reduces transmission
bandwidth.
• Lack of dc component allows ac coupling via
transformer, providing isolation.
• It is important to concentrate power in the middle of
the bandwidth.
2- Clocking issues.
• There is need to determine the beginning and end of
each bit position.
• One expensive approach is to provide a separate clock
lead to synchronize the transmitter and receiver.
• The alternative is to provide some synchronization
mechanism that is based on the transmitted signal.
14
Comparison of Encoding Schemes
3- Error detection.
• It is useful to have some error detection
capability built into the physical signaling
encoding scheme.
• This commits errors to be detected more quickly.
• Signal interference and noise immunity.
• Some codes are better than others.
4- Cost and complexity.
• The higher the signaling rate to achieve a given
data rate, the greater the cost.
• Some codes require signaling rate greater than
the actual data rate.
15 15
Terms:
 Unipolar
All signal elements have same sign.
 Polar
One logic state represented by positive voltage
the
other by negative voltage.
 Data rate
Rate of data transmission in bits per second.
 Duration or length of a bit.
Time taken for transmitter to emit the
16
bit.
16
Terms:
 Modulation rate
• Rate at which the signal level changes.
• Measured in baud = signal elements per
second.
 Mark and Space
Binary 1 and Binary 0 respectively.

17 17
Interpreting Signals
 Need to know:
• Timing of bits - when they start and end
• Signal levels
 Factors affecting successful interpretation
of signals:
• Signal to noise ratio
• Data rate
• Bandwidth

18 18
1- DIGITAL DATA, DIGITAL SIGNAL
Characteristics:
 Digital signal.
• Uses discrete, discontinuous, voltage pulses.
• Each pulse is a signal element.
• Binary data is encoded into signal elements.

19 19
ENCODING SCHEMES
Unipolar
1. Non-return to Zero
• Level (NRZ-L)
• Inverted (NRZI)
2. Bipolar -AMI (Alternate Mark Inversion)
3. Pseudoternary
Biphase/Polar.
4. Manchester
5. Differential Manchester
6. B8ZS
7. HDB3
20
Digital Encoding techniques

21 21
Digital data, Digital signal
0 1 0 0 1 1 0 0 0 1 1
NRZ
NRZI
Bipolar -AMI

Pseudoternary
Manchester
Differential
Manchester
22 22
Encoding Techniques used in data
communication
 Non-Return-to-Zero (NRZ) line code
• Is a binary code in which "1s" are represented
by one significant condition (usually a positive
voltage) and "0s" are represented by some
other significant condition (usually a negative
voltage), with no other neutral or rest condition
• NRZ is a form of digital data transmission in
which the binary low and high states,
represented by numerals 0 and 1, are
transmitted by specific and constant DC
voltage.
• Commonly used in slow speed communications
interfaces for both synchronous and
asynchronous transmission
23
Encoding Techniques used in data
communication
 Non Return to Zero (NRZ) - straight binary
encoding
– Applies the most common, and easiest, way to
transmit digital signals.
– Two different voltage levels for the two binary
digits are used.
– Uses 0 volts for a data bit of '0' and a +V volts
for a data bit of '1'.
– More commonly used also is that, a negative
voltage is used to represent one binary value
and a positive voltage is used to represent the
other. 24
Non-Return to Zero-Level (NRZ-L)
 Two different voltages for 0 and 1 bits.
 Voltage constant during bit interval.
 Most often, negative voltage for one value
and positive for the other.

25 25
Non-return to Zero Inverted – (NRZ-I)
 Non-return to zero inverted on ones.
 Constant voltage pulse for duration of bit.
 Data encoded as presence or absence of signal
transition at beginning of bit time.
 Transition (low to high or high to low) denotes a
binary 1.
 No transition denotes binary 0.
 An example of differential encoding.
(Data represented by changes rather than levels)

26 26
NRZ

27 27
Note

In NRZ-L the level of the voltage


determines the value of the bit.
In NRZ-I the inversion
or the lack of inversion
determines the value of the bit.

4.28 28
NRZ Pros and Cons
Pros
 Easy to engineer.
 Makes good use of bandwidth.
Cons
 Presence of a dc component.
 Lack of synchronization capability.

Used for magnetic recording.


Not often used for signal transmission.
29 29
Multilevel Binary
 Use more than two levels.
 Bipolar-AMI.
• Zero represented by no line signal.
• One represented by positive or negative pulse.
• One pulses alternate in polarity.
• No loss of sync if a long string of ones happens
(zeros still a problem).
• No net dc component can use a transformer for
isolating transmission line.
• Lower bandwidth.
• Easy error detection. 30 30
Pseudoternary

 One represented by absence of line signal.


 Zero represented by alternating positive
and negative
 No advantage or disadvantage over bipolar-
AMI.

31 31
Bipolar-AMI and Pseudoternary

32 32
Trade Off for Multilevel Binary
 Not as efficient as NRZ.
• With multi-level binary coding, the line signal
may take on one of 3 levels, but each signal
element, which could represent log23 = 1.58
bits of information, bears only one bit of
information.
• Receiver must distinguish between three
levels
(+A, -A, 0).
• Requires approx. 3dB more signal power for
same probability of bit error.
33 33
Biphase
 Manchester.
• Transition in middle of each bit period.
• Transition serves as clock and data.
• Low to high represents one.
• High to low represents zero.
• Used by IEEE 802.3 (Ethernet).
 Differential Manchester.
• Mid-bit transition is for clocking only.
• Transition at start of a bit period represents zero.
• No transition at start of a bit period represents one.
• Note: this is a differential encoding scheme.
• Used by IEEE 802.5 (Token Ring).
34 34
Biphase Pros and Cons
Con.
1. At least one transition per bit time and possibly
two.
2. Maximum modulation rate is twice NRZ.
3. Requires more bandwidth.
Pros.
1. Synchronization on mid bit transition (self
clocking).
2. No dc component.
3. Error detection.
• Absence of expected transition points to error in
transmission. 35 35
Modulation Rate

36 36
Manchester Encoding
 Is a synchronous clock encoding technique used by
the OSI physical layer to encode the clock and data
of a synchronous bit stream.
 In this technique, the actual binary data to be
transmitted over the cable is not sent as a sequence
of logic 1's and 0's
 Instead, the bits are translated into a slightly
different format that has a number of advantages
over using straight binary encoding (i.e., NRZ)
 There is a transition at the middle of each bit period.
 A low-to-high transition represents a 1, and a high-
to-low transition represents a 0
37
 Manchester Encoding is used in Ethernet to send
data through the cable.
 It’s a digital signal scheme that helps to reduce
errors.
 Manchester Encoding is a form of State-
Transition Encoding.
 Basically, the actual changing of the state from a
signal, from a low (0 Volts) to a high voltage (+3
or +5 Volts) or from a high to low voltage.
 Manchester Encoding can also be classified as a
type of Biphase coding.

38
Applications
 Manchester Encoding is used in Ethernet
to send data through the cable.
 Manchester Encoding is used in a lot of
electronics besides Ethernet.
 It is also used in military communications
and data signaling.

39
A typical Manchester encoded signal

40
Conventions for data representation
 There are two opposing conventions for
the representation of data.
 The first of these was first published by G.
E. Thomas in 1949
– It specifies that for a 0 bit the signal levels will
be Low-High.
– with a low level in the first half of the bit
period, and a high level in the second half.
– For a 1 bit the signal levels will be High-Low.

41
 The second convention is followed by IEEE 802.4
(token bus) and lower speed versions of IEEE
802.3(Ethernet) standards.
• It states that a logic 0 is represented by a
High-Low signal sequence
• And a logic 1 is represented by a Low-High
signal sequence.
 If a Manchester encoded signal is inverted in
communication, it is transformed from one
convention to the other.
 This ambiguity can be overcome by using
Differential Manchester Encoding.

42
 Advantages
 Synchronization
• Because there is a predictable transition
during each bit time, the receiver can
synchronize on the transition.
• No dc component:
• Error detection: the absence of an expected
transition can be used to detect errors.
 Disadvantages
• Manchester coded signal consumes more
bandwidth than the original signal (in NRZ)
• The signal spectrum is much wider.

43
Example(s)
 The following diagram shows a typical
Manchester encoded signal with the
corresponding binary representation of the
data being sent.

44
Differential Manchester Encoding (DME)
– A method of encoding data in which data and
clock signals are combined to form a single
self-synchronizing data stream.
– A '1' bit is indicated by making the first half of
the signal, equal to the last half of the
previous bit's signal i.e.
• No transition at the start of the bit-time.
– A '0' bit is indicated by making the first half of
the signal opposite to the last half of the
previous bit's signal i.e.
• A zero bit is indicated by a transition at the
beginning of the bit-time.
45
 In the middle of the bit-time there is
always a transition, whether from high to
low, or low to high.
 Each bit transmitted means a voltage
change always occurs in the middle of the
bit-time to ensure clock synchronization.
 Token Ring uses DME.
– This is why a preamble is not required in
Token Ring, compared to Ethernet which uses
Manchester encoding.

continued46
Example of DME

47
Advantages
 Detecting transitions is often less error-
prone than comparing against a threshold
in a noisy environment.
 Because only the presence of a transition
is important, polarity is not.
Disadvantages
(Same as ME)

48
Scrambling Techniques
 Used to reduce signaling rate relative to the data
rate by replacing sequences that would produce
constant voltage for a period of time with a filling
sequence that accomplishes the following goals:
• Must produce enough transitions to maintain synchronization
• Must be recognized by receiver and replaced with original
data sequence is same length as original sequence.
 No dc component.
 No long sequences of zero level line signal.
 No reduction in data rate.
 Error detection capability.
 As an example, fax machines use the modified
Huffman code to accomplish this. 49 49
B8ZS
 Bipolar With 8 Zeros Substitution.
 Based on bipolar-AMI.
 If octet of all zeros and last voltage pulse
preceding was positive, encode as 000+-0-+.
 If octet of all zeros and last voltage pulse
preceding was negative, encode as 000-+0+-.
 Causes two violations of AMI code.
 This is unlikely to occur as a result of noise.
 Receiver detects and interprets the sequence
as octet of all zeros.

50 50
HDB3
 High Density Bipolar 3 Zeros.
 Based on bipolar-AMI.
 String of four zeros replaced with one or
two pulses.
Note: The following is the explanation for the HDB3 code example on the
next slide (see rules in Table 5.4, page 142):
Assuming that an odd number of 1's have occurred since the last substitution,
since the polarity of the preceding pulse is "-", then the first 4 zeros are
replaced by "000-". For the next 4 zeros, since there have been no Bipolar
pulses since the 1st substitution, then they are replaced by"+00+" since the
preceding pulse is a "-". For the 3rd case where 4 zeros happen, 2 (even)
Bipolar pulses have happened since the last substitution and the polarity of
the preceding pulse is "+", so "-00-" is substituted for the zeros.
51
B8ZS and HDB3

(Assume odd number of 1s


since last substitution)

52 Rules
See Table 5.4 for HDB3 Substitution 52
Q&A

“In life, always expect questions, but do not expect answers”

Data Communication And Computer networks bmuwonge@cit.ac.ug 53

You might also like