CS With NehalCS With Nehal

Digital Signal Encoder & Scrambling Visualizer

Turn a bit string into a signal with NRZ-L, NRZ-I, Manchester, AMI, MLT-3 and more, then scramble it with B8ZS or HDB3.

Custom Binary Input

Type a bit string using only 0 and 1. Every other tab in the lab works from this sequence.

19
Total bits
6
Number of 1s
13
Number of 0s

About This Simulation

This signal encoder turns a bit string into a digital signal using line coding schemes such as NRZ-L, NRZ-I, Manchester, AMI and MLT-3, then shows how B8ZS and HDB3 scrambling replace long runs of zeros.

Features

  • Type any bit string
  • NRZ-L, NRZ-I, Manchester, Differential Manchester, AMI, MLT-3 and more
  • B8ZS and HDB3 scrambling with substitutions highlighted
  • Waveforms drawn bit by bit
  • Theory section and practice challenges

Topics covered

  • Line Coding
  • NRZ-L and NRZ-I
  • Manchester Encoding
  • AMI and MLT-3
  • B8ZS and HDB3 Scrambling
  • Synchronisation and DC Component

Explanation

Line coding converts binary data into a signal that can be sent over a wire. Different schemes trade off bandwidth, synchronisation and DC balance. Scrambling replaces long strings of zeros with special patterns so the receiver does not lose synchronisation.

How it works

  1. NRZ-L: the voltage level directly represents the bit (for example, high for 0 and low for 1).
  2. NRZ-I: a 1 inverts the current level and a 0 keeps it.
  3. Manchester: every bit has a transition in the middle (for example, low-to-high for 1 and high-to-low for 0), which gives built-in clock recovery.
  4. AMI: 0 is zero voltage and each 1 alternates between positive and negative, removing the DC component.
  5. B8ZS replaces eight zeros with 000VB0VB, and HDB3 replaces four zeros with 000V or B00V, using deliberate bipolar violations the receiver recognises.

Why it matters

Line coding is how bits are physically sent in Ethernet, T1/E1 lines and other links. Drawing waveforms for a given bit string is a common question in data communications and networking courses.

Frequently Asked Questions

What is the difference between NRZ-L and NRZ-I?

In NRZ-L the signal level represents the bit value. In NRZ-I a 1 causes a change in level and a 0 causes no change, so the information is in the transitions.

Why is Manchester encoding self-synchronising?

Every bit has a transition in the middle, so the receiver can recover the clock from the signal itself. The cost is that it needs twice the bandwidth of NRZ.

Why are B8ZS and HDB3 used?

In AMI, a long run of zeros produces a flat signal and the receiver can lose synchronisation. B8ZS (8 zeros) and HDB3 (4 zeros) replace those runs with patterns containing bipolar violations, which the receiver converts back to zeros.

What is a bipolar violation?

Two consecutive non-zero pulses with the same polarity. Normal AMI never does this, so scrambling uses violations to mark substituted patterns.

Related Simulations

Acknowledgements

The Person Behind This Simulation

This simulation would not have been possible without his valuable contributions and support. We sincerely appreciate his time, effort, and dedication to the project.

Arshad Ahmed Ayon

Arshad Ahmed Ayon

  • 3rd Year CS Undergraduate Student | BRAC University