The 12B/14B line code is designed to provide a DC balanced encoding scheme for transmitting 12-bit data words over high speed serial links.
Like 8B/10B, the code table is split into two parts. The 7 least significant bits are encoded using a 7B/8B encoding table, and the 5 most significant bits are encoding using a 5B/6B table.
The 7/8 encoding is considered first, along with a running disparity count. The code is looked up in the 7B/8B table. Then it is optionally inverted if doing so would bring would bring the running disparity closer to 0.
Then the 5/6 encoding is considered. The code is looked up in the code table, and then optionally inverted according to the following rules