4B3T explained

4B3T, which stands for 4 (four) binary 3 (three) ternary, is a line encoding scheme used for ISDN PRI interface. 4B3T represents four binary bits using three pulses.

Description

It uses three output levels:

This means we have 24 = 16 input combinations to represent, using 33 = 27 output combinations. 000 is not used to avoid long periods without a transition. 4B3T uses a paired disparity code to achieve an overall zero DC bias: six triplets are used which have no DC component (0+−, 0−+, +0−, −0+, +−0, −+0), and the remaining 20 are grouped into 10 pairs with differing disparity (e.g. ++− and −−+). When transmitting, the DC bias is tracked and a combination chosen that has a DC component of the opposite sign to the running total.

This mapping from 4 bits to three ternary states is given in a table known as Modified Monitoring State 43 (MMS43).A competing encoding technique, used for the ISDN basic rate interface where 4B3T is not used, is 2B1Q.

The sync sequence used is the 11-symbol Barker code, +++−−−+−−+− or its reverse, −+−−+−−−+++.

Encoding table

Each 4-bit input group is encoded as a 3-symbol group (transmitted left to right) from the following table.Encoding requires keeping track of the accumulated DC offset, the number of + pulses minus the number of − pulses in all preceding groups. The starting value is arbitrary; here we use the values 1 through 4, although −1.5, −0.5, +0.5 and +1.5 is another possibility.

Input!! colspan="4"
Accumulated DC offset
HexBinarywidth=20%1 !width=20%2 !width=20%3 !width=20%4
00000+ 0 +   (+2) 0−0 (−1)
100010 − +   (+0)
20010+ − 0   (+0)
300110 0 +   (+1) − − 0   (−2)
40100− + 0   (+0)
501010 + +   (+2) − 0 0   (−1)
60110− + +   (+1) − − +   (−1)
70111− 0 +   (+0)
81000+ 0 0   (+1) 0 − −   (−2)
91001+ − +   (+1)
A1010+ + −   (+1) + − −   (−1)
B1011+ 0 −   (+0)
C1100+ + +   (+3) − + −   (−1)
D11010 + 0   (+1) − 0 −   (−2)
E11100 + −   (+0)
F1111+ + 0   (+2) 0 0 −   (−1)
This code forces a transition after at most five consecutive identical non-zero symbols, or four consecutive zero symbols.

Decoding table

Decoding is simpler, as the decoder does not need to keep track of the encoder state, although doing so allows greater error detection. The 000 triplet is not a legal encoded sequence, but is typically decoded as binary 0000.

Ternary BinaryHexTernary Binary HexTernary Binary Hex
0 0 0 − 0 0 0101 5+ − − 1010 A
+ 0 + 0000 0− + + 0110 6+ 0 − 1011 B
0 − 0 0000 0− − + 0110 6+ + + 1100 C
0 − + 0001 1− 0 + 0111 7− + − 1100 C
+ − 0 0010 2+ 0 0 1000 80 + 0 1101 D
0 0 + 0011 30 − − 1000 8− 0 − 1101 D
− − 0 0011 3+ − + 1001 90 + − 1110 E
− + 0 0100 4− − − 1001 9+ + 0 1111 F
0 + + 0101 5+ + − 1010 A0 0 − 1111 F

8B/6T

A similar paired-disparity code was used in the short-lived Fast Ethernet standard. This achieved the same ratio of 4/3 bits per baud while needing to keep track of only two levels of accumulated DC offset by using a larger 256-entry coding table. 6 ternary symbols allow 140 balanced codes (30 permutations of +0000−, 90 permutations of ++00−−, and 20 permutations of +++−−−), and 126 codes with disparity +1 (6 permutations of +00000, 60 permutations of ++000−, and 60 permutations of +++0−−). The codes with disparity +1 are inverted whenever the running disparity is high. From the total of 266 code words, 256 are used as follows:

