---
title: "HDB3 (HD3S) line coding"
subject: "Data Communication"
chapter: 5
key: "semester_5/data_communication:hdb3-coding"
source: https://www.bctengineer.com/q/semester_5/data_communication/hdb3-coding
site: BCT Engineering
---

# HDB3 (HD3S) line coding

Data Communication · Chapter 5: Data Encoding and Modulation

- Asked in: 2075 Chaitra, 4 marks; 2074 Asoj, 5 marks (asked 2 times)
- 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-coding
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-5

## Question

Explain High Density 3-zero substitution (HDB3 / HD3S) line coding with example.

## Short answer

HDB3 replaces four consecutive zeros with 000V (if pulses since last substitution are odd) or B00V (if even). V is a violation with same polarity as prior pulse, B is normal alternating pulse. For data 1010000000011 with prior pulse negative, the two four-zero groups are encoded as +00+ and -00-, yielding +0-+00+-00-+-.

## Answer

**HDB3 (High Density Bipolar 3-zeros)**, also called HD3S, is a scrambling technique on bipolar AMI used in Europe and Japan (E1 lines). It limits the string of zeros to three, so the receiver keeps its clock.

#### Rule
AMI coding is used as normal. Each group of **four consecutive zeros** is replaced by **000V** or **B00V**:
- **V** is a violation pulse with the same polarity as the previous pulse.
- **B** is a normal alternating pulse (opposite to the previous pulse, so V then has the same polarity as B).

Choose the substitution from the number of 1s (pulses) since the last substitution:

| Pulses since last substitution | Substitution | Reason |
|---|---|---|
| Odd | 000V | V has the correct polarity to keep the DC level zero |
| Even | B00V | B balances the DC level |

The violation pulses alternate in polarity, so the DC component is zero.

#### Example
Data: 1 0 1 0 0 0 0 0 0 0 0 1 1 (the pulse before the data is taken as negative, so the first 1 is +).

```text
Data : 1 0 1 0 0 0 0 0 0 0 0 1 1
HDB3 : + 0 - + 0 0 + - 0 0 - + -
```
Working:
- The two 1s give + and - (two 1s so far, an even count).
- First 0000: even count, so B00V. B is opposite to the last pulse (-), so B = +, and V = + (same as B): + 0 0 +.
- Second 0000: no 1s since the last substitution (count 0, even), so B00V again. B is opposite to the last pulse (+), so B = -, V = -: - 0 0 -.
- The last two 1s follow the last pulse (-): + then -.

Each V has the same polarity as the pulse before it, so the receiver recognises the violation and restores the four zeros.

## Check yourself

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

1. HDB3 replaces four zeros with:
   A. 000VB0VB
   B. 0V0V
   C. BB00
   D. 000V or B00V
   Answer: D. Four zeros. (Key point: Substitution)

2. If the number of pulses since last substitution is odd:
   A. Use B00V
   B. Do nothing
   C. Use 000V
   D. Use 000VB0VB
   Answer: C. V keeps DC zero. (Key point: Odd)

3. HDB3 is used in:
   A. North America T1
   B. Europe and Japan (E1)
   C. USA only
   D. Ethernet
   Answer: B. B8ZS is T1. (Key point: Region)

4. Data 1 0 1 then 0000, previous pulse negative, first 1 +: first substitution is:
   A. 000V as 0 0 0 -
   B. B00V as - 0 0 -
   C. B00V as + 0 0 +
   D. 000V as 0 0 0 +
   Answer: C. Two 1s is even, so B00V; last pulse is - so B = + and V = +. (Key point: Example)

## Related in Data Communication

- [B8ZS line coding](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ab8zs-coding) — Data Communication, chapter 5, asked 2×
- [Line coding waveforms for 1101110111](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aline-coding-1101110111) — Data Communication, chapter 5
- [Line coding: polar RZ and bipolar AMI](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aline-coding-polar-rz-ami) — Data Communication, chapter 5
- [Line coding: properties; encode 01001100011](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aline-coding-01001100011) — Data Communication, chapter 5
- [List digital-to-digital line coding techniques](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aline-coding-techniques-list) — Data Communication, chapter 5

## 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
- [Line coding and NRZ, RZ, AMI](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Aline-coding-nrz-rz-ami) — Telecommunications, chapter 3
- [Line coding in PCM and the right technique](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Aline-coding-pcm-solution) — Telecommunications, chapter 3
