Long runs of zeros in AMI
The suppresses the DC component when binary 1s use alternating positive and negative pulses. A long, uninterrupted sequence of zeros () produces a constant zero-voltage interval.
The receiver uses signal transitions to align its clock with the transmitter timing. During a zero-voltage run, the absence of transitions can increase timing error. HDB3 replaces selected runs of zeros with bipolar pulses while preserving the AMI balance rule.
HDB3: high-density bipolar code with a three-zero limit
HDB3 is a modified AMI code specified by ITU-T G.703 for the 2048 kbit/s interface used in systems. It represents ordinary binary 1s with alternating pulses and applies substitutions to runs of four zeros. The recommendation defines the signal as pseudo-ternary: zeros remain zero outside substitution blocks, while 1s alternate as positive and negative marks.
- High-density bipolar: It uses +V, 0, and -V, with substitution rules for runs of zeros.
- Three-zero limit: A substitution prevents more than three consecutive zero symbols in the output signal.
Outside a four-zero run, HDB3 follows AMI. The substitution determines the inserted B pulse and the AMI violation V.
HDB3 substitution rules
When the encoder encounters four consecutive zeros (), it replaces the block with one of two four-symbol patterns: 000V or B00V. The fourth symbol is always V, so the decoder can identify the replacement and restore four zeros.
The B and V pulses
- V (Violation) pulse: This non-zero pulse (+V or -V) breaks the alternating polarity rule of AMI. A V pulse has the same polarity as the immediately preceding non-zero pulse. The decoder recognizes it as part of a zero substitution.
- B (Bipolar) pulse: This non-zero pulse (+V or -V) substitutes for the first zero in the sequence. The B pulse follows the alternating polarity rule of AMI and contributes to the balance used to select substitutions.
Choosing a substitution to limit DC
The encoder selects 000V or B00V so consecutive V pulses have alternating polarities. The HDB3 rule keeps the number of B pulses between consecutive violations odd.
The rule: After an earlier V, the encoder tracks the parity of the regular non-zero pulses before the next zero block. An odd count selects 000V; an even count selects B00V. The first block also depends on the encoder's initial substitution state; this example assumes 000V. The inserted B pulse keeps the number of pulses between successive V pulses odd.
Odd count
The sequence is replaced with 000V. The V pulse violates the AMI rule by repeating the polarity of the last non-zero pulse.
Even count
The sequence is replaced with B00V. The B pulse follows the AMI rule, and the V pulse repeats the B polarity.
HDB3 example: step by step
Encode the following binary stream:
- Input : Last pulse was none. Start with . The initial polarity is a convention; reversing it reverses every non-zero symbol without changing the decoded bits.
Encoded:+ - Input : No substitution needed.
Encoded:+ 0 - Input : Last pulse was . Alternate to .
Encoded:+ 0 - - Input : Apply the first substitution.
Initial block convention: use the pattern , which ends in .
The previous non-zero pulse is .
The violation repeats that polarity.
Encoded:+ 0 - 0 0 0 - - Input : Last pulse was , which had polarity. Alternate to .
Encoded:+ 0 - 0 0 0 - + - Input : Last pulse was . Alternate to .
Encoded:+ 0 - 0 0 0 - + - - Input : Another substitution.
Count since the last substitution (): the previous has negative polarity, followed by 2 regular pulses ( and ).
This is an EVEN number.
Pattern: use . The pulse alternates from the last pulse ; therefore is .
The polarity repeats , so is .
Encoded:+ 0 - 0 0 0 - + - + 0 0 +
Final encoded signal: + 0 - 0 0 0 - + - + 0 0 +