Triplets of ternary digits are encoded in heptavintimal numbers.
There is a need for an encoding akin to hexdecimal for ternary computers. Heptavintimal meets this need, offering a natural encoding for tribbles in base-27. It is especially useful for encoding scheme such as TerSCII.
- A trit is a 3 values digit(0, 1, 2).
- A tribble is 3 trits(0-26).
- A tryte is 3 tribles(0-19682).
The layout used here differs from Douglas W. Jones' proposal which requires a large LUT to render the notation, this one relies on the fact that the 27 characters needed for the system conveniently fits by simply adding a zero at the start of the roman alphabet.
| Bal | -13 | -12 | -11 | -10 | -9 | -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| --- | --0 | --+ | -0- | -00 | -0+ | -+- | -+0 | -++ | 0-- | 0-0 | 0-+ | 00- | 000 | 00+ | 0+- | 0+0 | 0++ | +-- | +-0 | +-+ | +0- | +00 | +0+ | ++- | ++0 | +++ | |
| Hept | 0 | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
| Uns | 000 | 001 | 002 | 010 | 011 | 012 | 020 | 021 | 022 | 100 | 101 | 102 | 110 | 111 | 112 | 120 | 121 | 122 | 200 | 201 | 202 | 210 | 211 | 212 | 220 | 221 | 222 |
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | |
| 3's | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -13 | -12 | -11 | -10 | -9 | -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 |
Examples
| Decimal | Ternary | Nonary | Hept |
|---|---|---|---|
| 1 | 1 | 1 | A |
| 2 | 2 | 2 | B |
| 4 | 11 | 4 | D |
| 8 | 22 | 8 | H |
| 16 | 121 | 17 | P |
| 32 | 1012 | 35 | AE |
| 64 | 2101 | 71 | BJ |
| 128 | 11202 | 152 | DT |
| 256 | 100111 | 314 | IM |
| 512 | 200222 | 628 | RZ |
| 1024 | 1101221 | 1412 | AJY |
Why not septemvigesimal
The name heptavintimal is composed of the Greek prefix hepta, meaning seven, followed by the Latin root vinti meaning twenty, with the suffix mal added, to indicate that it is a number base. The mixing of Greek and Latin exactly follows the formation of the word hexadecimal, where the prefix hexi comes from Greek and the root deci is from the Latin.
incoming: ternary ternary computing