Scrambling
B8ZS & HDB3
Lecturer: Alia Umrani
Data Encoding
• Multilevel encoding analysis
• Manchester/Differential Manchester
encodings
• Analysis of Manchester/Diff Manchester
encodings
• Signal rate and bit rate
• Scrambling
Encoding Concepts
1. Unipolar: Unipolar signal elements are either all positive or all zeros.
2. Polar: One logic state represented by a positive voltage the other by a
negative voltage.
3. Data signaling rate: Rate of data transmission in bits per second
4. Duration or length of a bit: The time taken for the transmitter to emit a bit
Encoding Concepts
1. Encoding maps digital data to signal elements. Decoding does the opposite.
2. Several encoding schemes are currently in use.
3. They may be evaluated using the following criteria:
• Signal spectrum Clocking
• Noise immunity Error detection
• Cost and complexity
Signal Spectrum
1. Ideally, an encoded signal should display the following characteristics:
• Fewer high-frequency signal components require less bandwidth for
transmission.
2. Absence of a direct-current component is also desirable.
• A DC component to the signal requires direct physical attachment of
transmission components.
• Without a DC component, AC coupling via a transformer is possible; this
gives good electrical isolation, reducing interference.
3. Signal power should be concentrated in the middle of the transmission
bandwidth (mid-range frequencies).
Signal Timing/Clocking
The determination of the beginning and end of each bit position
1. One approach is to provide a separate clock line/channel to synchronise
the transmitter/receiver
2. An alternative is to provide a synchronisation mechanism that is based on
the transmitted signal
• The transmitted signal contains the data as well as the clock timing
Error Detection
• Already provided for by a layer of logic above the signaling level known as
data link layer.
• However, it is useful to have some error detection capability built into the
signal encoding scheme.
• Permits faster error detection
Noise Immunity
• Encoding schemes differ in their ability to perform in the presence of noise
• Measured in the bit error rate.
Cost & Complexity
• Despite falling prices, cost is still an issue
• Typically, the higher the signaling rate to achieve a given data rate, the
greater the cost.
• Encoding schemes can require a signalling rate that is greater than the
actual data rate
Encoding Schemes
• Nonreturn to Zero
• Nonreturn to Zero Inverted (NRZI)
• Bipolar – AMI
• Pseudoternary
• Manchester
• Differential
• Manchester
Non Return to Zero (NRZ)
• A simple approach is to use two different voltage levels for the two binary
digits
• The voltage level is constant during a bit interval. No transition (no return to
a zero voltage level).
• For example, the absence of voltage can be used to represent binary 0, with
a constant positive voltage used to represent binary 1.
• More commonly, a negative voltage is used to represent one binary value
and a positive voltage is used to represent the other.
NRZ Inverted (NRZI)
• A variation of NRZ (Nonreturn to zero inverted on ones)
• As with NRZ-L, NRZI maintains a constant voltage pulse for the duration of a
bit time.
• The data are encoded as the presence or absence of a signal transition at
the beginning of the bit time
• A transition (low-to-high or high-to-low) at the beginning of a bit time
denotes a binary 1 for the duration of the bit time
• No transition indicates a binary 0.
NRZ & NRZI
Advantages/
Disadvantages of
Advantages
• Easy to engineer NRZ/NRZI
• Makes good use of bandwidth
Disadvantages
• dc component
• Lack of synchronization capability
• Constant voltage can be held over a long time Period
1. Timing: Loss of synchronization
2. Used in magnetic recording
3. Not often used for signal transmission
Differential Encoding
• NRZI is an example of a differential encoding.
• The signal is decoded by comparing adjacent signal elements rather than
determining the absolute value of a signal element.
• Good noise immunity. Tends to be more reliable to detect a transition rather
than an absolute value in the presence of noise
• Doesn't lose sense of polarity, as polarity is relative to adjacent signals
Multilevel Encoding
• Multilevel-binary encoding addresses some of the deficiencies of NRZ by
using more than two levels
• Bipolar-AMI (AMI = Alternate Mark Inversion)
1. Zero represented by no line signal
2. One represented by positive or negative pulse
3. The binary 1 pulses must alternate in polarity
Multilevel Encoding
Multilevel Encoding Advantages
• No loss of synchronisation with a long sequence of ones
• Each 1 introduces a transition. The receiver can resynchronize on
the transition
• A long sequence of 0s is still a problem
• Because the 1 signals alternate in voltage from positive to negative, there is
no net DC component.
• The bandwidth required is considerably less than the bandwidth for NRZ.
• The pulse-alternation property provides a simple means of error detection.
• An isolated error that deletes a pulse or adds a pulse causes a violation of
this property.
Pseudoternary Encoding
• The comments of the previous paragraph also apply to pseudoternary.
• Digital one is represented by the absence of a line signal.
• Zero represented by alternating positive and negative pulses.
• No particular advantage or disadvantage in relation to bipolar-AMI
Multilevel Encodings
Multilevel Encoding Analysis
Address some of the limitations of NRZ encodings but:
• Multilevel is not as efficient as NRZ
• Each signal element only represents one bit In a 3 level system
could represent
log2 3 = 1.58 bits
• Receiver must distinguish between three levels
(+A, -A, 0)
• Requires approx. 3dB more signal power for same probability of a bit error
Manchester Encoding
• Manchester and Differential Manchester are bi- phase encoding
techniques
• Two signals. Two phases. Clock and data combine to form the encoded
signal
• They address the limitations(eg. Clocking, dc component) of NRZ
encodings
• Transition every bit time
• Signal contains clock and data
• Circuitry to extract clock and data from signal
Manchester
Encoding
Manchester Encoding
Manchester 0 == from low to high at middle of bit period
> from high to low at middle of bit period
1 ==
with alignment at start of period
>
Manchester Encoding
Manchester Encoding
Manchester Encoding (As
IEEE802.3)
Data XOR Clock = Manchester
0 0 0
0 1 1
1 0 1
1 1 0
Manchester Encoding
• Transition in middle of each bit period Transition serves as clock and
data
• Encoding based on simple XOR operation Low to high represents one
• High to low represents zero
• Used by IEEE 802.3 (Ethernet LAN)
Differential Manchester
• Unlike Manchester, the mid-bit transition is used only to provide clocking.
• The encoding of a 0 is represented by the presence of a transition at the
beginning of a bit time.
• A 1 is represented by the absence of a transition at the beginning of a bit
time.
• Differential Manchester has the added advantage of employing differential
encoding.
• Used by IEEE 802.5 (Token Ring)
Differential Manchester
0 Transition
1 No Transition
Manchester/Differential
Manchester Advantages
Advantages
• Synchronization on mid bit transition (self clocking)
• Biphase codes have no dc component
• The absence of an expected transition can be used to detect
errors. Noise on the line would have to invert the signal before and
after the expected transition to cause an undetected error.
Differential Manchester Encoding
Manchester/Differential
Manchester Disadvantages
Disadvantages
• All of the biphase techniques require at least one transition per
bit time and may have as many as two transitions.
• Thus, the modulation rate is twice that for NRZ
• The bandwidth required is correspondingly greater.
Signalling Rate
Distinction between bit rate and signal rate
• The bit rate is 1/Bit-time in bits per second
• The signal rate or modulation rate is the rate at which signal elements
are generated
• Manchester encoding: The minimum size signal element is a pulse of
one-half the duration of a bit interval.
Signalling Rate
Long Distance Transmissions
• Manchester and Differential Manchester not suitable for long distance
signalling
• Not efficient. High signalling rate relative to the data rate
• Another approach is to adapt Bi-Polar AMI to avoid long
• sequences of 1s or 0s which result in a loss of synchronisation
• Known as scrambling
Scrambling
A simple scrambling scheme:
• A sequence that would result in a constant voltage level on the line is replaced
by a filling sequences with sufficient transitions for the receiver's clock to
maintain synchronization.
• The filling sequence must be recognizable by the receiver and replaced with the
original data sequence.
• The filling sequence is the same length as the original sequence, so there is no
data-rate increase.
Scrambling
After scrambling:
• No long sequences of zero-level line signals No reduction in data rate
• Error-detection capability
Scrambling
Two commonly used techniques:
B8ZS Bi-polar with 8 zeros substitution
North America
Based on bi-polar AMI
HDB3 High Density bi-polar 3 zeros
Europe and Japan Based on AMI
B8ZS
• Problem with AMI code is that a long string of zeros may result in loss of
synchronization.
To overcome this, the B8ZS encoding is amended with the following rules:
• If an octet of all zeros occurs and the last voltage pulse preceding this octet
was positive, then the eight zeros of the octet are encoded as 000+-0-+
• If an octet of all zeros occurs and the last voltage pulse preceding this octet
was negative, then the eight zeros of the octet are encoded as 000-+0+-
B8ZS
• This technique forces two code violations
• A violation is a signal pattern that is not allowed in AMI
• Violation pattern is unlikely to be caused by noise or other transmission
impairment.
• The receiver recognizes the pattern and interprets the octet as consisting of all
zeros
B8ZS
B8ZS
HDB3
• The HDB3 scheme replaces strings of four zeros with sequences containing one
or two pulses.
• In each case, the fourth zero is replaced with a code violation.
• In addition, a rule is needed to ensure that successive violations are of
alternate polarity so that no dc component is introduced.
• Therefore, if the last violation was positive, this violation is negative, and vice
versa
HDB3
• Every time there are 4 consecutive zeros in the code they will be replaced by
either 000−, 000+, +00+ or −00−.
• To determine which pattern to use, one must count the number of pluses (+)
and minuses (−) since the last violation bit V. if the count is odd then 000− or
000+ is used. If even then +00+ or −00− is used.
• To determine which polarity to use, check pulse preceding the four zeros. If
000V form must be used then V simply copies the polarity of last pulse, if B00V
form must be used then B and V chosen will have the opposite polarity of the
last pulse.
HDB3 Scrambling
HDB3 Scrambling Substitution
Rules
Questions 1
1. With the aid of a diagram, outline the
characteristics of NRZ encoding schemes.
2. State two advantages of NRZ encoding
3. Why is Manchester encoding unsuited to long
range transmissions?
4. Explain how bipolar AMI improves on NRZ
encoding schemes.
5. Discuss how the performance of encoding
schemes for use in data communications
may be compared.
Questions 2
1. Explain, with the help of a diagram, how the
Manchester encoding scheme encodes
data to be transmitted. Use the bitstream
10011101 as an example.
2. Outline the key differences between
Manchester and differential Manchester
encoding.
3. Explain clearly how the data and clock signal
are
extracted from Manchester encoded data.
4. What is the purpose of scrambling?
5. Describe one scrambling scheme