DEV Community

Discussion on: I'm the lead developer of SBTCVM, a FOSS balanced ternary VM project, Ask Me Anything!

Collapse
 
thomasthespacefox profile image
Thomas Leathers

I suppose i could try. :)

SBTCVM has several major parts:

The VM of SBTCVM uses instruction level simulation to simulate a type of digital computer originally developed in Russia. It uses a 'balanced' base number. A balanced base number has an equal number of positive and negative digits. for example:

Here's a 2 trit(similar to a bit) number table as an example.

-- -4
-0 -3
-+ -2
0- -1
00 0
0+ 1
+- 2
+0 3
++ 4

not only does it have 9 states, 4 of them are negative. This inherit signing causes balanced ternary computing to be quite different from binary in places.

The (latest version's) CPU itself uses 18-trit words divided into a 9-trit instruction word, and a 9-trit data word, along with a 9-trit memory bus. This means it has 19,683 words of memory. It uses an additional 9-trit IO bus, providing 19,683 IO addresses.

The second part of SBTCVM is the programming tools. Currently SBTCVM has a fairly advanced low-level assembler, and a currently numeric, higher level language that provides a basic integer object abstraction system, along with the ability to use some assembly in-line if your feeling brave :)

A trom (memory image) dump utility is also provided, as a standard hex viewer obviously isn't going to help much. :)

The third part is software that runs in the VM. Now, the latest codebase isn't ready for huge interactive programs yet, but we do have some exciting plans... :)