Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
A ternary logic representation enables a more compact and efficient information encoding than the equivalent binary logic representation. The argument stated is as follows: if we assume that a digital circuit has N possible input combinations, then a binary circuit requires log2N input lines and a ternary circuit requires log3N input lines.
The optimum radix ( r ) of a fractional number is found to be the natural logarithm (e). Ternary logic uses number representation with r=3, compared to binary logic which uses r=2, hence the most economical integer radix which is the closest to the natural logarithm e, is base 3.
Говорят, что индейцы Аймара используют троичную логику как основную в системе понятий, что нашло отражение в их языке. Да, нет и не знаю. Закон исключения третьего для них не работает. На уровне софта тоже используется довольно часто. Например в SQL: true, false и null.
Why didn't you write about universal function (Webb function) that can express others?
Inc(x) = W(x, x)
Dec(x) = Inc(Inc(x))
~x = W(W(Dec(x), Inc(x)), Inc(W(Dec(x), x))
x & y = ~(~x | ~y)
x | y = Inc(Inc(W(x, y))There is a big disadvantage of ternary logic comapre to the binary one. Compare functions above with the following ones:
~x = W(x, x)
x & y = ~(~x | ~y) = W(W(x, x), W(y, y))
x | y = Inc(W(x, y)) = W(W(x, y), W(x, y))Ternary logic has much more operations for "logical and" (22 W ops versus 3).
Also, see my question about Inverse function in multi-valued logic through the Webb function on math.stackexchange.com.
Implementation of a Simple Ternary System