8b 10b Encode Decode

download 8b 10b Encode Decode

of 5

Transcript of 8b 10b Encode Decode

  • 7/31/2019 8b 10b Encode Decode

    1/5

    Encoder / Decoder

    Introduction

    It is useful to be able to guarantee certain characteristics about theinformation that gets sent across the serial link. These are specificproperties that are desirable:

    Large transition density The greater the transition density, themore chances there are for the receiver to synchronize to thedata. With many transitions, a receiver can implement a votingscheme and synchronize with a greater accuracy.

    Minimum transition density Besides having a high averagetransition density, it is useful to guarantee that every wordtransmitted on the serial link contains a minimum number oftransitions.

    Error detection Although error detection must also beimplemented on a higher level, it can be useful to have a schemethat is able to detect certain types of errors in the physical layer ofthe link.

    Predefined comma characters Out-of-band characters areuseful for transmitting metadata and for synchronizationpurposes. A useful comma sequence must be singular (that is, itmust not appear in any sequence of valid data bits, includingoverlapped data characters), and must occur with a uniformalignment relative to byte boundaries.

    To guarantee these characteristics, an encoder/decoder is used. Theencoder takes in incoming data along with some metadata (such as asignal that indicates whether the incoming data represents actual dataor control characters) and produces an encoded value which is thentransmitted on the link. Similarly, the decoder takes the values from thelink and produces the original value, along with some information suchas whether the incoming character contains any errors, and whether itrepresents a data or control character.

    After examining some alternatives, the IBM 8B/10B encoding scheme[Wid83] was chosen as the encoding scheme to be used. The IBM8B/10B encoding scheme exhibits all the desired behaviors. Itguarantees a maximum run length of 5 bits; the lowest transitiondensity that can be indefinitely maintained under the encoding schemeis 30 transitions per 100 bits; it can detect all single-bit and many othererrors; it contains three different comma characters. The encodingscheme also exhibits some interesting characteristics that are not

  • 7/31/2019 8b 10b Encode Decode

    2/5

    especially useful in this application. These include the dc-balancedproperty: the coding scheme generates a bit stream with a balancednumber of '1' and '0' bits.

    We examined many other encoding schemes. Many schemes address

    only one of the original concerns. For example, parity or CRCs can guardagainst single bit errors, but do not provide any synchronizationprimitives, and do not improve transition density. Furthermore, the errordetection in the 8b10b encoding scheme can detect many errors thatthese do not detect.

    It is possible to provide a synchronization sequence that will guaranteethat there is at least one transition for every character (for example,appending the sequence "10" to every character). This approach doesnot improve the transition density beyond adding a single guaranteedtransition to every character (although it may add up to three transitions

    per characters). It is also possible to provide some of the functionality ofcomma characters using this scheme by using a different sequence,such as "01", to indicate that the character is control. However, thisdoes not truly exhibit all the characteristics of a comma characterbecause it is not singular -- it is not a bit pattern that is not allowed innormal data.

    There are two main advantages that some of these other schemes have:first, some of them (such as only using parity) can have a loweroverhead. Second, many of them are significantly simpler (andtherefore, consume less space). These advantages seem smaller when

    closely examined. If it is required that multiple additional encoding steps(for example, using parity and appending a synchronization sequence)be used, the first advantage may not exist at all. Also, the simplicitysavings may only push the required complexity up to a higher level. Thesimpler synchronization scheme may require more complex bytesynchronization and comma analysis at a higher level.

    IBM 8B/10B Encoding Scheme

  • 7/31/2019 8b 10b Encode Decode

    3/5

    Figure 2.3.1 - Block Diagram of Encoder

    The actual process of encoding works as follows. 8 data bits arepresented to the encoder. These data bits are logically separated intotwo separate categories: the first 5 bits, and the last 3 bits. The first 5

    bits are fed into a block (labeled 5B Functions in the block diagram)that produces functions based on the values of those bits. The last 3 bitsare likewise fed into a similar block (labeled 3B Functions). Thesefunctions are used to determine how the final encoding should occur tomaintain DC balancing. The blocks that uses the functions to determinethis is labeled Disparity Control in the block diagram. The actualencoding is done in the blocks labeled 5B/6B Encoding and 3B/4BEncoding.

    The encoding can be thought of as occuring in two different stages: first,the 5B/6B encoding, then the 3B/4B encoding. Each stage of encoding

    can produce one of two sorts of outputs: a value of 0 disparity (that is,containing an equal number of '1' and '0' bits), or a value with disparityof +2 or -2 (that is, containing two more '1' bits than '0' bits, or twofewer '1' bits than '0' bits). If a certain input value encodes to a 0-disparity value, that value is generated. Otherwise, either the normalencoding or its complement is generated, based on the current runningdisparity.

  • 7/31/2019 8b 10b Encode Decode

    4/5

    Each 8-bit value that is presented to the encoder is therefore encodedinto 2 sub-blocks. These sub-blocks are refered to in the form D.a.b, fordata blocks, or K.a.b, for control blocks. In both cases, 'a' represents thevalue of the value of the 5 bit block to be encoded, and 'b' representsthe value of the 3 bit block to be encoded.

    Control Characters

    The IBM 8B/10B encoding scheme contains pre-defined controlcharacters. These include both comma characters and non-commacharacters. The table below shows these values.

    Table 2.3.1 -Control Characters.

    K.28.1, K.28.5, andK.28.7 are comma

    characters.

    The actualprocess ofencoding worksas follows. 8 databits are

    presented to theencoder. Thesedata bits arelogicallyseparated intotwo separatecategories: thefirst 5 bits, andthe last 3 bits.The first 5 bitsare fed into a

    block (labeled5B Functions inthe blockdiagram) thatproducesfunctions based on the values of those bits. The last 3 bits are likewisefed into a similar block (labeled 3B Functions). These functions areused to determine how the final encoding should occur to maintain DC

    Name

    A B C D E FG H

    a b c d e i f gh j

    K.28.

    0

    0 0 1 1 1 0 0

    0

    0 0 1 1 1 1 0 1

    0 0K.28.1

    0 0 1 1 1 1 00

    0 0 1 1 1 1 1 00 1

    K.28.2

    0 0 1 1 1 0 10

    0 0 1 1 1 1 0 10 1

    K.28.3

    0 0 1 1 1 1 10

    0 0 1 1 1 1 0 01 1

    K.28.4

    0 0 1 1 1 0 01

    0 0 1 1 1 1 0 01 0

    K.28.5

    0 0 1 1 1 1 01

    0 0 1 1 1 1 1 01 0

    K.28.6

    0 0 1 1 1 0 11

    0 0 1 1 1 1 0 11 0

    K.28.7

    0 0 1 1 1 1 11

    0 0 1 1 1 1 1 00 0

    K.23.7

    1 1 1 0 1 1 11

    1 1 1 0 1 0 1 00 0

    K.27.7

    1 1 0 1 1 1 11

    1 1 0 1 1 0 1 00 0

    K.29.7

    1 0 1 1 1 1 11

    1 0 1 1 1 0 1 00 0

    K.30.7

    0 1 1 1 1 1 11

    0 1 1 1 1 0 1 00 0

  • 7/31/2019 8b 10b Encode Decode

    5/5

    balancing. The blocks that uses the functions to determine this islabeled Disparity Control in the block diagram. The actual encoding isdone in the blocks labeled 5B/6B Encoding and 3B/4B Encoding.

    Size and Power

    The encoder is approximately 280x230 microns, and the decoder isapproximately the same size. Simulation of the functional blocks in theencoder and decoder show that the power consumption in typicaloperation for both the encoder and decoder is less than a milliwatt.