[Coco] replicating bitwise operators in BASIC

Dave Philipsen dave at davebiz.com
Fri Sep 9 15:43:51 EDT 2016


I think it's just to demonstrate that all boolean functions can be 
carried out using just NAND.  The same is also true of NOR which is 
essentially a NAND function with the inputs inverted.  An interesting 
fact I just read:  The Apollo guidance computer which was used in the 
Apollo spacecraft was made up entirely of NOR gates.

And most likely when you use any other boolean function in software it 
will all eventually boil down to the equivalent logic of NOT and AND 
whether it's somewhere in the BASIC interpreter or in the microcode of 
the CPU.




On 9/9/2016 2:29 PM, Johann Klasek wrote:
> On Fri, Sep 09, 2016 at 06:26:43PM +0200, Johann Klasek wrote:
>> On Fri, Sep 09, 2016 at 07:14:48AM -0500, Dave Philipsen wrote:
>>> Actually the XOR could be constructed out of just AND and NOT.
>>>
>> Usually this can be written as
>>
>> Z = (X OR Y) AND NOT(X AND Y)
>>
>> and could be optimized to
>>
>> Z = (X OR Y) - (X AND Y)
> Still wondering why to restrict our considerations to only NOT and AND
> operator as we know that we do have also OR?
> (as Dave pointed this out, too)
>
> Johann
>
>



More information about the Coco mailing list