---
title: "Encode 111000... using B8ZS and HDB3"
subject: "Data Communication"
chapter: 5
key: "semester_5/data_communication:hdb3-b8zs-encode-78b"
source: https://www.bctengineer.com/q/semester_5/data_communication/hdb3-b8zs-encode-78b
site: BCT Engineering
---

# Encode 111000... using B8ZS and HDB3

Data Communication · Chapter 5: Data Encoding and Modulation

- Asked in: 2078 Bhadra, 10 marks
- Video: [B8ZS AND HDB3(SCRAMBLING)TUTORIAL-1 BY-SHUBHAM KUMAR](https://www.youtube.com/watch?v=dJoFqocrJuo) — Learn it by Fun
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/data_communication/hdb3-b8zs-encode-78b
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-5

## Question

Encode 1110000000000000011 using B8ZS and HDB3 encoders.

## 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-+.

## Answer

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 +.

```text
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 +.

```text
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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. B8ZS replaces eight zeros with 000VB0VB. After first three 1s (+ - +), the pattern is:
   A. 0 0 0 - + 0 + -
   B. + - 0 0 0 - +
   C. 0 0 0 + - 0 - +
   D. 0 0 0 + + 0 - -
   Answer: C. V same as last pulse (+). (Key point: B8ZS)

2. First 0000 after three 1s in HDB3:
   A. B00V
   B. 000VB0VB
   C. Left unchanged
   D. 000V since odd count
   Answer: D. Three is odd. (Key point: HDB3 first)

3. The second 0000 uses B00V because:
   A. No 1s since last substitution (even)
   B. Odd count
   C. Always B00V
   D. Previous pulse negative
   Answer: A. Count 0. (Key point: HDB3 later)

4. DC stays zero because:
   A. All pulses positive
   B. Violation pulses alternate in polarity
   C. Zeros are removed
   D. Pulses double
   Answer: B. Alternation. (Key point: DC)

## Related in other subjects

- [Line coding 100000000001101 with HDB3 and B8ZS](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aline-codes-polarrz-diffmanch-hdb3-b8zs) — Communication Systems, chapter 6
- [Line coding 110011000001 (unipolar RZ, Manchester, HDB3)](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aline-codes-110011000001) — Communication Systems, chapter 6
