Coding

HDB3 Code

High-Density Bipolar 3-zero code, an enhancement of AMI that avoids long zero sequences.

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 (000000...000000...) 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 E1E1 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 (00000000), 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 B00VB00V 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 00000000 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 00000000 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: 10100001100001010000110000

  1. Input 11: 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: +
  2. Input 00: No substitution needed.
    Encoded: + 0
  3. Input 11: Last pulse was ++. Alternate to −-.
    Encoded: + 0 -
  4. Input 00000000: Apply the first substitution.
    Initial block convention: use the pattern 000V000V, which ends in VV.
    The previous non-zero pulse is −-.
    The violation repeats that polarity.
    Encoded: + 0 - 0 0 0 -
  5. Input 11: Last pulse was VV, which had −- polarity. Alternate to ++.
    Encoded: + 0 - 0 0 0 - +
  6. Input 11: Last pulse was ++. Alternate to −-.
    Encoded: + 0 - 0 0 0 - + -
  7. Input 00000000: Another substitution.
    Count since the last substitution (000V000V): the previous VV has negative polarity, followed by 2 regular pulses (++ and −-).
    This is an EVEN number.
    Pattern: use B00VB00V. The BB pulse alternates from the last pulse −-; therefore BB is ++.
    The VV polarity repeats BB, so VV is ++.
    Encoded: + 0 - 0 0 0 - + - + 0 0 +

Final encoded signal: + 0 - 0 0 0 - + - + 0 0 +

Related articles