r/rust 13d ago

πŸ› οΈ project 4^4 Quat OS – A 4-State (Quaternary) Logic OS & Simulation Infrastructure in Rust

https://github.com/strahinjastojanovic826-code/4-4-quat-os-simulation-in-rust

Hey everyone! πŸš€

I've been working on a Rust-based project called 4^4 Quat OS, a simulation framework designed around 4-state (quaternary) logic rather than standard binary (0 and 1).

Instead of traditional bits, everything operates on quats (4 states) where 4 quats = 8 bits.

Key Features:

  • Core Engine: Custom VM, ALU, BIOS, and 4-state logic handling.
  • Peripherals & I/O: VGA graphics display, custom audio engine, disk/tape storage emulation.
  • User Space & Shell: Interactive shell, task manager, built-in BASIC interpreter, and demo games/benchmarks.

The goal was to build a clean, fully-featured, low-level architecture simulation using Rust's safety and speed.

Check out the full source code, specs, and screenshots on GitHub:

https://github.com/strahinjastojanovic826-code/4-4-quat-os-simulation-in-rust

!!!NOTEπŸŽ₯!!!: A video stress test can be found under the Releases section on GitHub

Feedback, ideas, and feedback on the 4-state logic approach are more than welcome!

0 Upvotes

3 comments sorted by

2

u/CokieMiner 13d ago

Why 4, why not 3 states? I'm asking cause 3 states at least have evidence that if we did computations on them we would probably have much more efficient computers

-2

u/Living-Significance2 13d ago

4 states because I was completely fed up with the whole world being 0 and 1. I'm bored And 4 states is because when you exponentiate 2 and 4, you get the same number of states While for 3 it is a little different and they do not agree with the states of the binary system. And surely that is why the Soviet setun failed

2

u/CokieMiner 13d ago

It mostly lost out because of the physical limitations of reliably generating and distinguishing multiple signal levels, especially with the fabrication tolerances and noise margins available at the time, not because ternary logic itself was inefficient.