From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.37.235 with SMTP id q98mr18064956ota.84.1483466554659; Tue, 03 Jan 2017 10:02:34 -0800 (PST) X-Received: by 10.157.37.151 with SMTP id q23mr2529145ota.4.1483466554625; Tue, 03 Jan 2017 10:02:34 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!75no6039086ite.0!news-out.google.com!g131ni17462itg.0!nntp.google.com!75no6039082ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Jan 2017 10:02:34 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=67.0.242.189; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 67.0.242.189 References: <9ca07b79-db85-4d4a-b082-61cd75fcc1c8@googlegroups.com> <20f3a379-e76d-4323-8f1a-a1bb77b93d7e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <73cc51c6-035f-4622-8952-a7c0f48fbcb2@googlegroups.com> Subject: Re: Interfacing Ada With Full Runtime Directly to Electronic Chips From: Shark8 Injection-Date: Tue, 03 Jan 2017 18:02:34 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:33025 Date: 2017-01-03T10:02:34-08:00 List-Id: On Tuesday, January 3, 2017 at 3:34:33 AM UTC-7, Dmitry A. Kazakov wrote: > On 2017-01-03 06:33, Shark8 wrote: >=20 > > 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. >=20 > Out of curiosity, why tri-state logic and not full four-state one?=20 > 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 = =C2=B11 to be False (i.e. using inverse-logic).* There are some advantages to using a trinary system as well: balanced terna= ry eliminates the need for an adjust-step like 2's complement has because n= egative and positive numbers share a representation, simpler construction o= f components (eg a not-gate can be done with a single transistor, instead o= f two transistors like a binary computer has), and certain operations becom= e simpler as well (eg rounding and truncation are the same operation in bal= anced-ternary). * While you might think that this is wasting the states, it need not. Consi= der the situation where where you have several related binary operations in= a decision-tree -- by structuring your operator correctly you can reduce t= he 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 firs= t condition is true is when both inputs are true (a=3D0,b=3D0 =3D=3D> 0), t= hen in the second condition things are only true when a=3D0 [x]or b=3D0, 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 belo= w looks correct w/ monospaced font) |a=3D1|a=3D0|a=3DJ b=3D1| J | 1 | J=20 b=3D0| 1 | 0 | 1=20 b=3DJ| J | 1 | J=20 So there you have it -- demonstrable proof that the ternary system can simp= lify 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 belo= w.) |a=3D1|a=3D0|a=3DJ b=3D1| 1 | J | 1=20 b=3D0| 1 | 0 | 1=20 b=3DJ| 1 | J | 1=20 corresponds to IF a And b THEN statements; ELSIF a >=3D b THEN -- Implies(a, b) statements; ELSE statements; END IF;