8B/6T coding table[1] ! 8B !! 6T! 8B !! 6T! 8B !! 6T! 8B !! 6T! 8B !! 6T! 8B !! 6T! 8B !! 6T! 8B !! 6T
00 +−00+−20 00−++−40 +0+00−60 0−0++080 +−+00−A0 0−0++−C0 +−+0+−E0 +−0++−
01 0+−+−021 −−+00+41 ++00−061 00−+0+81 ++−0−0A1 00−+−+C1 ++−+−0E1 0+−+−+
02 +−0+−022 ++−0+−42 +0+0−062 0−0+0+82 +−+0−0A2 0−0+−+C2 +−++−0E2 +−0+−+
03 −0++−023 ++−0−+43 0++0−063 −00+0+83 −++0−0A3 −00+−+C3 −+++−0E3 −0++−+
04 −0+0+−24 00+0−+44 0++00−64 −00++084 −++00−A4 −00++−C4 −++0+−E4 −0+++−
05 0+−−0+25 00+0+−45 ++0−0065 00−0++85 ++−−00A5 00−−++C5 ++−−0+E5 0+−−++
06 +−0−0+26 00−00+46 +0+−0066 0−00++86 +−+−00A6 0−0−++C6 +−+−0+E6 +−0−++
07 −0+−0+27 −−+++−47 0++−0067 −000++87 −++−00A7 −00−++C7 −++−0+E7 −0+−++
08 −+00+−28 −0−++048 000+0068 −+−++088 0+000−A8 −+−++−C8 0+00+−E8 −+0++−
09 0−++−029 −−0+0+49 000−++69 −−++0+89 00+0−0A9 −−++−+C9 00++−0E9 0−++−+
0A −+0+−02A −0−+0+4A 000+−+6A −+−+0+8A 0+00−0AA −+−+−+CA 0+0+−0EA −+0+−+
0B +0−+−02B 0−−+0+4B 000++−6B +−−+0+8B +000−0AB +−−+−+CB +00+−0EB +0−+−+
0C +0−0+−2C 0−−++04C 000−+06C +−−++08C +0000−AC +−−++−CC +000+−EC +0−++−
0D 0−+−0+2D −−00++4D 000−0+6D −−+0++8D 00+−00AD −−+−++CD 00+−0+ED 0−+−++
0E −+0−0+2E −0−0++4E 000+−06E −+−0++8E 0+0−00AE −+−−++CE 0+0−0+EE −+0−++
0F +0−−0+2F 0−−0++4F 000+0−6F +−−0++8F +00−00AF +−−−++CF +00−0+EF +0−−++
10 +0+−−030 +−00−+50 +0+−−+70 −++00090 +−+−−+B0 0−000+D0 +−+0−+F0 +−000+
11 ++0−0−31 0+−−+051 ++0−+−71 +−+00091 ++−−+−B1 00−0+0D1 ++−−+0F1 0+−0+0
12 +0+−0−32 +−0−+052 +0+−+−72 ++−00092 +−+−+−B2 0−00+0D2 +−+−+0F2 +−00+0<--Typo in source, corrected-->
13 0++−0−33 −0+−+053 0++−+−73 00+00093 −++−+−B3 −000+0D3 −++−+0F3 −0+0+0
14 0++−−034 −0+0−+54 0++−−+74 −0+00094 −++−−+B4 −0000+D4 −++0−+F4 −0+00+
15 ++00−−35 0+−+0−55 ++0+−−75 0−+00095 ++−+−−B5 00−+00D5 ++−+0−F5 0+−+00
16 +0+0−−36 +−0+0−56 +0++−−76 +0−00096 +−++−−B6 0−0+00D6 +−++0−F6 +−0+00
17 0++0−−37 −0++0−57 0+++−−77 0+−00097 −+++−−B7 −00+00D7 −+++0−F7 −0++00
18 0+−0+−38 −+00−+58 +++0−−78 0−−+++98 0+0−−+B8 −+−00+D8 0+00−+F8 −+000+
19 0+−0−+39 0−+−+059 +++−0−79 −0−+++<--Typo in source, corrected-->99 00+−+−B9 −−+0+0D9 00+−+0F9 0−+0+0
1A 0+−++−3A −+0−+05A +++−−07A −−0+++<--Typo in source, corrected-->9A 0+0−+−BA −+−0+0DA 0+0−+0FA −+00+0
1B 0+−00+3B +0−−+05B ++0−−07B −−0++09B +00−+−BB +−−0+0DB +00−+0FB +0−0+0
1C 0−+00+3C +0−0−+5C ++0−−+7C ++−00−9C +00−−+BC +−−00+DC +000−+FC +0−00+
1D 0−+++−3D 0−++0−5D ++000−7D 00+00−9D 00++−−BD −−++00DD 00++0−FD 0−++00
1E 0−+0−+3E −+0+0−5E −−+++07E ++−−−+9E 0+0+−−BE −+−+00DE 0+0+0−FE −+0+00
1F 0−+0+−3F +0−+0−5F 00−++07F 00+−−+9F +00+−−BF +−−+00DF +00+0−FF +0−+00
Unused+++−−−+−0000−+0000+000000+0000
−−−+++0000−+0000+−00000+0000+0

See also

Other line codes that have 3 states:

Notes and References

  1. Book: Feit, Sidnie . Local Area High Speed Networks . New Riders Publishing . June 19, 2000 . 1-57870-113-9 . Appendix B.2: 8B/6T Tables.