Damnit, that ternary system needs more theory than I expected. I now have to use "higher math" to get things done.
More formally I have defined 2 operations on a ternary marker:
- rotation : maps 012 to 201 (circular shift by one position)
- swap : maps 012 to 021 (any 1 becomes 2 and vice versa)
And I had found the fortunate identity :
ID = swap(swap) = swap(rot(swap(rot)))
Thus Rot-¹ = swap(rot(swap)) as in the 1st version, which worked with the first ternary version.
Now I need to work that further so it can handle rot combined with swap. I can't have 2 rot because it's too long so I can't use ID = rot(rot(rot)), only 2 rot at most are possible (one in sender, the other in receiver).
- Encoding side :
- S=0,O=0 => ID : 012 => 012
- S=0,O=1 => rot : 012 => 201
- S=1,O=1 => swap(rot) : 012 => 102...
- Decoding side :
- S=0,O=0 => ID : 012 => 012
- S=0,O=1 => swap(rot(swap)) : 201 => 102 =>
- S=1,O=1 => swap(rot) ? 102
...
It doesn't feel very right because rot^-1 = rot(rot) = 120 : the position of the 0 should be shifted by each rot operation.
___________________________________________________________
The "solution" looks like "yet another adder", but an unusual one : mod 3.
Yann Guidon / YGDES
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.