Past exam question: 2078 Bhadra, Q4
Open in the Padhaiko appEncode 111000000000000011 using B8ZS and HDB3 encoders.
Solution
Input Data Stream Analysis: The input binary sequence is:
Length = 18 bits. Notice the data contains three leading 1s, followed by thirteen consecutive zeros (0s), followed by two trailing 1s. Let us assume the initial pulse polarity before this bitstream was negative (), so the first 1 receives a positive pulse (). Under standard Bipolar AMI:
- Bits 1, 2, 3 (
1 1 1): transmit with alternating polarities: , , . - Next are 13 consecutive zeros.
Encoding with B8ZS (Bipolar 8-Zero Substitution): B8ZS rule (used in North American T1 carriers):
- Whenever a block of 8 consecutive zeros occurs (
00000000), it is replaced by the substitution code:
where represents a Violation (a pulse of the same polarity as the preceding pulse) and represents a Bipolar pulse (a pulse alternating in polarity according to normal AMI rules).
- Here we have 13 consecutive zeros:
- First 8 zeros (zeros 1 to 8): replaced by .
- Remaining 5 zeros (zeros 9 to 13): cannot form an 8-zero block, so they are transmitted as 5 ordinary AMI zeros ().
Tracing pulse polarities:
- Bit 1 (
1): - Bit 2 (
1): - Bit 3 (
1): <-- Last pulse before 8-zero block is - First 8-zero block (
00000000):- 3 zeros:
- Violation : (same as last pulse )
- Bipolar : (alternates from )
- 1 zero:
- Violation : (same as previous pulse )
- Bipolar : (alternates from ) Result of substitution:
- Remaining 5 zeros:
- Bit 17 (
1): (alternates from the last pulse, which was from ) - Bit 18 (
1): (alternates from )
Complete B8ZS pulse sequence:
Encoding with HDB3 (High Density Bipolar 3-Zero): HDB3 rule (used in European E1 carriers):
- Replaces any block of 4 consecutive zeros (
0000) with either:- if the number of nonzero pulses () since the last violation is odd.
- if the number of nonzero pulses () since the last violation is even. Here must violate AMI rules (same polarity as last pulse), and successive s must alternate in polarity to prevent DC buildup.
In our sequence, the 13 consecutive zeros form:
- Block 1 (zeros 1-4)
- Block 2 (zeros 5-8)
- Block 3 (zeros 9-12)
- Zero 13 (single zero, transmitted as )
Step-by-step trace:
- Bits 1, 2, 3 (
1 1 1): , , .- Last pulse = .
- Pulses since last substitution = 3 (odd).
- First 4-zero block (zeros 1-4):
- Count is odd substitution is .
- Last pulse was , so .
- Block output: .
- Last pulse is now .
- Second 4-zero block (zeros 5-8):
- Pulses since last violation = 0 (even).
- Count is even substitution is .
- alternates from previous pulse () .
- has same polarity as .
- Block output: .
- Last pulse is now .
- Third 4-zero block (zeros 9-12):
- Pulses since last violation = 0 (even).
- Count is even substitution is .
- alternates from previous pulse () .
- has same polarity as .
- Block output: .
- Last pulse is now .
- Bit 16 (13th zero): Transmitted as .
- Bit 17 (
1): Normal AMI pulse alternating from last non-zero pulse () . - Bit 18 (
1): Normal AMI pulse alternating from .
Complete HDB3 pulse sequence:
For bitstream 111000000000000011 (assuming preceding pulse negative):
- B8ZS Encoded Sequence:
- HDB3 Encoded Sequence: