Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
1) Convert the number to the "ordinary" ternary number system - and if the number is negative, then add a minus to all digits
2) go through the digits from right to left: replace all (2) with ($) and add +1 to the higher digit; we replace all (3) with (0) and add (+1) to a higher digit; we replace all (-2) with (1) and add (-1) to a higher digit; we replace all (-3) with 0 and add (-1) to the higher bit.
"Positive" example : 71 (underscore means loop counter location)
71 = 27*2 + 9*1 + 3*2 + 1*2
2 1 2 2<
2 1 3<$
2 2<0 $
3<$ 0 $
1<0 $ 0 $
<1 0 $ 0 $
Checking: 81 - 9*1 - 1 = 71 -71 = 27*(-2) + 9*(-1) + 3*(-2) + 1*(-2)
-2 -1 -2 -2<
-2 -1 -3< 1
-2 -2< 0 1
-3< 1 0 1
$< 0 1 0 1
<$ 0 1 0 1
Checking: 81*(-1) + 9*1 + 1*1 = -71
In fact, the following negative unit sign is adopted: ͞1. Brusentsov also wrote this. And it's easy to translate. An asymmetric ternary system can be converted into a symmetrical one by setting: 2 → 1͞1. That is, we translate the number 7 as 21, and then arithmetically as 1͞10 + 001 = 1͞11. Let's take the number 14 as an example and translate it into a symmetrical and balanced system. We get the number 14 in the asymmetric system as 112, then we get the following: 110 + 01͞1 = 1͞1͞1͞1. Or 17 is 122 in asymmetrical or 1͞10͞1 in symmetrical. For negative it is implemented very simply. First we reserve a negative value. Let's transform the number as positive, and at the end of the series of trits, we will invert it due to the negative sign. For example: -17 is ͞1111. This is how it is decided.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question