Introduction
Hi! My name is Pier-Luc. I have studied software and computer engineering. While I do not have a lot of skills in hardware development, my contributes are mainly to suggest some (future) standards that should be useful for software programming in ternary computers.
Yes, I know, we are still very far from what I propose in the following topics, but I do believe it is the best time to re-think everything about computer architectures before ternary computers become mainstream.
My Suggestions
Three Operands Instructions
Addition and Subtraction
As I said in page Data Types, we should be able to add and/or subtract three integers at the same time. This is possible since only one carry trit is needed. Here are the four different instructions:
ADDADD register1, register2, register3 ; In C/C++: (var1 + var2 + var3); ADDSUB register1, register2, register3 ; In C/C++: (var1 + var2 - var3); SUBADD register1, register2, register3 ; In C/C++: (var1 - var2 + var3); SUBSUB register1, register2, register3 ; In C/C++: (var1 - var2 - var3);
In Range Operator
Sometimes, we want to know if a number is between two other numbers. It can be done with two comparisons (A < B and B < C) and the AND operator. Well, it could be interesting to execute this comparison in one step:
INEE register1, register2, register3 ; Future C++: (var1 in ]var2, var3[); INEI register1, register2, register3 ; Future C++: (var1 in ]var2, var3]); INIE register1, register2, register3 ; Future C++: (var1 in [var2, var3[); INII register1, register2, register3 ; Future C++: (var1 in [var2, var3]);
The instruction is INxy
, where x
and y
can be E
for "excluding" and I
for "including". The returned value is a tribool:
- True: inside of the range
- False: outside of the range
- Unknown: var2 is greater than var3 (var2 > var3)