Skip to main content

Encode 111000... using B8ZS and HDB3

Short answer

Data 1110000000000000011, prior pulse negative. B8ZS replaces the first eight zeros with 000+-0-+, giving +-+000+-0-+000000-+. HDB3 uses 000V for first four zeros (odd pulses, V=+), then B00V twice (even): +-+000+-00-+00+00-+.

Encode 1110000000000000011 using B8ZS and HDB3 encoders.

Data (19 bits): 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 (three 1s, fourteen 0s, then two 1s). The pulse before the data is taken as negative, so the first 1 is +.

B8ZS

Eight consecutive zeros are replaced by 000VB0VB. The first three 1s give + - +. The first eight zeros become 0 0 0 + - 0 - + (V = + same as the last pulse, B = -, V = - same as B, B = +). The next six zeros remain 0. The last two 1s follow B (+), so they are - and +.

Data : 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
B8ZS : + - + 0 0 0 + - 0 - + 0 0 0 0 0 0 - +

HDB3

Four zeros are replaced by 000V (odd number of 1s since the last substitution) or B00V (even number).

  • The first three 1s give + - + (3 ones, odd).
  • First 0000: odd, so 000V; V takes the polarity of the last pulse (+): 0 0 0 +.
  • Second 0000: no 1s since the last substitution (count 0, even), so B00V; B is opposite to the last pulse (+), so B = - and V = -: - 0 0 -.
  • Third 0000: again even, so B00V: B = + and V = +: + 0 0 +.
  • The remaining two zeros stay 0 0.
  • The last two 1s follow the last pulse (+): - and +.
Data : 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
HDB3 : + - + 0 0 0 + - 0 0 - + 0 0 + 0 0 - +

Both codes remove the long run of zeros from the line signal, and the DC component stays zero because the violation pulses alternate in polarity.

✓ Answer checked by Claude Sonnet 5.5

All Data Communication chapter 5 questions →