Some early (pre-transistor) Russian computers used balanced ternary
logic. This has three states: -1, 0 and +1, which I will write just as
-, 0 and +. This gives a natural representation of negative numbers:
ternary decimal
0 0
+ 1
- -1
+- 2
-+ -2
+0 3
-0 -3
++ 4
-- -4
+-- 5
-++ -5
and so on. To negate a number, you just exchange + and -.
Aside from being symmetrical wrt. positive and negative numbers,
balanced ternary is also slightly more compact than binary, under the
asumption that the size of a digit is proportional to the number of
different digits. A number N represented in base B will require
log(N)/log(B) digits and each of these will have size B, so the total
size is log(N)B/log(B). So, the smaller B/log(B) is, the more compact
the representation. Some values:
B B/log(B)
2 2.885
3 2.731
4 5.545
However, it turns out that circuits for ternary logic are more than
1.5 times as complex as binary logic and also require more power. So
binary is, overall, more efficient given todays technology. As for the
future, who knows? Maybe three-valued logic is naturally expressed as
three different polarisations of light or three different phases of a
signal.
As for sources, I believe Knuths "Art of Computer Programming"
describes balanced ternary. I'm not sure if it contains references to
the Russian computers, though.
Torben Mogensen (tor...@diku.dk)
Almost anything, including the above, can be found in Knuth.
--
Chuck F (cbfal...@yahoo.com) (cbfal...@XXXXworldnet.att.net)
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:u...@ftc.gov (for spambots to harvest)
> Aside from being symmetrical wrt. positive and negative numbers,
> balanced ternary is also slightly more compact than binary, under the
> asumption that the size of a digit is proportional to the number of
> different digits. A number N represented in base B will require
> log(N)/log(B) digits and each of these will have size B, so the total
> size is log(N)B/log(B). So, the smaller B/log(B) is, the more compact
> the representation. Some values:
Why would different bases, at the hardware level, have different size
digits?
-chris
gotta buy!, when is his 4th edition due out? [or is it already?]
Also what are the other classic compsci books? [i found concrete maths by
knuth and others an excellent book for preparation for learning complexity
and so on..]..
.
.sachi
Amicably, Chikara
To store a digit in base B, you have to be able to store B different
states. That will take more space (and power) for higher B. You can
discuss whether this is linear in B, though.
Torben Mogensen (tor...@diku.dk)