Learn more about Russian war crimes in Ukraine.

How does differential signaling work in USB?

The job of those data wires is to transfer a single signal (the “serial” in USB). This means USB is “half-duplex”: at any given time, one end of the cable is the sender, and the other end the receiver.

How do those data wires work? First let’s consider how they don’t work: via “single-ended signaling”. This uses just a single data wire, as well as a ground wire. The data wire carries a varying voltage (i.e., varying compared to the ground), and the voltage is interpreted as the value of the signal.

A problem with single-ended signaling is electromagnetic interference. The interference adds noise to the voltage on the data wire.

For this reason, USB does not use the single-ended method. Instead it uses “differential signaling”. Differential signaling transmits two signals, D+ and D-, using the single-ended encoding. The output signal is then the difference, S = D+ - D-. The insight here is that interference will usually affect both wires D+ and D- in the same way, and so by subtracting the two noisy wires, we cancel out the noise.

In USB, the signal is digital: either a 1 or a 0. The receiver calculates S, then interprets a positive S as a 1, and a negative S as a 0. Thus, the sender can send a 1 by setting D+ greater than D-, or conversely, send a 0 by setting D+ less than D-.

In practice, the sender chooses voltages with enough differential that it is unlikely to be “flipped” by electromagnetic noise. The differential applied is 2.5V, by setting one line to 0.3V and the other to 2.8V.

Also, in practice, the receiver is a bit more picky: if -200mV < S < 200mV, it considers the signal to be neither a 0 nor a 1; it’s too close to distinguish.

What can computers do? What are the limits of mathematics? And just how busy can a busy beaver be? This year, I’m writing Busy Beavers, a unique interactive book on computability theory. You and I will take a practical and modern approach to answering these questions — or at least learning why some questions are unanswerable!

It’s only $19, and you can get 50% off if you find the discount code ... Not quite. Hackers use the console!

After months of secret toil, I and Andrew Carr released Everyday Data Science, a unique interactive online course! You’ll make the perfect glass of lemonade using Thompson sampling. You’ll lose weight with differential equations. And you might just qualify for the Olympics with a bit of statistics!

It’s $29, but you can get 50% off if you find the discount code ... Not quite. Hackers use the console!

More by Jim

Tagged . All content copyright James Fisher 2017. This post is not associated with my employer. Found an error? Edit this page.