Every computer scientist knows how difficult it is to work with long sequences of ones and zeros. He is helped by the octal and hexadecimal number systems, which provide a more compact representation of information.
With the ternary number system, the situation is worse: there are several ways to represent ternary numbers and there are several ways to compact ternary numbers, but they have drawbacks that make it difficult to work with them.
The TREX coding system is designed to compactly represent the symmetric ternary number system when used in computer systems
Remarks
, {-1, 0, +1}.
9- 27- TREX.
. , , , .
, , ( - ) , , ( , ASCII)
, {-, 0, +}.
:
+-0-0+++- -++0+00--
000+-+--0 +-+-+-++0
-0+0-+00+ 0-0+++--0
«-», «0» «+» ( «0» «1» ), ( HEX-).
HEX, TREX.
TREX :
{ m..a, 0, A..M}
:
TREX
-13 --- m
-12 --0 l
-11 --+ k
-10 -0- j
-9 -00 i
-8 -0+ h
-7 -+- g
-6 -+0 f
-5 -++ e
-4 0-- d
-3 0-0 c
-2 0-+ b
-1 00- a
0 000 0
+1 00+ A
+2 0+- B
+3 0+0 C
+4 0++ D
+5 +-- E
+6 +-0 F
+7 +-+ G
+8 +0- H
+9 +00 I
+10 +0+ J
+11 ++- K
+12 ++0 L
+13 +++ M
TREX
, {-1, 0, +1}. {-, 0, +} .
:
+ +1
0 0
- -1
(3 1/3 ) TREX
:
M = +++
TREX «» 6- . , , , , . -9841 +9841. 27- (). TREX
:
A0m = 00+ 000 ---
9- 27-
9- 27- :
— , .
:
9- , {-4,-3,-2,-1,0,1,2,3,4}
– .
:
9- , ( , , ):
.
:
TREX
( «») ( )
-4 1 0 -2 -3 A a 0 B B
0 0 0 1 -2 M M m d d
1 1 -3 0 0 C c a d d
— , , .
:
9- , {W,X,Y,Z,0,1,2,3,4}, 27- , {0,A..Z}).
« »
:
A = -a
MMM + mmm = 0
- :
—
.
:
Akm > 0
mmD < 0
- .
:
-(AdFGhb) = aDfgHB
– , ,
:
mod (Mf0) = Mf0
mod (a0H) = A0h
- ,
:
Mfa 00a
+ => + => 00G
mFH 00H
- , , , , , .
:
Mfa > Mma
afa > bfa
:
( )
to reduce the number of errors in the development of software for ternary computers or their emulators.
Sample screenshot from TREX