comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Interfacing Ada With Full Runtime Directly to Electronic Chips
Date: Tue, 3 Jan 2017 10:02:34 -0800 (PST)
Date: 2017-01-03T10:02:34-08:00	[thread overview]
Message-ID: <73cc51c6-035f-4622-8952-a7c0f48fbcb2@googlegroups.com> (raw)
In-Reply-To: <o4funn$1dmh$1@gioia.aioe.org>

On Tuesday, January 3, 2017 at 3:34:33 AM UTC-7, Dmitry A. Kazakov wrote:
> On 2017-01-03 06:33, Shark8 wrote:
> 
> > That's really interesting, because the system I want to do
> > [ultimately] is a ternary computer -- for which tri-state logic is a
> > perfect fit.
> 
> Out of curiosity, why tri-state logic and not full four-state one? 
> Tri-state is incomplete in some operations (e.g. in implication).

The completeness of the logic-system depends on which logic-system is being used -- there are several for three-valued logic -- but it is a non-issue because you can use full Boolean logic (e.g.) by defining 0 to be True and ±1 to be False (i.e. using inverse-logic).*

There are some advantages to using a trinary system as well: balanced ternary eliminates the need for an adjust-step like 2's complement has because negative and positive numbers share a representation, simpler construction of components (eg a not-gate can be done with a single transistor, instead of two transistors like a binary computer has), and certain operations become simpler as well (eg rounding and truncation are the same operation in balanced-ternary).

* While you might think that this is wasting the states, it need not. Consider the situation where where you have several related binary operations in a decision-tree -- by structuring your operator correctly you can reduce the number of comparisons needed. Example:

IF a And b THEN
 Procedure_1;
ELSIF a Or b THEN
 Procedure_2;
ELSE
 Procedure_3;
END IF;

We can represent the above with a single operator -- the only time the first condition is true is when both inputs are true (a=0,b=0 ==> 0), then in the second condition things are only true when a=0 [x]or b=0, so we 'commandeer' one of the false-values to represent "condition 1 is false, but true for condition 2", in this case choosing '1' for that value, and the remaining states get the other false-value ('J', so that the table below looks correct w/ monospaced font)
   |a=1|a=0|a=J
b=1| J | 1 | J 
b=0| 1 | 0 | 1 
b=J| J | 1 | J 

So there you have it -- demonstrable proof that the ternary system can simplify even code-implementation -- as the above combines two conditions into a single operator. (The same thing can be done when you want to check both 'implies' and whether or not the first operand was true, see the table below.)

   |a=1|a=0|a=J
b=1| 1 | J | 1 
b=0| 1 | 0 | 1 
b=J| 1 | J | 1 

corresponds to

IF a And b THEN
  statements;
ELSIF a >= b THEN -- Implies(a, b)
 statements;
ELSE
 statements;
END IF;

  reply	other threads:[~2017-01-03 18:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02  2:42 Interfacing Ada With Full Runtime Directly to Electronic Chips patrick
2017-01-02  9:14 ` Dmitry A. Kazakov
2017-01-02 13:28   ` patrick
2017-01-02 17:19     ` Dmitry A. Kazakov
2017-01-03  2:41       ` patrick
2017-01-03  5:33     ` Shark8
2017-01-03 10:34       ` Dmitry A. Kazakov
2017-01-03 18:02         ` Shark8 [this message]
2017-01-03 20:34           ` Dmitry A. Kazakov
2017-01-03 20:50             ` Shark8
2017-01-03 21:41               ` Dmitry A. Kazakov
2017-01-02 14:02 ` Brian Drummond
2017-01-02 15:02 ` Dennis Lee Bieber
2017-01-02 16:25 ` Simon Wright
2017-01-02 16:46   ` patrick
2017-01-04 19:29   ` antispam
2017-01-04 20:51     ` Simon Wright
2017-01-04 22:05       ` antispam
2017-01-03  7:55 ` philip.munts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox