2
\$\begingroup\$

I was going through SATA3 spec. As per the spec, both scrambler and 8b/10b encoder are used in its design. Scrambler helps randomizing the data while 8b/10 encoder creates enough transition for DC balance and clock data recovery.

My doubt is that if the scrambler randomizes the data, then it should solve the purpose of DC balance and clock data recovery, because transitions of '1' and '0' are being created by the scrambler. What is the need for 8b/10b encoder then?

\$\endgroup\$
4
  • \$\begingroup\$ @HervéGrabas Ok I understand your point. But let's assume a scenario in which we don't need to maintain DC balance. In that case would a scrambler be enough? Because this time we only need to create enough transition on line for clock data recovery and no need to maintain DC balance. \$\endgroup\$ Commented Apr 28, 2017 at 10:24
  • 2
    \$\begingroup\$ Scrambling a long series of 1s would produce a mixture of 1s and 0s. But by the same token there are sequences of 1s and 0s that, when scrambled, produce a long series of 1s. \$\endgroup\$
    – Finbarr
    Commented Apr 28, 2017 at 10:27
  • 2
    \$\begingroup\$ @HervéGrabas, statistically not true, streams of all-1's or all-0's long enough to cause a problem come up incredibly rarely. Newest PCIe, Ethernet and USB use 64b/66b, 128b/130b and 128b/132b encoding. Those encodings use scrambling only to add transitions and near-DC balance into their bitstream. Take a look into their specs and at these encodings. The 8b/10b 'look-up table' style has gone. \$\endgroup\$
    – TonyM
    Commented Apr 28, 2017 at 10:46
  • 1
    \$\begingroup\$ Hi @HervéGrabas, again please look at specs/info, I can't copy them into a succession of comments as you ask me :-) 64b/66b aren't just the 8b/10b ideas but longer. They're completely different, using a 2..4-bit marker and then XORing rest of bits with LFSR. You're dead right that scrambling is pointless if you're going to 8b/10b. I haven't looked at SATA3 so can't comment on the question. Anyway, have a look into it, let me know what you concluded from looking if you like. \$\endgroup\$
    – TonyM
    Commented Apr 28, 2017 at 11:07

2 Answers 2

1
\$\begingroup\$

I'm discussing this based on my knowledge of Ethernet, rather than SATA. I don't know the SATA standard, but if it uses LFSR scrambling and 8b10b or 64b66b encoding, it should have the same benefits there that it does in Ethernet.

8b10b or 64b66b encoding provide two features that aren't available from simple scrambling:

block boundaries The encoding introduces block boundaries that allow synchronization between the transmitter and receiver. Without these boundaries, the receiver wouldn't know where one octet ends and the next one begins, much less where are the boundaries between frames or packets in higher level protocols.

error detection The encoding allows detecting any single bit error in a frame, and statistically may detect multiple-bit errors. This allows the protocol to react appropriately when an errored block is received.

\$\endgroup\$
4
  • \$\begingroup\$ Ok, I didn't know of this two features provided by encoders. I have further doubts:- 1) Although encoding does introduce block boundaries. But is it needed if we send COMMA characters and the receiver has a word aligner logic implemented. In that case we wouldn't need an encoder to introduce block boundaries, right? 2) In most of the protocols we send CRC for error detection. I studied that the decoders can detect errors whenever a non-detectable bitpattern arrives to the detector. But what if the CRC does the job of detecting error. In that case, is the encoder still required? \$\endgroup\$ Commented Apr 29, 2017 at 5:17
  • \$\begingroup\$ In the protocols I'm familiar with, the COMMA character is a feature of the encoding. For example, the COMMA in 8b10b encoding is 111 11100. If you don't have encoding, how do you tell the difference between a COMMA and ordinary data that happens to have the same bit pattern? \$\endgroup\$
    – The Photon
    Commented Apr 29, 2017 at 5:20
  • \$\begingroup\$ As for CRC, AFAIK that's mainly done at higher protocol layers, and on larger blocks of data. That means a longer latency before an error is detected. Having an error detection mechanism in the PCS framing (as it's called in Ethernet) means a chance to detect errors every 64 data bits that go by. \$\endgroup\$
    – The Photon
    Commented Apr 29, 2017 at 5:29
  • \$\begingroup\$ Ok. Thanks for the detailed explanation. Cleared up a lot of doubts. \$\endgroup\$ Commented Apr 29, 2017 at 5:43
0
\$\begingroup\$

Some communications protocols send each octet of data using eight data bits plus some framing bits. When sending data via typical async protocol, there may be up to nine consecutive "0" bits and an arbitrary number of consecutive "1" bits. A simple scrambler can map ten bits of which the first two are guaranteed to be 10, into ten bits which are guaranteed not to have more than about six consecutive matching values.

Using a more complicated 8b/10b encoder will make it possible to reduce the worst-case number of consecutive matching bits further than would be possible using a simple scrambler, and also offer guarantees about line balancing (ensuring that the total numbers of zeroes and ones transmitted stay close to each other). Gaining these benefits requires more complicated circuitry, and also requires giving up some of the timing flexibility that had been offered by an async protocol. For example, an async protocol could deliver 100 bytes over 1100 bit times, at a continuous "smooth" rate of one byte every eleven bit times. Using an 8b/10b encoding, it would be necessary to send out a byte, then an idle character, then ten bytes, then another idle character, etc. For many purposes that wouldn't matter, but for some purposes it might. If an async receiver were wired to a DAC that immediately output each sample as it was received, passing the signal through a bit synchronizer and scramble would add 0.5 bit times of jitter. Passing it through an 8b/10b encoder would add 5 bit times of jitter.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.