11/26/2009

Trinary Numbers

In my last post I explained how Trinary logic can be used in place of binary logic, now I am going to show you how multidigit Trinary numerals work and how to add, subtract, multiply and divide them.

Trinary numerals greater than 1 or less than - work much like normal numbers. You take place value (1, 3, 9, 27, 81, 243, etc.) and multiply it by the digit value. The diference in trinary is that digit values can be negative. For instance:

1-01=27-9+0+1=19

In this way, counting in Trinary goes like this:

0, 1,
1-, 10, 11,
1--, 1-0, 1-1, 10-, 100, 101, 11-, 110, 111

and so on.


Adding in Trinary is a bit more complicated

Say we are adding 123 and 21.
In Trinary these are 1----0 and 1-10
We add right  to left. Column 1 is 0+0 which equals 0. Column 2 is - + 1 which equals 0.

Colunm 3 is is - + -. Here is where we get to the weird part. In trinary addition, we can end up with "borrowing" as we would in normal subtraction. We put a 1 at the bottom of column 3 and a - at the top of column 4. Column 4 now has two -'s and one 1, so it equals -. For the next two columns we just bring down the value from the top row because the bottom row is empty. Our final answer is 1--100, which is 243-81-27+9=144. Carrying out the same calculation in base 10, we discover that 123+21=144.


Subtraction in Trinary is interesting as well.

The easiest way is to negate the second number and add them. In Trinary, negation is easy. The opposite of 1 is - and vice versa, so to negate a number we simple change every 1 into - and vice versa.

Say we are doing 154-62
154 is 1-0-01
62 is 1-10-
-62 is -1-01
So we are performing 1-0-01+-1-01

Column 1 is 1+1, so we write - in the bottom of column 1 and 1 in the top of column 2. As it turns out, the other numbers in column 2 are all 0's so we write 1 in the bottom of it as well. Column 3 is -+-, so we put 1 in the bottom of column 3 and - in the top of column 4. Column 4 is -+0+1, so put 0 in the bottom of column 4.
Column 5 is -+-, so we put one in the bottom of column 5 and - in the top of column 6. Column 6 is now -+1, so we leave it blank.

Our answer is 1011-, or 81+9+3-1, or 92. Performing 154-62 in base 10, we discover that it also is 92.


 Multiplication in trinary is like repeated addition and subtraction.

I will star with a simple square, 8x8.
8 is 10-

We start from the bottom right. - times 10- is -01 Since this is in the first bottom digit we do not shift it. 0 times 10- is nothing. 1 times 10- is 10-, but since it is in the third digit, we need to shift it two digits to the left to get 10-00.
We add 10-00 and -01 to get the answer.
Coumn 1 is 1. Column 3 is -+-, or 1 with a - in column 4. We bring down the - in column 4 because column 4 is empty. Column 5 is 1.

Our answer is 1-101, or 81-27+9+1, or 64.


Division is repeated addition and subtraction as well.

Say we are performing 60/10.
60 is 1-1-0
10 is 101

This should come out evenly in Trinary because we know it does in base 10.

The division question in Trinary is "Can +or- B be subtracted from this part of A?" instead of "Is B less than this part of A?".

So, first we look at the first 3 digits, 1-1. Positive 101 can be subtracted from 1-1 to make -0, so our answers 3rd digit is 1. Now we have -0-. Negative 101 can be subtracted from -0- to make 0. Our 2nd digit is -. We are left with 000, so out 1st digit is 0. Our answer is 1-0, or 9-3, or 6.





11/23/2009

Trinary Logic

I was recently reading a book on binary logic circuits, and I got an idea. Since electronic charges can be positive or negative, why not make a logic system with three values: positive charge, negative charge, and no charge. I invented a system of "trinary" logic which uses these three values. I don't know if it could be implemented in hardware, but I know it could be easily implemented in software.

The rules of trinary logic are:
The + and * functions represent addition and multiplication as in normal math, but 1+1=-1 and -1+-1=1

This means that and number plus itself is the opposite of itself:

0+0=0*-1
1+1=1*-1
-1+-1=-1*-1

This makes trinary logic useful in constructing cryptographic systems (systems of codes)

I recommend that the negative symbol be used to represent -1 because -1 is the only negative value in trinary. Similarly, you can substitute "neg" for -1 while speaking.

11/16/2009

Mark Alliance: Hi fighter

The Mark Alliance Hi fighter is the best fighter the MA can make. It has superior speed, maneuverability, firepower, and armor.

It has 9 engines, 1 main and 8 auxiliary. Altogether they provide speed rivaling that of an A-wing and maneuverability rivaling that of a TIE interceptor.

It is armed with 4 heavy laser cannons for tearing enemies to pieces, 4 proton torpedo launchers for destroying large amounts of fighters at long range, and 2 baradium missiles the size of a small fighter for punching giant holes in capital ship armor.

It's armor is laced with cortosis to resist energy-based weapons (anything but frag grenades and slugthrowers) and is made with the finest alloys MA researchers have developed.