{{refimprove|date=January 2017}} '''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: * + (positive pulse), * 0 (no pulse), and * − (negative pulse). This means we have 2<sup>4</sup> = 16 input combinations to represent, using 3<sup>3</sup> = 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== <!-- Source: http://www.infineon.com/cms/en/product/channel.html?channel=ff80808112ab681d0112ab69a79202a5 --> 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.
{|class=wikitable style="text-align:center" |+MMS 43 coding table<ref>{{cite web |title=Wired Communications T-SMINTO 4B3T Second Gen. Modular ISDN NT (Ordinary) |type=Data sheet |id=PEF 80902 |version=Version 1.1 |date=November 2001 |publisher=Infineon |url=https://media.digikey.com/pdf/Data%20Sheets/Infineon%20PDFs/PEF%2080902.pdf}}</ref> ! colspan="2" |Input!! colspan="4" | Accumulated DC offset |- !Hex !Binary !width=20%| 1 !!width=20%| 2 !!width=20%| 3 !!width=20%| 4 |- !0 ! 0000 |style="background:#f9c"| + 0 + (+2) ||colspan=3 style="background:#ccf"| 0−0 (−1) |- !1 ! 0001 |colspan=4| 0 − + (+0) |- !2 ! 0010 |colspan=4| + − 0 (+0) |- !3 ! 0011 |colspan=3 style="background:#fcf"| 0 0 + (+1) ||style="background:#99f"| − − 0 (−2) |- !4 ! 0100 |colspan=4| − + 0 (+0) |- !5 ! 0101 |style="background:#f9c"| 0 + + (+2) ||colspan=3 style="background:#ccf"| − 0 0 (−1) |- !6 ! 0110 |colspan=2 style="background:#fcf"| − + + (+1) ||colspan=2 style="background:#ccf"| − − + (−1) |- !7 ! 0111 |colspan=4| − 0 + (+0) |- !8 ! 1000 |colspan=3 style="background:#fcf"| + 0 0 (+1) ||style="background:#99f"| 0 − − (−2) |- !9 ! 1001 |colspan=3 style="background:#fcf"| + − + (+1) ||style="background:#66f"| {{nowrap|− − − (−3)}} |- !A ! 1010 |colspan=2 style="background:#fcf"| + + − (+1) ||colspan=2 style="background:#ccf"| + − − (−1) |- !B ! 1011 |colspan=4| + 0 − (+0) |- !C ! 1100 |style="background:#f69"| + + + (+3) ||colspan=3 style="background:#ccf"| − + − (−1) |- !D ! 1101 |colspan=3 style="background:#fcf"| 0 + 0 (+1) ||style="background:#99f"| − 0 − (−2) |- !E ! 1110 |colspan=4| 0 + − (+0) |- !F ! 1111 |style="background:#f9c"| + + 0 (+2) ||colspan=3 style="background:#ccf"| 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.
{|class="wikitable sortable" style="text-align:center" !Ternary !! Binary !Hex |rowspan=10| ! Ternary !! Binary !! Hex |rowspan=10| ! Ternary !! Binary !! Hex |- | 0 0 0 ||colspan=2 {{n/a}} | − 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 || 8 | 0 + 0 || 1101 || D |- | 0 0 + || 0011 || 3 | 0 − − || 1000 || 8 | − 0 − || 1101 || D |- | − − 0 || 0011 || 3 | + − + || 1001 || 9 | 0 + − || 1110 || E |- | − + 0 || 0100 || 4 | − − − || 1001 || 9 | + + 0 || 1111 || F |- | 0 + + || 0101 || 5 | + + − || 1010 || A | 0 0 − || 1111 || F |}
==8B/6T== A similar paired-disparity code was used in the short-lived {{Pslink|Fast Ethernet|100BASE-T4}} 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:
{|class=wikitable style="text-align:center" |+8B/6T coding table<ref>{{cite book |title=Local Area High Speed Networks |first=Sidnie |last=Feit |publisher=New Riders Publishing |date=June 19, 2000 |isbn=1-57870-113-9 |chapter=Appendix B.2: 8B/6T Tables}}</ref> ! 8B !! 6T ! 8B !! 6T ! 8B !! 6T ! 8B !! 6T ! 8B !! 6T ! 8B !! 6T ! 8B !! 6T ! 8B !! 6T |- | 00 || +−00+− | 20 || 00−++− | 40 ||style="background:#fcf"| +0+00− | 60 ||style="background:#fcf"| 0−0++0 | 80 || +−+00− | A0 || 0−0++− | C0 ||style="background:#fcf"| +−+0+− | E0 ||style="background:#fcf"| +−0++− |- | 01 || 0+−+−0 | 21 || −−+00+ | 41 ||style="background:#fcf"| ++00−0 | 61 ||style="background:#fcf"| 00−+0+ | 81 || ++−0−0 | A1 || 00−+−+ | C1 ||style="background:#fcf"| ++−+−0 | E1 ||style="background:#fcf"| 0+−+−+ |- | 02 || +−0+−0 | 22 ||style="background:#fcf"| ++−0+− | 42 ||style="background:#fcf"| +0+0−0 | 62 ||style="background:#fcf"| 0−0+0+ | 82 || +−+0−0 | A2 || 0−0+−+ | C2 ||style="background:#fcf"| +−++−0 | E2 ||style="background:#fcf"| +−0+−+ |- | 03 || −0++−0 | 23 ||style="background:#fcf"| ++−0−+ | 43 ||style="background:#fcf"| 0++0−0 | 63 ||style="background:#fcf"| −00+0+ | 83 || −++0−0 | A3 || −00+−+ | C3 ||style="background:#fcf"| −+++−0 | E3 ||style="background:#fcf"| −0++−+ |- | 04 || −0+0+− | 24 ||style="background:#fcf"| 00+0−+ | 44 ||style="background:#fcf"| 0++00− | 64 ||style="background:#fcf"| −00++0 | 84 || −++00− | A4 || −00++− | C4 ||style="background:#fcf"| −++0+− | E4 ||style="background:#fcf"| −0+++− |- | 05 || 0+−−0+ | 25 ||style="background:#fcf"| 00+0+− | 45 ||style="background:#fcf"| ++0−00 | 65 ||style="background:#fcf"| 00−0++ | 85 || ++−−00 | A5 || 00−−++ | C5 ||style="background:#fcf"| ++−−0+ | E5 ||style="background:#fcf"| 0+−−++ |- | 06 || +−0−0+ | 26 || 00−00+ | 46 ||style="background:#fcf"| +0+−00 | 66 ||style="background:#fcf"| 0−00++ | 86 || +−+−00 | A6 || 0−0−++ | C6 ||style="background:#fcf"| +−+−0+ | E6 ||style="background:#fcf"| +−0−++ |- | 07 || −0+−0+ | 27 || −−+++− | 47 ||style="background:#fcf"| 0++−00 | 67 ||style="background:#fcf"| −000++ | 87 || −++−00 | A7 || −00−++ | C7 ||style="background:#fcf"| −++−0+ | E7 ||style="background:#fcf"| −0+−++ |- | 08 || −+00+− | 28 || −0−++0 | 48 ||style="background:#fcf"| 000+00 | 68 ||style="background:#fcf"| −+−++0 | 88 || 0+000− | A8 || −+−++− | C8 ||style="background:#fcf"| 0+00+− | E8 ||style="background:#fcf"| −+0++− |- | 09 || 0−++−0 | 29 || −−0+0+ | 49 ||style="background:#fcf"| 000−++ | 69 ||style="background:#fcf"| −−++0+ | 89 || 00+0−0 | A9 || −−++−+ | C9 ||style="background:#fcf"| 00++−0 | E9 ||style="background:#fcf"| 0−++−+ |- | 0A || −+0+−0 | 2A || −0−+0+ | 4A ||style="background:#fcf"| 000+−+ | 6A ||style="background:#fcf"| −+−+0+ | 8A || 0+00−0 | AA || −+−+−+ | CA ||style="background:#fcf"| 0+0+−0 | EA ||style="background:#fcf"| −+0+−+ |- | 0B || +0−+−0 | 2B || 0−−+0+ | 4B ||style="background:#fcf"| 000++− | 6B ||style="background:#fcf"| +−−+0+ | 8B || +000−0 | AB || +−−+−+ | CB ||style="background:#fcf"| +00+−0 | EB ||style="background:#fcf"| +0−+−+ |- | 0C || +0−0+− | 2C || 0−−++0 | 4C || 000−+0 | 6C ||style="background:#fcf"| +−−++0 | 8C || +0000− | AC || +−−++− | CC ||style="background:#fcf"| +000+− | EC ||style="background:#fcf"| +0−++− |- | 0D || 0−+−0+ | 2D || −−00++ | 4D || 000−0+ | 6D ||style="background:#fcf"| −−+0++ | 8D || 00+−00 | AD || −−+−++ | CD ||style="background:#fcf"| 00+−0+ | ED ||style="background:#fcf"| 0−+−++ |- | 0E || −+0−0+ | 2E || −0−0++ | 4E || 000+−0 | 6E ||style="background:#fcf"| −+−0++ | 8E || 0+0−00 | AE || −+−−++ | CE ||style="background:#fcf"| 0+0−0+ | EE ||style="background:#fcf"| −+0−++ |- | 0F || +0−−0+ | 2F || 0−−0++ | 4F || 000+0− | 6F ||style="background:#fcf"| +−−0++ | 8F || +00−00 | AF || +−−−++ | CF ||style="background:#fcf"| +00−0+ | EF ||style="background:#fcf"| +0−−++ |- | 10 || +0+−−0 | 30 || +−00−+ | 50 ||style="background:#fcf"| +0+−−+ | 70 ||style="background:#fcf"| −++000 | 90 || +−+−−+ | B0 || 0−000+ | D0 ||style="background:#fcf"| +−+0−+ | F0 ||style="background:#fcf"| +−000+ |- | 11 || ++0−0− | 31 || 0+−−+0 | 51 ||style="background:#fcf"| ++0−+− | 71 ||style="background:#fcf"| +−+000 | 91 || ++−−+− | B1 || 00−0+0 | D1 ||style="background:#fcf"| ++−−+0 | F1 ||style="background:#fcf"| 0+−0+0 |- | 12 || +0+−0− | 32 || +−0−+0 | 52 ||style="background:#fcf"| +0+−+− | 72 ||style="background:#fcf"| ++−000 | 92 || +−+−+− | B2 || 0−00+0 | D2 ||style="background:#fcf"| +−+−+0 | F2 ||style="background:#fcf"| +−00+0<!--Typo in source, corrected--> |- | 13 || 0++−0− | 33 || −0+−+0 | 53 ||style="background:#fcf"| 0++−+− | 73 ||style="background:#fcf"| 00+000 | 93 || −++−+− | B3 || −000+0 | D3 ||style="background:#fcf"| −++−+0 | F3 ||style="background:#fcf"| −0+0+0 |- | 14 || 0++−−0 | 34 || −0+0−+ | 54 ||style="background:#fcf"| 0++−−+ | 74 || −0+000 | 94 || −++−−+ | B4 || −0000+ | D4 ||style="background:#fcf"| −++0−+ | F4 ||style="background:#fcf"| −0+00+ |- | 15 || ++00−− | 35 || 0+−+0− | 55 ||style="background:#fcf"| ++0+−− | 75 || 0−+000 | 95 || ++−+−− | B5 || 00−+00 | D5 ||style="background:#fcf"| ++−+0− | F5 ||style="background:#fcf"| 0+−+00 |- | 16 || +0+0−− | 36 || +−0+0− | 56 ||style="background:#fcf"| +0++−− | 76 || +0−000 | 96 || +−++−− | B6 || 0−0+00 | D6 ||style="background:#fcf"| +−++0− | F6 ||style="background:#fcf"| +−0+00 |- | 17 || 0++0−− | 37 || −0++0− | 57 ||style="background:#fcf"| 0+++−− | 77 || 0+−000 | 97 || −+++−− | B7 || −00+00 | D7 ||style="background:#fcf"| −+++0− | F7 ||style="background:#fcf"| −0++00 |- | 18 || 0+−0+− | 38 || −+00−+ | 58 ||style="background:#fcf"| +++0−− | 78 ||style="background:#fcf"| 0−−+++ | 98 || 0+0−−+ | B8 || −+−00+ | D8 ||style="background:#fcf"| 0+00−+ | F8 ||style="background:#fcf"| −+000+ |- | 19 || 0+−0−+ | 39 || 0−+−+0 | 59 ||style="background:#fcf"| +++−0− | 79 ||style="background:#fcf"| −0−+++<!--Typo in source, corrected--> | 99 || 00+−+− | B9 || −−+0+0 | D9 ||style="background:#fcf"| 00+−+0 | F9 ||style="background:#fcf"| 0−+0+0 |- | 1A ||style="background:#fcf"| 0+−++− | 3A || −+0−+0 | 5A ||style="background:#fcf"| +++−−0 | 7A ||style="background:#fcf"| −−0+++<!--Typo in source, corrected--> | 9A || 0+0−+− | BA || −+−0+0 | DA ||style="background:#fcf"| 0+0−+0 | FA ||style="background:#fcf"| −+00+0 |- | 1B ||style="background:#fcf"| 0+−00+ | 3B || +0−−+0 | 5B || ++0−−0 | 7B || −−0++0 | 9B || +00−+− | BB || +−−0+0 | DB ||style="background:#fcf"| +00−+0 | FB ||style="background:#fcf"| +0−0+0 |- | 1C ||style="background:#fcf"| 0−+00+ | 3C || +0−0−+ | 5C ||style="background:#fcf"| ++0−−+ | 7C || ++−00− | 9C || +00−−+ | BC || +−−00+ | DC ||style="background:#fcf"| +000−+ | FC ||style="background:#fcf"| +0−00+ |- | 1D ||style="background:#fcf"| 0−+++− | 3D || 0−++0− | 5D ||style="background:#fcf"| ++000− | 7D || 00+00− | 9D || 00++−− | BD || −−++00 | DD ||style="background:#fcf"| 00++0− | FD ||style="background:#fcf"| 0−++00 |- | 1E || 0−+0−+ | 3E || −+0+0− | 5E ||style="background:#fcf"| −−+++0 | 7E || ++−−−+ | 9E || 0+0+−− | BE || −+−+00 | DE ||style="background:#fcf"| 0+0+0− | FE ||style="background:#fcf"| −+0+00 |- | 1F || 0−+0+− | 3F || +0−+0− | 5F ||style="background:#fcf"| 00−++0 | 7F || 00+−−+ | 9F || +00+−− | BF || +−−+00 | DF ||style="background:#fcf"| +00+0− | FF ||style="background:#fcf"| +0−+00 |- !colspan=6 rowspan=2| Unused | {{n/a}} || +++−−− | {{n/a}} || +−0000 | {{n/a}} || −+0000 | {{n/a}} ||style="background:#fcf"| +00000 | {{n/a}} ||style="background:#fcf"| 0+0000 |- | {{n/a}} || −−−+++ | {{n/a}} || 0000−+ | {{n/a}} || 0000+− | {{n/a}} ||style="background:#fcf"| 00000+ | {{n/a}} ||style="background:#fcf"| 0000+0 |}
==See also==
Other line codes that have 3 states: * hybrid ternary code * bipolar encoding * MLT-3 encoding * B3ZS
==References== {{Reflist}}
{{Bit-encoding}}
Category:Line codes Category:Integrated Services Digital Network