Try packing 11 bits (2048 codes) in 7 trits (2187 codes), you will get less than 1% of the overhead. There are several methods. The first one is simple: a lookup table. The second is divmod-3. Thirdly, this is a little mythology, as shown below.
First step: first pack the first 9 bits using a 3-bit-2-trit scheme:
abc def ghi jk => mn pq rs jk (mn, pq, rs are trit pairs) bits trits 0ab -> ab 10a -> Za 11a -> aZ (i'll use Z is for -1 for compactness)
ZZ state will be used further
Second stage: using more complex logic for packing 6 tracks and 2 bits in 7 trits:
mn pq rs 0k -> mn pq rs k mn pq rs 10 -> mn pq rs Z mn pq rZ 11 -> mn pq ZZ r mn pq r0 11 -> mn ZZ pq r mn pq r1 11 -> ZZ mn pq r
Unused Codes:
ZZ ZZ xx x ZZ xx ZZ x xx ZZ ZZ x
UPD other suitable packing ratios: 19b โ 11t (~ 0.1% overhead), 84b โ 53t (~ 0.0035% overhead), but seem to exceed.
source share