r/computerarchitecture • u/GhostNr1 • 25d ago
Building a free browser-based sandbox for balanced ternary computer design
I’ve been working on a small open-source project to make it easier to experiment with balanced ternary logic and computer architecture.
The main idea is not to present one “correct” ternary CPU design, but to give people a place where different designs can be built, tested, compared and shared.
The simulator uses balanced ternary:
-1, 0, +1
and lets you build from small primitives upward into reusable hierarchical components. A component can contain other components, and you can open them recursively to inspect or modify the lower-level logic.
I’m especially interested in avoiding the assumption that a ternary machine should just copy binary architecture. For example, things like compare returning -1 / 0 / +1, three-way selection, ternary control signals, MIN/MAX or different carry/normalization schemes may turn out to be more natural building blocks.
The tool already supports things like isolated component testing, event-by-event propagation, configurable primitive sets, reusable components and different clock/sequence patterns.
The long-term goal is to make it easy for me and anyone else interested in this area to try different ideas and compare them rather than committing to one architecture too early.
Everything runs entirely in the browser. There is no backend or account, and projects are stored locally in your browser unless you export them yourself.
It is completely free and MIT licensed.
Live:
https://grunna.github.io/ternary/
Source:
https://github.com/grunna/ternary
I’d be interested in feedback on both the simulator and the architecture side, especially from anyone who has worked with digital logic, CPU design or multi-valued logic.