toxopid's place

as one man once said: autism announcement

take me to:

welcome to the infodump

running from the inevitable is ill-advised


ternary computing

you know how in our counting system, we count from 0 to 9, then we go up to another digit? with binary, we do this only with the digits 0 and 1. we can do a suprising amount of big math with just two digits! though we run into a kinda big problem when we want to work with a number below zero. when that happens, we have three ways of dealing with that: sign magnitude, one's complement and two's complement. each has its problems, and we don't like those, so how about we do away with this problem?


What if one of the digits was negative? Yeah, that's what balanced ternary is! Instead of the 0s and 1s of binary, balanced ternary uses a -1 in the system itself. It's usually represented by a minus sign (-) or Z, which looks stupid imo, I like the T for -1 instead. This also makes counting a bit more complicated, but trust me when I say it's better. I should probably show you some examples:

5ten = 1TTbal3
5 = 1 * 32 +(-1) * 31 +(-1) * 30

20ten = 1T1Tbal3
20 = 1 * 33 +(-1) * 32 +1 * 31 +(-1) * 30