ternaria

An emulation platform for ternary computers.

Ternaria builds the software stack for machines that compute in base three: an emulator, a programming language, numerical libraries, and machine learning experiments on ternary hardware.

The emulator runs programs; the rest is design.

Design decisions Documentation Source

Balanced ternary

Digits are −1, 0 and +1. The word is 27 trits, about 42.8 bits.

No sign bit

Negation flips each digit without carries, the range is symmetric, and signed and unsigned instruction variants are unnecessary.

Truncation rounds to nearest

Discarded digits are worth at most half a unit in the last place, and exact ties cannot occur, so there are no rounding modes.

Comparison returns one value

A comparison has three outcomes and a trit has three states, so one instruction returns less, equal or greater.

A third logical value

The middle state carries missing data directly, as SQL's NULL does.

Components

Emulator
A ternary machine in software, as QEMU is for binary machines. running
Ternex
A language with three-valued logic and three-armed conditionals in the syntax. design
Numerics
Linear algebra on arithmetic where truncation and rounding coincide. design
Machine learning
Quantised networks on hardware whose native digit is the weight. design
Operating system
A command-line system running on tryte code. design

Contact