Coding binary bits

It's not just low for 0 and high for 1. It's a sequence of 0's and 1's.

Jitter happens. How do you tell 1,000,000 0's from 1,000,001 0's? Really accurate clocks? Phased-locked loops? Run-length limited coding? Synchronous data transmission?

Is DC balance also a concern?

A non-solution and some simple solutions

Bit stuffing

In NRZ encoding, bit stuffing requires that a 0 be inserted after n consecutive 1's. The receiver will discard the extra 0. USB uses bit stuffing where n is 6.

In bit stuffing the numbers of bytes transmitted per second depends slightly on the data being transmitted.

Code groups

In the nb/mb code protocols, n bits are transmitted in m clock cycles. The encoding is chosen to ensure a sufficient frequency of bit transitions and to avoid DC balance.

8b/10b is used in some Ethernet, Firewire, and USB implementatins.