



So, bits works with ones and zeros. And trits are working with zeros, ones and twos!
I found some logic gates for trits:
UNARY GATES:
INV: it reverse number INV(x) = 2 – x
ROT: it "rotates" number: ROT(x) = (x + 1) mod 3
ROT2 which is just ROT(ROT(x)) or (x + 2) mod 3 or (x – 1) mod 3
BINARY GATES:
MAX: equivalent to OR gate, it chooses maximum value, for example: MAX(1, 2) = 2
MIN: equivalent to AND gate, it chooses minimum value, for example MIN(0, 1) = 0
XMAX: equivalent to XOR gate. Just like in binary, i made it with formula:
MAX( MIN(a,INV(b), MIN(INV(a),b )
Then, to make HALF-ADDER, i simply made python script to generate random logic circuits. It took about 10 millions of tries but i found 2 circuits, for SUM and for CARRY OUT. I will send them in comments in python dict form 🙂
And to make full adder it was the same as with binary. Then just repeat it 9 times and here is my 9-trit adder!
Finally, to build it in minecraft i transform bits to trits:
00 is 0
01 is 1
10 is 2
And 11 we just ignore 🙂
So, a trinary problem transforms to binary problem!
I'm a bad redstone builder, so i did it schematically and would really happy to see someone build it more compact!
||P. S: btw sorry for my bad english, i'm a typical foreigner :(||
by Makushimu0
1 Comment
Sum:
“`
{‘xmax’: [{‘rot’: {‘rot’: {‘min3’: [‘A’, ‘B’]}}}, {‘max3’: [{‘min3’: [{‘rot’: ‘A’}, {‘rot’: ‘B’}]}, {‘inv’: {‘max3’: [‘A’, ‘B’]}}]}]}
“`
Carry out:
“`
{‘min3’: [{‘rot’: {‘rot’: {‘max3’: [‘B’, ‘A’]}}}, {‘inv’: {‘inv’: {‘min3’: [‘A’, ‘B’]}}}]}
“`